Scene lighting effect implementation method and device based on unreal engine, and storage medium

CN120019415APending Publication Date: 2025-05-16BOE TECHNOLOGY GROUP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380010705.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-15
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing low-light rendering technology in the field of digital twins is difficult to effectively render the scene in the night scene or insufficient lighting, resulting in performance bottlenecks and memory waste.

Method used

In Unreal Engine, by building the scene and placing the target static mesh, setting its texture map material to a self-luminous material, and using a custom light mixing coefficient, which is a function of diffuse light intensity, specular light intensity, direction light intensity, and distance field.

Benefits of technology

It realizes the luminous effect of simple mode under night scenes or insufficient lighting conditions, meets the night scene rendering mode, and does not require additional texture maps, which reduces the weight of the model and avoids performance bottlenecks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120019415A_ABST
    Figure CN120019415A_ABST
Patent Text Reader

Abstract

The invention discloses a scene lighting effect implementation method and device based on an unreal engine and a storage medium, and the method comprises the steps: constructing a scene and placing a target static grid body in the unreal engine; the texture map of the target static grid body is set to be a self-luminous material, the luminous coefficient of the self-luminous material is a self-defined illumination mixing coefficient, and the self-defined illumination mixing coefficient is a function of diffuse reflection light intensity, specular reflection light intensity, directional light intensity and a distance field.
Need to check novelty before this filing date? Find Prior Art

Description

Scene lighting effect implementation method and device based on Unreal Engine, and storage medium Technical Field

[0001] The embodiments of the present disclosure relate to, but are not limited to, the field of Unreal Engine technology, and in particular to a method and device for implementing scene lighting effects based on Unreal Engine, and a storage medium. Background Art

[0002] Currently, scene lighting effects in the digital twin field, such as in smart campuses, are evolving from the original model of fixed-point light sources combined with global illumination to one that is increasingly closer to real-world scenarios. This includes, but is not limited to, daylight deviations caused by longitude and latitude, and seasonal variations in daylight duration. Because scene lighting effects more closely resemble real-world scenarios, the ability to render scenes at night (or in low-light conditions) has become a key indicator of the maturity of digital twin systems.

[0003] Summary of the Invention

[0004] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0005] The present disclosure provides a method for realizing scene lighting effects based on Unreal Engine, including:

[0006] In Unreal Engine, build the scene and place the target Static Mesh;

[0007] The material of the texture map of the target static mesh is set to a self-luminous material, and the luminous coefficient of the self-luminous material is set to a custom lighting mixing coefficient, where the custom lighting mixing coefficient is a function of diffuse light intensity, specular light intensity, directional light intensity and distance field.

[0008] An embodiment of the present disclosure also provides a scene lighting effect implementation device based on the Unreal Engine, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the scene lighting effect implementation method based on the Unreal Engine described in any embodiment of the present disclosure based on the instructions stored in the memory.

[0009] The embodiments of the present disclosure further provide a storage medium on which a computer program is stored. When the program is executed by a processor, the method for realizing scene lighting effects based on the Unreal Engine as described in any embodiment of the present disclosure is implemented.

[0010] Other aspects will become apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are intended to provide a further understanding of the technical solutions of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solutions of the present disclosure and do not constitute a limitation of the technical solutions of the present disclosure. The shapes and sizes of the components in the drawings do not reflect the actual scale and are intended only to illustrate the contents of the present disclosure.

[0012] FIG1 is a flow chart of a method for realizing scene lighting effects based on Unreal Engine provided by an exemplary embodiment of the present disclosure;

[0013] 2A and 2B are schematic diagrams of two scene rendering effects provided by exemplary embodiments of the present disclosure;

[0014] FIG3 is a flow chart of another method for realizing scene lighting effects provided by an exemplary embodiment of the present disclosure;

[0015] FIG4 is a schematic structural diagram of a scene lighting effect implementation device based on Unreal Engine provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] To make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other in any manner.

[0017] Unless otherwise defined, the technical or scientific terms used in the embodiments of the present disclosure should have the ordinary meaning understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprising" mean that the elements or objects preceding the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0018] A digital twin leverages data from physical models, sensor updates, and operational history to integrate multidisciplinary, multi-physics, multi-scale, and multi-probability simulation processes. This process is mapped in virtual space, reflecting the entire lifecycle of the corresponding physical equipment. A digital twin essentially creates a digital "clone" of a device or system.

[0019] Unreal Engine (UE) is the tool of choice for many digital twin applications. It's a powerful engine widely used in game development and visualization projects. Its Blueprint visual scripting system enables non-technical users to program 3D model processes without writing any code. It also has built-in tools for accepting real-time data for processing. While the concept of "night scene" doesn't exist in the field of virtual simulation itself, in this disclosure, "night scene" refers to the situation where the entire scene becomes dark when the skylight intensity is below 0.5.

[0020] Currently, the mainstream low-light rendering technologies used in the field of digital twins are generally the following:

[0021] (1) A large number of array-type negative axis point light sources are laid out throughout the scene, scattering light onto the facade to simulate the status of the building's electrical equipment. The advantage of this approach is that all light effects for all buildings, models, and rooms can be customized. The disadvantage is that when too many array-type negative axis point light sources are laid out, the performance bottleneck of the Graphics Processing Unit (GPU) will cause frame drops and lags in the entire scene, which is particularly noticeable in cloud deployments.

[0022] (2) Use the post-processing box to set the lowest light source coefficient within the range. Usually, this lowest light source coefficient is between 0.1 and 0.5. The advantage of this is that it can irradiate the entire range of the scene. The disadvantage is that it will reduce the rendering effect of the point light source within the scene itself. Due to the constant exposure coefficient, the local details of the model need to be superimposed with multiple post-processing boxes. During the level streaming process, the linkage of control coefficients will cause memory waste and huge performance overhead.

[0023] (3) Use separate materials for processing. For each mesh that needs to be processed, pre-make two sets of texture materials and texture maps, and dynamically load and unload them according to the corresponding lighting threshold. The advantage of this is that it can ensure that all materials have special customized processing. The disadvantage is that once in the process of iteration and repair, the corresponding materials and textures need to be frequently replaced, which will make the model heavier (the number of all texture maps and materials will be doubled).

[0024] As shown in FIG1 , an embodiment of the present disclosure provides a method for realizing scene lighting effects based on Unreal Engine, including:

[0025] Step 101. In Unreal Engine, build the scene and place the target static mesh.

[0026] Step 102: Set the material of the texture map of the target static mesh to a self-luminous material, and the luminous coefficient of the self-luminous material to a custom lighting mixing coefficient, which is a function of diffuse light intensity, specular light intensity, directional light intensity, and distance field.

[0027] The scene lighting effect realization method provided by the embodiment of the present disclosure realizes the lighting effect (close to the night scene lights) of a simple model (L1-L2 level model) under night scene (or insufficient lighting) conditions by constructing a scene and placing a target static mesh in the Unreal Engine, setting the material of the texture map of the target static mesh to a self-luminous material, and setting the luminous coefficient of the self-luminous material to a custom lighting mixing coefficient. The custom lighting mixing coefficient is a function of the diffuse light intensity, the specular light intensity, the directional light intensity and the distance field, thereby realizing the lighting effect (close to the night scene lights) of the simple model (L1-L2 level model) under night scene (or insufficient lighting) conditions, so as to meet the night scene rendering mode.

[0028] The present invention adopts a dynamic calculation coefficient (a formula method to set a transparent mask and a corresponding luminous coefficient) to set the luminous state, and completes the rendering effect of the corresponding model facade in the absence of light through a computable coefficient material implementation scheme, so as to achieve the rendering composition and scene display of the corresponding night scene part without using the point light source of the Unreal Engine, and the original texture map can be used for the production of luminous materials, without the need for additional texture maps, thereby reducing the weight of the model.

[0029] Unreal Engine uses the DirectX API to render 3D scenes. DirectX is a Microsoft-developed graphics application programming interface (API) that helps developers quickly render complex 3D scenes. To make rendered graphics appear more realistic, Direct3D provides the ability to paint textures on surfaces. Generally speaking, a texture is one or more two-dimensional images representing the surface of an object, also known as a texture map. When textures are mapped onto a surface in a specific manner, they create a more realistic appearance. Texture painting has become an essential rendering method in popular graphics systems. To understand texture mapping, think of textures as pixel colors applied to an object's surface. In the real world, textures represent an object's color, pattern, and tactile characteristics. However, in Direct3D, textures simply represent the color pattern on an object's surface; they do not alter the object's geometry. Furthermore, they are computationally intensive.

[0030] Static Meshes are a fundamental type of renderable geometry in Unreal Engine. While the mesh itself is static, a Static Mesh Actor can be made movable, such as creating an elevator, or simulated to collide with the player. In Unreal Engine, Emissive Materials allow users to create the visual effect of surfaces emitting or casting light in a very low-cost yet effective way, without using any of Unreal's standard light types.

[0031] Rendering materials are the decisive factors that can affect the visual performance of the model in the UE engine. Virtual Texture (VT) divides the traditional mip texture into smaller pages (Virtual Texture Page) for storage, so as to achieve separate references to the page and avoid streaming too many redundant textures. Feedback: Stores the VT Page information corresponding to the current screen pixel, which is used to determine which VT data needs to be processed and generated. The physical texture (Physical Texture) resource corresponding to the virtual texture is the actual reference object in the VT sampling process. The physical texture is also divided into many pages (Physical Texture Page) for sampling and storing virtual textures. The virtual texture page table (PageTable) is used to address the VT Physical Texture Page data. There is a one-to-one correspondence between the Virtual Texture Page in use and the PageTable Texel.

[0032] The distance field records the closest distance from a point in space to the surface of the model. For each point in the scene, its distance to the nearest surface can be calculated. A distance field greater than 0 indicates that the point is outside the model, a distance field equal to 0 indicates that the point is on the surface of the model, and a distance field less than 0 indicates that the point is inside the model. UE uses volume textures to record distance fields, which are used to implement dynamic ambient occlusion and shadows for static meshes (Static Mesh Actors). After the Unreal Engine turns on the distance field (in the "Project Settings", find "Rendering", and then find "Generate Mesh Distance Field" under "Lighting"), the corresponding distance field is generated for the mesh. The size of the generated distance field can be viewed by opening the mesh editor of a certain model.

[0033] In some example embodiments, the blending mode of the target Static Mesh's texture map is Transparency Mask.

[0034] In this disclosure, a transparent mask is an implicit overlay of the transparent material slot of the target static mesh with a transparent material. This allows for convenient batch processing of transparent material objects without changing the original mesh content when manipulating the target object.

[0035] Using UE5's Material Editor, you can create and adjust materials, including properties such as textures, colors, reflections, and transparency. Transparency is the term used to describe a surface's ability to block or allow light to pass through. In Unreal Engine, transparency works by assigning each pixel an opacity value between 0 and 1. When the opacity is 1, the surface is completely opaque, meaning it blocks 100% of the light that hits it. When the opacity is 0, the surface allows all light to pass through. Opacity values ​​between 0 and 1 create pixels that are partially see-through. Opacity Mask: Only available when using Masked mode. Like Opacity, but without the semi-transparent color, the material is either completely visible or completely invisible in this mode.

[0036] In some exemplary embodiments, the custom lighting mixing coefficient is any one of the following: a basic lighting mixing coefficient Q1 or an enhanced lighting mixing coefficient Q2, where Q2=a*Q1, and a is between 2 and 28.6.

[0037] In the present disclosure, the target static mesh in the area with weak light intensity can use the basic lighting mixing coefficient Q1, and the target static mesh in the area with strong light intensity, such as light boxes / billboards, can use the enhanced lighting mixing coefficient Q2. The enhanced lighting mixing coefficient Q2 is multiplied on the basis of the basic lighting mixing coefficient Q1. The default color temperature is generally 6500K (warm white). When the color temperature is 6500K, the value range of a is between 2 and 28.6. When the color temperature rises, the coefficient a becomes smaller; when the color temperature drops, the coefficient a becomes larger. The higher the color temperature, the stronger the white light; the lower the color temperature, the stronger the yellow light. For example, a can be 10.65, that is, Q2=10.65*Q1.

[0038] In some exemplary embodiments, the basic lighting mixing coefficient Q1 is calculated by the following formula:

[0039] Among them, Iambdiff is the diffuse light intensity, Ildiff is the directional light intensity, Ispec is the specular light intensity, A is the angle between the incident light direction and the vertex normal, 0≤A≤90°.

[0040] In some exemplary embodiments, the diffuse reflection light intensity calculation formula is: Iambdiff = Kd*Ia;

[0041] Among them, $I_a$ represents the ambient light intensity, $K_d$ ($0 < K_d < 1$) is the reflection coefficient of the material to the ambient light, and $I_{ambdiff}$ represents the light intensity of the interaction reflection between the diffuse reflector and the ambient light.

[0042] The calculation formula for the directional light intensity is: $I_{ldiff}=K_d\times I_l\times Cos(\theta)$;

[0043] Among them, $I_l$ is the point light source intensity, $\theta$ is the angle between the incident light direction and the vertex normal, called the incident angle ($0\leq\theta\leq90^{\circ}$), $I_{ldiff}$ is the light intensity of the interaction reflection between the diffuse reflector and the directional light. If $N$ is the unit normal vector of the vertex and $L$ represents the unit vector from the vertex to the light source (note from the vertex to the light source), then $Cos(\theta)$ is equivalent to $dot(N,L)$. Therefore, there is also: $I_{ldiff}=K_d\times I_l\times dot(N,L)$. Combining the ambient light and the directional light source, the Lambert lighting model can be written as: $I_{diff}=I_{ambdiff}+I_{ldiff}=K_d\times I_a+K_d\times I_l\times dot(N,L)$.

[0044] The calculation formula for the specular reflection light intensity is: $I_{spec}=K_s\times I_l\times(dot(N,H))$ Ns ;

[0045] Among them, $K_s$ is the specular reflection coefficient, $N_s$ is the specular highlight exponent, $N$ is the unit normal vector of the incident point, and $H$ is the intermediate vector between the light incident direction $L$ and the view point direction $V$, usually also called the half-angle vector (the half-angle vector is widely used in various lighting models, not only because of the information value contained in the half-angle vector, but also because the calculation of the half-angle vector is very simple: $H=(L + V) / |L + V|$).

[0046] In some other exemplary embodiments, the calculation formula for the diffuse light intensity is: $I_{ambdiff}=K_d\times I_a$;

[0047] Among them, $I_a$ represents the ambient light intensity, $K_d$ ($0 < K_d < 1$) is the reflection coefficient of the material to the ambient light, and $I_{ambdiff}$ represents the light intensity of the interaction reflection between the diffuse reflector and the ambient light.

[0048] The calculation formula for the directional light intensity is: $I_{ldiff}=K_d\times I_l\times Cos(\theta)$;

[0049] Where Il is the intensity of the point light source, θ is the angle between the incident light direction and the vertex normal, called the angle of incidence (0 ≤ θ ≤ 90°), and Ildiff is the intensity of the light reflected from the diffuse reflector and the directional light. If N is the vertex unit normal vector, and L is the unit vector pointing from the vertex to the light source (note that the vertex points to the light source), then Cos(θ) is equivalent to dot(N, L), so we also have: Ildiff = Kd * Il * dot(N, L). Combining ambient light and directional light sources, the Lambert lighting model can be written as: Idiff = Iambdiff + Ildiff = Kd * Ia + Kd * Il * dot(N, L).

[0050] The formula for calculating the intensity of specular reflected light is: Ispec=Ks*Il*(dot(V,R)) Ns ;

[0051] Among them, Ks is the specular reflection coefficient, Ns is the specular index, V represents the observation direction from the vertex to the viewpoint, and R represents the direction of reflected light, R = 2*dot(N,L)*NL.

[0052] In the present disclosure, the specular reflection model may be a Phong model, which assumes that the intensity of specular reflection is related to the angle between the reflected light and the line of sight: Ispec = Ks*Il*(dot(V,R)) Ns Since the direction of reflected light R can be calculated from the incident light direction L (from the vertex to the light source) and the object's normal vector, R+L=2*dot(N,L)*N, that is, R=2*dot(N,L)*N–L. Therefore, the final calculation formula is: Ispec=Ks*Il*(dot(V,(2*dot(N,L)*N–L)) Ns ;

[0053] The specular reflection model can also be the Blinn-Phong illumination model (i.e., the modified specular light model). Blinn-Phong is a model based on the modified Phong model. Its formula is: Ispec = Ks*Il*(dot(N,H)) Ns .

[0054] The parameter values ​​in the above-mentioned illumination model formulas may vary depending on the scene. Therefore, in practical applications, it is necessary to dynamically obtain the parameter values. Moreover, the values ​​of these parameters also change dynamically over time.

[0055] Regardless of whether a model exists or not, the target scene has longitude and latitude, and the simulation scene must have the current time. Therefore, the distance field and natural light coefficient of the current scene can be obtained based on the following parameters: time + longitude and latitude + range of the target scene.

[0056] In some exemplary embodiments, the angle A between the incident light direction and the vertex normal is calculated by the following formula: A=arccos dot(N, L).

[0057] The cosine formula of the angle between vector X(x1,y1) and vector Y(x2,y2) in two-dimensional space is:

[0058] Two n-dimensional sample points X(x 11 ,x 12 ,…,x 1n ) and Y(x 21 ,x 22 ,…,x 2n ) is:

[0059] The cosine of the angle ranges from -1 to 1. A larger cosine indicates a smaller angle between two vectors, while a smaller cosine indicates a larger angle. When the two vectors are pointing in opposite directions, the cosine reaches its maximum value of 1, and when the two vectors are pointing in opposite directions, the cosine reaches its minimum value of -1.

[0060] Generally, the lighting range and cosine distance field effects can be determined based on business needs. If distant objects do not need to emit light, this effect can be avoided by defaulting them to be invisible. For example, if the application scenario is a seaside scene, the far end of the ocean is always black, so there is no need to calculate the lighting range and cosine distance field effects. However, if the building itself has a distance field effect of 100 meters on the 30th floor, then the lighting range and cosine distance field effects must be calculated when the viewpoint moves.

[0061] Since it is impossible to calculate point by point in the scene (doing so would put a lot of pressure on the scene rendering), the angle calculation is usually performed on the characteristic buildings / characteristic areas according to business needs. For example, the characteristic area can be the window glass area in Figure 2A or Figure 2B. After correcting the distance field, use As the basic lighting mixing coefficient Q1, and then assign the lighting coefficient exposed by the corresponding blueprint as the basic lighting mixing coefficient Q1 or the enhanced lighting mixing coefficient Q2 to complete the corresponding target static network individual luminescence and its influence range.

[0062] In some exemplary embodiments, the constructed scene is an outdoor scene, and the target static mesh is an L1 or L2 model.

[0063] The scene lighting effect implementation method disclosed in the present invention mainly uses a computable coefficient material implementation scheme to complete the rendering effect of the corresponding model facade in the absence of light, so as to achieve the rendering composition and scene display of the corresponding night scene part without using the point light source of the UE engine.

[0064] Usually, indoor night scenes really need light sources for rendering. Generally speaking, indoor scenes require high-precision visual expression, so it is difficult to replace and transform them through other means. Wide-area visual effects can be achieved through the scene lighting effect implementation method disclosed in this disclosure.

[0065] The scene lighting effect implementation method disclosed herein is primarily intended for rendering large-scale outdoor scenes, but is not limited to such environments. For example, it can be used for rendering self-luminous plants in dense forests, deep-sea scenes, cave scenes, etc. In the field of digital twins, the scene lighting effect implementation method disclosed herein can also be applied to artificial buildings such as parks.

[0066] The accuracy in the digital twin world can be roughly divided into five levels, gradually increasing from L1 to L5: L1 is low precision, L2 is medium precision, L3 is high precision, L4 is high simulation, and L5 is full simulation.

[0067] As shown in Figure 3, in actual application, first select the target building, filter the model material and texture, then perform diffuse reflection processing, specular reflection processing, corrected specular lighting processing, and distance field calculation on the material and texture to obtain the mixed lighting coefficient, and then use the mixed lighting coefficient to assign the blueprint parameter.

[0068] An embodiment of the present disclosure also provides a scene lighting effect implementation device based on the Unreal Engine, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the scene lighting effect implementation method based on the Unreal Engine as described in any embodiment of the present disclosure based on the instructions stored in the memory.

[0069] As shown in Figure 4, in one example, a driver module for a display device may include: a processor 410, a memory 420, and a bus system 430. The processor 410 and the memory 420 are connected via the bus system 430. The memory 420 is used to store instructions, and the processor 410 is used to execute the instructions stored in the memory 420. Specifically, the processor 410 constructs a scene and places a target static mesh in the Unreal Engine; sets the material of the texture map of the target static mesh to a self-luminous material, and the luminous coefficient of the self-luminous material to a custom lighting mixing coefficient, which is a function of diffuse light intensity, specular light intensity, directional light intensity, and distance field.

[0070] It should be understood that the processor 410 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0071] The memory 420 may include a read-only memory and a random access memory, and provides instructions and data to the processor 410. A portion of the memory 420 may also include a non-volatile random access memory. For example, the memory 420 may also store information about the device type.

[0072] In addition to the data bus, the bus system 430 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are labeled as the bus system 430 in FIG.

[0073] During implementation, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the processor 410 or by instructions in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 420, and the processor 410 reads the information in the memory 420 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.

[0074] The present disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the Unreal Engine-based scene lighting effect implementation method described in any of the embodiments of the present disclosure. The method for controlling the implementation of scene lighting effects by executing executable instructions is substantially the same as the Unreal Engine-based scene lighting effect implementation method provided in the aforementioned embodiments of the present disclosure and is not further described here.

[0075] In some possible implementations, various aspects of the method for implementing scene lighting effects based on the Unreal Engine provided by the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the method for implementing scene lighting effects based on the Unreal Engine according to various exemplary embodiments of the present disclosure described above in this specification. For example, the computer device may execute the method for implementing scene lighting effects based on the Unreal Engine recorded in the embodiments of the present disclosure.

[0076] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0077] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As is well known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable, and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0078] Although the embodiments disclosed in this disclosure are as described above, the contents described are merely embodiments adopted to facilitate understanding of the disclosure and are not intended to limit the disclosure. Any person skilled in the art may make any modifications and changes in the form and details of the implementation without departing from the spirit and scope of the disclosure. However, the scope of patent protection of the disclosure shall still be based on the scope defined by the appended claims.

Claims

1. A method for realizing scene lighting effects based on Unreal Engine, comprising: In Unreal Engine, build the scene and place the target Static Mesh; The material of the texture map of the target static mesh is set to a self-luminous material, and the luminous coefficient of the self-luminous material is a custom lighting mixing coefficient, and the custom lighting mixing coefficient is a function of diffuse reflection light intensity, specular reflection light intensity, directional light intensity and distance field.

2. The method according to claim 1, wherein: The blending mode of the texture map of the target Static Mesh is Transparency Mask.

3. The method according to claim 1, wherein: The custom lighting mixing coefficient is any one of the following: a basic lighting mixing coefficient Q1 or an enhanced lighting mixing coefficient Q2, where Q2=a*Q1, and a is between 2 and 28.

6.

4. The method according to claim 3, wherein: The basic illumination mixing coefficient Q1 is calculated by the following formula: Among them, Iambdiff is the diffuse light intensity, Ildiff is the directional light intensity, Ispec is the specular light intensity, A is the angle between the incident light direction and the vertex normal, 0≤A≤90°.

5. The method according to claim 4, wherein: The calculation formulas for the diffuse reflection light intensity Iambdiff, the directional light intensity Ildiff and the specular reflection light intensity Ispec are as follows: Iambdiff = Kd*Ia; Among them, Ia is the ambient light intensity, and Kd is the reflection coefficient of the material to the ambient light; Ildiff=Kd*Il*dot(N,L); Where Il is the point light intensity, N is the vertex unit normal vector, and L is the unit vector pointing from the vertex to the light source; Ispec=Ks*Il*(dot(N,H)) Ns ; Among them, Ks is the specular reflection coefficient, Ns is the specular index, and H is the light incident direction L and the viewpoint The middle vector of direction V, H = (L+V) / |L+V|.

6. The method according to claim 4, wherein: The calculation formulas for the diffuse reflection light intensity Iambdiff, the directional light intensity Ildiff and the specular reflection light intensity Ispec are as follows: Iambdiff = Kd*Ia; Among them, Ia is the ambient light intensity, and Kd is the reflection coefficient of the material to the ambient light; Ildiff=Kd*Il*dot(N,L); Where Il is the point light intensity, N is the vertex unit normal vector, and L is the unit vector pointing from the vertex to the light source; Ispec=Ks*Il*(dot(V,R)) Ns ; Among them, Ks is the specular reflection coefficient, Ns is the highlight index, V represents the observation direction from the vertex to the viewpoint, R represents the direction of reflected light, and R = 2*dot(N,L)*NL.

7. The method according to claim 5 or 6, wherein: The angle A between the incident light direction and the vertex normal is calculated by the following formula: A=arccos dot(N,L).

8. The method according to claim 1, wherein: The scene is an outdoor scene, and the target static mesh is an L1 or L2 model.

9. A scene lighting effect realization device based on Unreal Engine, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the scene lighting effect realization method based on Unreal Engine as described in any one of claims 1 to 8 based on the instructions stored in the memory.

10. A storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for realizing scene lighting effects based on Unreal Engine according to any one of claims 1 to 8 is implemented.