A global illumination rendering method

By using lighting probes and voxel structures to collect and represent scene lighting information during the baking phase, and updating lighting information in real-time rendering, the problem that global lighting rendering on mobile terminals is difficult to update in real-time, and efficient global lighting rendering effect is achieved.

CN117745926BActive Publication Date: 2025-03-14SHANGHAI WENDIE NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311609145.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2025-03-14
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

The existing global lighting rendering technology is difficult to achieve real-time updates on mobile terminals, resulting in reduced game running speed and poor user experience.

Method used

The scene information is collected during the baking stage by using the light probe, the voxel structure is used to represent indirect lighting, and the lighting information of the light probe is updated in real-time rendering, and the synthesis process is carried out in combination with direct lighting.

Benefits of technology

It realizes full real-time global lighting of static objects on mobile terminals and real-time reception of static objects' ejection light by dynamic objects, improving the running speed and user experience of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117745926B_ABST
    Figure CN117745926B_ABST
Patent Text Reader

Abstract

The present invention provides a global illumination rendering method, including: S1: using illumination probes to collect scene information around each illumination probe in a baking stage; S2: using voxel structures to represent indirect illumination within a certain area of ​​the scene, calculating and storing the illumination probes and query directions corresponding to each voxel, and the integral angular scaling value in the baking stage; S3: updating the illumination information of the illumination probes, and updating and storing the irradiance information of each voxel according to the illumination information of the illumination probes, so as to render the image; S4: calculating the indirect illumination according to the irradiance value of each voxel, and synthesizing it with the direct illumination to generate a rendered image. The present invention optimizes the collection of ambient illumination in the scene, and realizes full real-time global illumination of static objects, and real-time reception of dynamic objects' ejected illumination of static objects, while occupying only a small amount of memory and baking time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer graphics, and in particular to a global lighting rendering method. Background Art

[0002] As hardware and network technologies mature, people's requirements for gaming experience are also increasing. In order to meet gamers' ultimate pursuit of game quality, the lighting effect of the game scene has also been challenged. From simple local lighting to global lighting requirements, the local lighting algorithm only considers the direct lighting from the light source to the surface, while the global algorithm can consider the interaction of light energy on all surfaces in the environment, that is, it considers both direct lighting and indirect lighting (multiple bounces of light), shadows, and changes in lighting during changes in perspective.

[0003] Global illumination is based on geometric optics. It solves the problem of how light rays from a light source interact with objects through reflection, refraction, and scattering to form a rendered image. This brings amazing effects to the game's image quality, but it also consumes a lot of computing resources, especially for dynamic scenes with a large number of faces or on mobile devices.

[0004] In global illumination technology, Irradiance volume is a rendering technology used to calculate global illumination. It divides the scene into many small volumes and records the intensity and color of the light received in each volume in order to more accurately simulate the behavior of light during rendering. This technology can improve rendering efficiency and make the rendering results more realistic and natural.

[0005] Volume Texture is a three-dimensional texture used to store lighting information in an irradiance volume. Volume Texture can be thought of as a cube, where each pixel represents a small volume in the irradiance volume, recording the intensity and color of the light received in the volume. During rendering, the lighting information in the irradiance volume can be obtained by sampling the Volume Texture in order to more accurately simulate the behavior of light.

[0006] In the existing technology, the use of Irradiance Volume is generally based on baking technology. Baking technology refers to pre-calculating the lighting information in the scene and storing it in textures or other data structures so that the lighting information can be quickly obtained during rendering. Baking can improve the efficiency of rendering and make the rendering results more realistic and natural, but this technology requires the generation of static ambient lighting in the editing stage. If you want to update the content of the volume texture in real time according to the current direct lighting, the cost is too huge, and it is difficult to get hardware resource support on mobile terminals or it will seriously consume the computing resources of mobile terminals, reducing the running speed of the game and greatly affecting the user experience of the game. Summary of the invention

[0007] To solve the above problems, the present invention provides a global lighting rendering method, including the following steps:

[0008] S1: Use light probes to collect scene information around each light probe during the baking phase;

[0009] S2: Indirect lighting within a certain area of ​​the scene is represented by voxel structure, and the corresponding lighting probe and query direction of each voxel are calculated and stored in the baking stage;

[0010] S3: Update the illumination information of the illumination probe, update the illumination information of each voxel according to the illumination information of the illumination probe and store it for rendering the image;

[0011] S4: Calculate indirect illumination based on the irradiance value of each voxel, and perform synthesis processing with direct illumination to generate the rendered image.

[0012] Furthermore, step S1 includes:

[0013] S11: Each light probe renders an N*N environment map during the baking phase to store information about surrounding objects;

[0014] S12: Compress the information of surrounding objects and save it in the form of a StructuredBuffer;

[0015] S13: Map to the corresponding voxels according to the visible pixel positions, and generate a Visibility Buffer to judge the visibility of voxels in the space to the corresponding light probe.

[0016] Furthermore, step S2 includes:

[0017] S21: Indirect light within a certain area of ​​the scene is expressed in voxel form;

[0018] S22: Calculate and select the optimal illumination probe for each voxel;

[0019] S23: Calculate the sampling direction of SH;

[0020] S24: Calculate the optimal integral angle scaling;

[0021] S25: Store the baking result.

[0022] Further, step S21 includes:

[0023] A 3D rectangular space is evenly divided into a certain number of voxels according to the specified particle size;

[0024] Each voxel is stored as an environmental cube, that is, the illumination intensity in the positive direction of the 6 spaces;

[0025] Calculate and store the illumination probe sequence numbers with the best matching degree in the 6 positive directions, as well as the sampling direction and integral angle scaling values ​​of the spherical harmonic coefficient.

[0026] Further, step S22: The method of selecting the optimal illumination probe includes:

[0027] Render a 32*32 environment map for the position of each voxel, and save the pixel positions around the voxel;

[0028] According to the visibility and distance of each light probe for each pixel, the weight parameters are calculated and accumulated to obtain the total weight of each pixel;

[0029] Select the light probe with the largest total weight as the optimal light probe.

[0030] Further, the method of calculating the sampling direction of SH in step S23 is to obtain the derivative of the xyz component of sampleDir and solve the system of equations based on the least squares method. The calculation formula is:

[0031]

[0032] Light probe Dir: positive lighting direction of 6 faces;

[0033] vi: The unit direction of each discrete point in the spherical space to the voxel position;

[0034] sampleDir: the SH sampling direction required;

[0035] di: Each discrete point in the spherical space reaches the unit direction of the light probe.

[0036] Further, S24: The method of calculating the optimal integral angle scaling is based on the least squares method, and the derivative of dot0 is:

[0037]

[0038] di: The dot product in the positive direction of the illumination on the 6-side and the discrete direction of the spherical space;

[0039] dci: dot product of the SH sampling direction and the direction from the discrete points in the spherical space to the position of the illumination probe;

[0040] dot0: The target to be solved.

[0041] Further, step S3 includes:

[0042] S31: According to the light source whose attributes change, find the irradiant that needs to be updated, and press the light probe in the irradiant into the update queue;

[0043] S32: Take out a lighting probe from the queue for each frame, and perform lighting update according to the previously stored surrounding scene information. When calculating the lighting at each sampling point, the indirect lighting result of the previous frame is superimposed to achieve multiple lighting bounces, and the lighting probe update result of the current frame is obtained and saved in the form of spherical harmonic coefficients.

[0044] S33: Mix the transition between the lighting probe update result of the current frame with the past result;

[0045] S34: According to the illumination probe ID, sampling direction and integral angle information stored in the irradiant, new illumination information is obtained from the illumination probe, and the irradiance information of each voxel is updated and stored.

[0046] Furthermore, the method for sampling illumination from illumination probes in step S34 is based on spherical harmonic sampling, and the dot product integral part is changed from the previously pre-calculated 180-degree integral ZH to real-time generation according to the integral angle scaling value.

[0047] Further, step S4 includes:

[0048] S41: Sampling the screen depth and restoring the location information;

[0049] S42: Sample the normal information, and then sample the illumination result of the irradiated body according to the position and normal.

[0050] By utilizing the method disclosed in the present invention, the collection of ambient lighting in the scene can be optimized, and full real-time global illumination of static objects and real-time reception of lighting ejected from static objects by dynamic objects can be achieved while occupying only a small amount of memory and baking time.

[0051] In order to gain a clearer and comprehensive understanding of the present invention, the specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0053] Figure 1 It is a flow diagram of the global lighting rendering method in the first embodiment. DETAILED DESCRIPTION

[0054] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0055] In the prior art, only the baking method has been used to save static global illumination results. This application targets the performance limitations of mobile platforms. This method innovatively improves and optimizes the collection of ambient lighting in the scene, and quickly and efficiently realizes full real-time global illumination of static objects, as well as real-time reception of bounced lighting from static objects by dynamic objects, while occupying only a small amount of memory and baking time.

[0056] See also Figure 1 , Figure 1 As a flow diagram of the global lighting rendering method in the first embodiment, the scheme of this application is as follows:

[0057] S1: Use light probes to collect scene information around each light probe during the baking phase;

[0058] S2: Indirect lighting within a certain area of ​​the scene is represented by voxel structure, and the corresponding lighting probe and query direction of each voxel are calculated and stored in the baking stage;

[0059] S3: Update the illumination information of the illumination probe, update the illumination information of each voxel according to the illumination information of the illumination probe and store it for rendering the image;

[0060] S4: Calculate indirect illumination based on the irradiance value of each voxel, and perform synthesis processing with direct illumination to generate the rendered image.

[0061] The steps will be described in detail below in connection with various embodiments.

[0062] S1: Use light probes to collect scene information around each light probe during the baking stage.

[0063] In the Light Probe step, probe points are placed in the scene to collect lighting. A Light Probe is an object used to sample scene lighting information. It can be thought of as a virtual camera that captures lighting information in the scene. Light Probes are usually placed at key locations in the scene to capture lighting information around that location for subsequent simulation of light behavior.

[0064] Baking is the process of pre-calculating the lighting information in the scene and storing it in textures or other data structures so that the lighting information can be obtained during rendering. Baking can improve the efficiency of rendering and make the rendering results more realistic and natural.

[0065] Each lighting probe simplifies light collection by saving geometric and material information of the surrounding scene. As a preferred embodiment, the specific steps of step S1 are as follows:

[0066] S11: Each light probe renders an N*N environment map during the baking phase to store information about surrounding objects.

[0067] In the baking stage, a 32*32 environment map (cubemap) is rendered with the position of each light probe as the camera origin to store information about surrounding objects. An environment map is a data structure used to store cube textures. It can unfold a cube surface into six two-dimensional squares, each of which corresponds to a face of the cube, thereby expressing the information of a cube.

[0068] Of course, as a variation of the embodiment, other alternatives may be used to replace the environment map.

[0069] S12: compress the information of surrounding objects and save it in the form of StructuredBuffer;

[0070] The information of surrounding objects refers to position, normal, albedo and emissive information. These information are used for lighting calculation, rendering pipelines, material design, etc., and the specific meanings are as follows:

[0071] Position: represents the position coordinates of a point on the surface of an object in the scene, usually represented by a three-dimensional vector.

[0072] Normal: represents the normal vector of an object surface at a certain point, usually represented by a three-dimensional vector. The normal vector refers to the vector perpendicular to the surface of the object. It is very important in lighting calculations and can be used to calculate information such as the angle between the light and the surface of the object.

[0073] Albedo: represents the reflectivity of the surface of an object, that is, the proportion of incident light reflected by the surface of the object. It is usually a value between 0 and 1 and can be used to calculate the color of the surface of the object.

[0074] Emissive: Indicates the intensity of the self-luminous surface of an object, that is, the intensity of the light emitted by the object itself. It is usually used to calculate the effect of self-luminous materials.

[0075] This application compresses the above information and saves it in the form of StructuredBuffer. At the same time, a visible buffer (Visibility Buffer) is generated according to the visible pixel position, which is used to determine the visibility of the pixel corresponding to the light probe later, specifically in the following step S13.

[0076] S13: Generate a Visibility Buffer according to mapping the visible pixel position to the corresponding voxel, so as to determine the visibility of the voxel in the space corresponding to the light probe.

[0077] As an implementation method, the specific implementation method is as follows:

[0078] Create a Visibility Buffer as a data structure for storing the visibility of voxels relative to light probes consistent with the subsequent voxel space distribution, with visibility initialized to 0.

[0079] The position information of each pixel in the environment map is traversed, the corresponding voxel number is converted according to the position, and the visibility of the corresponding voxel is set to 1.

[0080] In addition, as a more optimal implementation method, in the subsequent voxel selection calculation process of the optimal light probe, each voxel will also collect the visible pixel positions around it, and then query the Visibility Buffer of each light probe based on these pixel positions to measure the influence weight of each light probe on the voxel.

[0081] Step S2: The indirect lighting within a certain area of ​​the scene is represented by a voxel structure. During the baking phase, the lighting probe and query direction corresponding to each voxel, as well as the integral angular scaling value, are calculated and stored.

[0082] As a preferred implementation, it specifically includes steps S21-S25:

[0083] S21: Represent the indirect lighting within a certain area of ​​the scene in the form of voxels.

[0084] The method of using voxels to represent indirect lighting within a space is as follows: a 3D rectangular space is evenly divided into a certain number of voxels according to a specified granularity; each voxel is finally stored as an ambient cube, that is, the light intensity in the six positive directions of the space.

[0085] Calculate and store the lighting probe numbers with the best match in the six positive directions, as well as the sampling direction and integral angle scaling values ​​of the spherical harmonic coefficients, so that the lighting results can be queried from the lighting probes at runtime.

[0086] S22: Calculate and select the optimal lighting probe for each voxel.

[0087] For each positive light direction for each pixel of the volume texture, choose the most appropriate light probe.

[0088] As a preferred implementation, the method for selecting the optimal lighting probe in the embodiment of the present application is: take the position of each voxel as the camera origin and render a 32*32 environment map. For each pixel position, calculate the weight parameter according to the visibility and distance of each pixel to each lighting probe, and add them up to obtain the total weight of each lighting probe, and finally take out the lighting probe with the largest total weight.

[0089] As a preferred embodiment of a variation, multiple lighting probes may be selected and weights recorded, which are then used for mixing when calculating lighting.

[0090] S23: Calculate the sampling direction of SH;

[0091] Spherical harmonic coefficients (SH) are used to describe the coefficients of spherical functions. Spherical harmonic coefficients can express spherical functions as linear combinations of a set of basis functions, thereby simplifying the calculation process.

[0092] The present application provides a preferred implementation manner, the calculation formula of the spherical harmonic sampling direction is to differentiate the following formula and solve sampleDir:

[0093]

[0094] Light probe Dir: positive lighting direction of 6 faces;

[0095] vi: the unit direction from each discrete point in the spherical space to the pixel position;

[0096] sampleDir: the SH sampling direction required;

[0097] di: The unit direction from each discrete point in spherical space to the light probe.

[0098] According to this formula, we can derive the xyz components of sampleDir and solve the equations.

[0099] S24: Calculate the optimal integral angle scaling.

[0100] Integration Angle Scaling is used to correct the hemispherical integration done when a voxel samples the lighting result from the spherical harmonics of the Light Probe, because the angle of the voxel's hemispherical space will no longer be equal to 180 degrees after being projected to the Light Probe position, so it needs to be corrected.

[0101] The present application embodiment provides a preferred implementation method, and the formula for calculating the optimal integral angle scaling is to derive the following formula and solve dot0:

[0102]

[0103] di: The dot product of the positive direction of the 6-face lighting and the discrete direction of the spherical space.

[0104] dci: The dot product of the SH sampling direction and the direction from the discrete point in spherical space to the light probe position.

[0105] dot0: The goal of the solution is "cosine value of 0". In SH's cosine convolution, when the actual cosine reaches this value, the cosine used for lighting calculation is transitioned to 0.

[0106] Since step S24 has only one dimension, its computational complexity is much smaller than that of S25.

[0107] S25: Store the baking result.

[0108] After completing the above 4 steps, the illumination probe id, sampling direction, angle scaling and weight information in the 6 positive directions of all pixels are compressed and stored in the Structured Buffer for storage.

[0109] As a specific implementation method, the specific compression method is:

[0110] struct GITexel

[0111] {

[0112] uint m_lightprobe[6]; / / 8id 8weight 8scale 8dirZ

[0113] uint m_Dirs[3]; / / 8dirX[0]8dirY[0]8dirX[1]8dirY[1]

[0114] };

[0115] In this embodiment, all light probe ids, weights, angle scaling values ​​and directions are represented with 8-bit precision and encapsulated into 9 unsigned integers (uint).

[0116] Step S3: updating the illumination information of the illumination probe, and updating and storing the irradiance information of each voxel according to the illumination information of the illumination probe for rendering the image. As a preferred implementation, the specific steps include:

[0117] S31: According to the light source whose properties have changed, the irradiator that needs to be updated is found, and the light probes in the irradiator are pushed into the update queue.

[0118] S32: Take a lighting probe from the queue for each frame, and perform lighting updates based on the previously stored surrounding scene information. When calculating the lighting at each sampling point, the indirect lighting result of the previous frame is superimposed to achieve multiple lighting bounces. The lighting results of the lighting probe are saved in the form of spherical harmonic coefficients.

[0119] S33: Mix and transition the lighting probe update result of the current frame with the past result to avoid local lighting mutation caused by updating only one lighting probe per frame.

[0120] S34: According to the illumination probe ID and sampling direction stored in the irradiation volume, the angle information is integrated so that each voxel in the volume obtains a new illumination result from the illumination probe.

[0121] The method of sampling lighting from the lighting probe is: based on the ordinary spherical harmonic sampling, the dot product integral part is changed from the previously pre-calculated 180-degree integral zonal harmonic coefficient (ZH) to a real-time generation based on the integral angle scaling value. The specific implementation method is to take several discrete scaling values ​​within the scaling range, calculate the ZH result through Monte Carlo integration, and then do a polynomial curve fitting based on these scaling values ​​and the ZH result to approximate the real-time calculation function of ZH.

[0122] From this, it can be seen that the present application decouples the actual lighting collection step from the density of voxels. The collection operation is performed only in units of lighting probes, and only one lighting probe is updated per frame. The subsequent lighting update of the voxels only requires a simple spherical harmonic sampling, thus achieving very fast lighting updates.

[0123] In addition, considering that the ShadowMap in real-time rendering only contains the occlusion information in front of the camera, which will cause light leakage behind the camera, this application adds an additional ShadowMap, which includes the occlusion behind the camera, and the update is only triggered when the camera moves out of a certain grid range.

[0124] Step S4: rendering, that is, calculating direct illumination and indirect illumination according to the irradiance value of each voxel, and performing synthesis processing to generate a rendered image.

[0125] In the rendering stage, you only need to draw the Irradiance Volume as a light source onto a diffuse buffer, specifically:

[0126] S41: sampling the screen depth and restoring the position information;

[0127] S42: Sample the normal information, and then sample the lighting result of the irradiance volume according to the position and normal.

[0128] Since the embodiment of the present application stores illumination information in six positive directions for each pixel, it is impossible for a normal line to belong to both the positive and negative axis regions of a certain axis at the same time. Therefore, for a specific normal line, it is only necessary to interpolate illumination in three directions. It can be seen that in step S3, the computational overhead is only three Volume Texture samples.

[0129] Based on the above method embodiment, the present application also provides a global illumination rendering system, including an illumination probe calculation unit, a space division unit, an irradiance value calculation unit, and a synthesis rendering unit, wherein:

[0130] The Light Probe Compute Unit is used to collect scene information around each Light Probe during the baking phase;

[0131] The spatial division unit is used to represent the indirect lighting within a certain area of ​​the scene using a voxel structure. During the baking stage, the lighting probe and query direction corresponding to each voxel, as well as the integral angular scaling value, are calculated and stored.

[0132] The irradiance value calculation unit is used to update the illumination information of the illumination probe, and according to the illumination information of the illumination probe, the irradiance information of each voxel is updated and stored for rendering the image;

[0133] The synthesis rendering unit is used to calculate the indirect lighting according to the irradiance value of each voxel, and synthesize it with the direct lighting to generate a rendered image.

[0134] The present application also provides a computer storage medium, which can store an executable program. When the executable program runs on a computer, the computer executes the global illumination rendering method described in any of the above embodiments.

[0135] The present application also provides an electronic device, which includes a processor and a memory, wherein the memory is used to store an executable program, and the processor is used to execute the executable program to implement the above-mentioned global illumination rendering method.

[0136] It should be noted that, a person skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the storage medium can include but is not limited to: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0137] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A global illumination rendering method, characterized in that: The steps include: S1: Use light probes to collect scene information around each light probe during the baking stage; S2: The indirect lighting within a certain area of ​​the scene is represented by a voxel structure. During the baking stage, the lighting probe and sampling direction corresponding to each voxel, as well as the integral angle scaling value, are calculated and stored. Specifically: S21: Represent the indirect lighting within a certain area of ​​the scene in the form of voxels; S22: Calculate and select the optimal lighting probe for each voxel; S23: Calculate the sampling direction of SH; S24: Calculate the optimal integral angle scaling; S25: storing the baking result; S3: Update the lighting information of the lighting probe. According to the lighting information of the lighting probe, update the irradiance information of each voxel and store it for rendering the image. Specifically: S31: according to the light source whose properties have changed, the irradiator that needs to be updated is obtained, and the light probes in the irradiator are pushed into the update queue; S32: Take out a lighting probe from the queue for each frame, and perform lighting update according to the previously stored surrounding scene information. When calculating the lighting at each sampling point, the indirect lighting result of the previous frame is superimposed to achieve multiple lighting bounces, and the lighting probe update result of the current frame is obtained and saved in the form of spherical harmonic coefficients. S33: Mix and transition the lighting probe update result of the current frame with the previous result; S34: according to the illumination probe ID, sampling direction, and integration angle information stored in the irradiator, new illumination information is obtained from the illumination probe, and the irradiance information of each voxel is updated and stored; S4: Calculate indirect lighting based on the irradiance value of each voxel and synthesize it with the direct lighting to generate a rendered image, including: S41: sampling the screen depth and restoring the position information; S42: Sample the normal information, and then sample the illumination result of the irradiated body according to the position and the normal.

2. The method according to claim 1, characterized in that The S1 step includes: S11: Each light probe renders an N*N environment map in the baking stage to store information about surrounding objects; S12: compress the information of surrounding objects and save it in the form of StructuredBuffer; S13: Generate a Visibility Buffer according to mapping the visible pixel position to the corresponding voxel, so as to determine the visibility of the voxel in the space corresponding to the light probe.

3. The method according to claim 1, characterized in that Step S2 includes: Divide a 3D cuboid space into a certain number of voxels evenly according to the specified granularity; Each voxel is stored as an environment cube, that is, the light intensity in the 6 positive directions of space; Calculate and store the lighting probe numbers with the best match in the 6 positive directions, as well as the sampling direction and integration angle scaling values ​​of the spherical harmonic coefficients.

4. The method according to claim 1, characterized in that Step S22: The method of selecting the optimal illumination probe includes: Render a 32*32 environment map for each voxel position, saving the pixel positions around the voxel; The weight parameters are calculated based on the visibility and distance of each pixel to each light probe, and then accumulated to obtain the total weight of each pixel; The light probe with the largest total pixel weight is selected as the optimal light probe.

5. The method according to claim 1, characterized in that The method for calculating the sampling direction of SH in step S23 is to perform calculation based on the least square method, and then respectively derive the xyz components of sampleDir and solve the equation system to obtain the calculation formula: probeDir: the positive direction of illumination of the six surfaces, i is each specific discrete point sample, and n is the number of discrete point samples; vi: the unit direction from each discrete point in the spherical space to the voxel position; sampleDir: the SH sampling direction required; di: Also known as dir, it refers to the unit direction from each discrete point in spherical space to the light probe.

6. The method according to claim 1, characterized in that S24: The method for calculating the optimal integral angle scaling is based on the least square method, and then the dot0 is derived, wherein the calculation formula is: di: is direction dot, which is the dot product of the positive direction of the six-sided illumination and the discrete direction of the spherical space; dci: dot product of the SH sampling direction and the direction from the discrete point in spherical space to the light probe position; dot0: the target to be solved; i is each specific discrete point sample, and n is the number of discrete point samples.

7. The method according to claim 1, characterized in that The method for obtaining new lighting information from the lighting probe in step S34 is based on spherical harmonic sampling, and the dot product integral part is changed from the previously pre-calculated 180-degree integral ZH to real-time generation according to the integral angle scaling value, where ZH is Zonal Harmonics.

Citation Information

Patent Citations

  • Illumination rendering method and device, electronic equipment and storage medium

    CN115984449A

  • Global illumination rendering method and device, storage medium and electronic equipment

    CN116758208A