Diffuse reflection global illumination method and system based on sparse distance field and voxelization
Through the method based on sparse distance field and voxelization, the lack of dynamic diffuse reflection global lighting method in the prior art in complex lighting scene processing and multi-light source adaptability is solved, and efficient lighting on non-reliance to specific hardware platforms is achieved Effects and platform compatibility improve lighting quality.
Patent Information
- Application Number
- CN202411166780.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The existing dynamic diffuse global lighting method is difficult to meet the needs of real-time interaction and dynamic changes when dealing with complex lighting scenarios, and requires specific hardware acceleration support, which cannot be implemented on all platforms, and cannot effectively consider occlusion visibility and adapt to multi-light scenes. .
Using diffuse global illumination method based on sparse distance field and voxelization, the scene is voxelized by constructing a sparse global distance field, and the light probe update is optimized using cascaded light probes and state machines to realize distance field ray tracing. Reduce invalid updates and obtain better lighting effects through trilinear interpolation calculations.
It realizes efficient dynamic diffuse global lighting without relying on specific hardware platforms, improves lighting quality and platform compatibility, reduces computing overhead, adapts to complex lighting scenarios, and improves multi-light source processing capabilities.
Smart Images

Figure CN119091028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of global illumination, and in particular to a diffuse reflection global illumination method and system based on sparse distance field and voxelization. Background Art
[0002] In recent years, the research on dynamic diffuse global illumination stems from the continuous pursuit of realistic rendering in the field of computer graphics. With the improvement of computing power and the diversification of graphics processing requirements, the application scenarios of real-time rendering technology have become more and more extensive, including but not limited to video games, virtual reality, film production and architectural visualization. In these applications, the realism of lighting effects is a key factor affecting user experience and visual effects. Traditional static lighting models are often unable to cope with complex lighting scenes and are difficult to meet the needs of real-time interaction and dynamic changes. In recent years, dynamic diffuse global illumination methods have their own limitations, including: no consideration of occlusion visibility issues in approximating lighting effects, and the need for specific hardware acceleration support, which makes it impossible to be available on all platforms. In order to solve the above problems, a set of dynamic diffuse global illumination solutions that are independent of specific hardware platforms, physically accurate, and have controllable performance overhead are proposed.
[0003] Global illumination has always been a hot research topic in the field of graphics. Over the years, many different schools of thought have emerged. The earliest methods are ray tracing and path tracing. Ray tracing is a method of calculating lighting and shadows by simulating light rays starting from the camera and tracing their propagation paths in the scene. Path tracing is an extension of ray tracing, which uses random sampling to track the multiple reflection paths of light rays in the scene and gradually accumulates lighting information. Both of them essentially simulate the propagation of light paths, so they require a lot of computing power. Although there are many hardware acceleration structures today, ray tracing has entered the real-time field, but ray tracing functions are still not enabled for most consumer-grade hardware.
[0004] Reflective Shadow Map (RSM) method, this type of method borrows the technology of shadow. Reflective Shadow Map is based on the concept of traditional Shadow Map, but expands on the information stored. Traditional Shadow Map only stores depth information, while RSM not only stores depth, but also records the color and direction information of reflected light. This additional information is used to calculate indirect lighting, making the rendering effect more realistic. By obtaining the depth map from the camera's perspective and the depth map from the light's perspective, the information of whether each pixel is illuminated by the light source from the camera's perspective is obtained. RSM records the direction and intensity information of the light projected into the scene by the light source, thereby realizing the effective calculation of indirect lighting. During the rendering process, the reflected light information recorded in RSM is used to calculate the indirect lighting received by each pixel. By traversing the light source pixels in RSM and projecting their reflected light to other pixels in the scene, the contribution of indirect lighting is calculated. This method was used in early video games, but it has several disadvantages. First, visibility cannot be considered, because each pixel in the RSM method is a light source, and the cost of using Shadow Map is too high. In addition, the RSM method is not suitable for global illumination of multiple light sources.
[0005] Light Propagation Volumes (LPV), LPV generates realistic lighting effects by propagating lighting information in a volume grid, simulating multiple reflections and scattering of light in the scene. This method voxelizes the scene, uses the idea of RSM to inject direct lighting into the surface of the object, and then propagates it based on the voxelized information of the scene, and iterates continuously. When rendering, the shading point is rendered using the radiance in the grid volume. Because LPV uses a voxelization method, it solves the visibility problem to a certain extent, but light leakage still occurs in the same grid volume. When the grid volume granularity is reduced, the light leakage will be reduced, but the complexity and storage of the propagation become unsolvable problems. Summary of the invention
[0006] In view of the deficiencies in the prior art, an object of the present invention is to provide a diffuse global illumination method and system based on sparse distance field and voxelization.
[0007] The object of the present invention is achieved through the following technical solution: a diffuse global illumination method based on sparse distance field and voxelization, comprising the following steps:
[0008] S1. Construct a sparse global distance field;
[0009] S2, voxelizing a scene that needs global illumination, voxelizing the scene through a rasterization process, and recording an albedo map, self-luminous information, and direct illumination information of the scene;
[0010] S3, injecting the direct illumination information obtained in step S2 into the direct illumination voxelized 3D texture;
[0011] S4. In the scene, light probes are placed around the camera center in a cascaded light probe placement manner to generate four light probe spaces with different probe spacings.
[0012] S5. offset the origin of the light probe space according to the current viewing direction to obtain more light information;
[0013] S6, constructing a state machine for the light probe, eliminating unnecessary updates of the light probe through the state machine, repositioning the light probe, performing distance field ray tracing on the light probe that needs to be updated to obtain information of the voxel surface and update the radiance texture; mixing the radiance texture to obtain irradiance information;
[0014] S7. Color the scene according to the irradiance information obtained in step S6, search for light probes around the shading point in the light probe space, and perform trilinear interpolation calculation to obtain the color of the shading point.
[0015] Furthermore, the step S1 is specifically as follows: first, pre-generate a high-precision mesh distance field for each mesh under offline conditions, and then, synthesize the mesh distance fields in the scene into a low-precision global distance field in real time; in subsequent distance field ray tracing, after the low-precision global distance field is quickly traced around the mesh, it is converted to the high-precision mesh distance field for tracing.
[0016] Furthermore, in step S2, voxelizing the scene requiring global illumination comprises the following steps:
[0017] Creating a three-dimensional texture storing voxel information, wherein the three-dimensional texture includes a diffuse reflection voxel texture, a luminous voxel texture, and an illuminated voxel texture; wherein the voxel resolution is set to 128×128×128, and four three-dimensional textures are created when creating the voxel three-dimensional texture, and the four three-dimensional textures together constitute a four-level cascade texture;
[0018] Execute the geometry shader of mesh voxelization, calculate the normal of each triangle face, select the normal with the largest component as the principal axis as the projection direction; when performing conservative rasterization later, expand the three sides of the triangle face;
[0019] A voxelized pixel shader is executed to calculate the coordinates in the voxel texture of each face and update the texture's information, including the albedo map, self-illumination information, and direct lighting information.
[0020] Furthermore, the arrangement of the illumination probes in step S4 is specifically as follows: a 4-cascade illumination probe space is used, the number of probes inside the probe space is the same, and the probe spacings in probe spaces of different levels are different to ensure the global illumination quality near the observation point. The closer the illumination probe space is to the observation point, the smaller the distance between the probes; as the level of the illumination probe space increases, the spacing between the probes increases.
[0021] Furthermore, the step S5 is specifically as follows:
[0022] Calculate the intersection point of the observation direction vector and the light probe space, calculate the distance from the observation point to the intersection point based on the intersection point, and take 0.3 times the distance from the observation point to the intersection point as the adjustment distance;
[0023] Move the origin of the Light Probe Space in the viewing direction by a distance equal to 0.15 times the longest dimension of the three dimensions of the Probe Space.
[0024] Furthermore, in step S6, constructing a state machine for the illumination probe includes:
[0025] Probe inactive state: indicates that the probe is a valid probe that needs to be sampled, but the probe is not updated; the probe marked in this state is farther away from the geometry than the distance between probes, or the probe is inside the geometry;
[0026] Probe Activated Status: When this probe is updated, it is marked as activated;
[0027] Probe active state: In this state, the probe budget is set in a frame to evenly distribute the overhead; a portion of the probes are updated in each frame using round-robin requests, marking the requested portion of probes as active;
[0028] Probe dormant state: no ray tracing updates are done on this probe, but it is sampled; probes behind the camera are marked in this state; the probe budget is set in one frame so that the overhead is evenly distributed; round robin requests are used to update a portion of probes each frame, and probes that are not in the requested portion are marked in this state.
[0029] Furthermore, in step S6, repositioning the illumination probe is specifically performed as follows:
[0030] For a probe located inside a wall, the probe is determined by the probe state machine to be not sampled during shading, resulting in a reduction in the amount of information available for the shading point, and the probe is moved outside the wall;
[0031] When the probe is located near the surface of the wall, the distance field detection is performed on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the surface of the nearest object. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the wall surface.
[0032] Furthermore, in step S6, performing distance field ray tracing on the probe is specifically as follows:
[0033] Select the number of rays to be traced by each probe, and divide the number of rays to be traced by each probe into four levels, which are 96, 128, 192, and 256 rays respectively;
[0034] Perform distance field ray tracing to obtain information about the hit point; sample the hit point information in the voxelized 3D texture, and finally record the information in the lighting probe, wherein the information includes the radiance and distance information of the point.
[0035] Furthermore, in step S6, mixing the radiance texture is specifically performed as follows:
[0036] Determine the state of the light probe. If the probe is inactive or dormant, skip the mixing phase. If it is in other states, enter the irradiance update process.
[0037] The specific process of updating irradiance is as follows: when mixing in a certain sampling direction of the probe, the radiance information of each direction collected in the probe is merged, and at the same time, the normal unit vector n and the sampling direction w are combined according to the Lambert cosine theorem. j Perform dot multiplication to calculate the weight value dot(n,ω j ), will be from position p, direction w j The radiance L(p,ω j ) and weight value dot(n,ω j ) to get the contribution value in that direction, and finally calculate the irradiance Texel(n) at that location:
[0038]
[0039] Where N represents the number of sampling times.
[0040] A diffuse global illumination system based on sparse distance fields and voxelization, including the following modules:
[0041] Distance field construction module: The distance field system is constructed based on the pre-processed mesh high-precision distance field and the sparse low-precision global distance field, which is used to calculate the distance from a point to the nearest surface during distance field ray tracing;
[0042] Voxelization building block: implements a voxelization system based on the rasterization process and triangle expansion process, which is used to query scene lighting information at the hit point of distance field ray tracing;
[0043] Probe state machine module: Build a state machine and set the probe state based on the location of the probe and whether it has been activated recently, to determine whether the probe is updated and sampled, thus reducing time overhead;
[0044] Distance Field Ray Tracing Module: Performs ray tracing based on distance fields, which is used to replace dedicated hardware ray tracing and realizes ray tracing capabilities without dedicated ray tracing hardware platforms;
[0045] Probe relocation module: Adjust according to the position of the probe. For probes located near the wall surface, perform distance field detection on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the nearest object surface. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the surface. For probes located inside the wall, they will be determined as not being sampled by the probe state machine during shading, resulting in a reduction in the amount of information available for the shading point. For such probes, the probes are moved outside the wall to obtain better lighting effects during shading.
[0046] Probe radiance mixing module: Mixing is performed according to a certain sampling direction of the probe, that is, the radiance information collected in the probe in various directions needs to be merged to calculate the irradiance of the probe in various directions;
[0047] Shading module: The sampling space of the shading point is composed of the 8 nearest probes, and the irradiance at the shading point is calculated by trilinear interpolation. Finally, the color is calculated by a physically based shading model.
[0048] The beneficial effects of the present invention are:
[0049] The present invention introduces a sparse global distance field to implement distance field ray tracing on a platform that does not support dedicated ray tracing hardware, and has high platform compatibility.
[0050] The present invention expresses the scene through voxels, so that the lighting information of the scene objects can be quickly queried.
[0051] The present invention achieves better lighting effect and coverage size for the space within the observation field of view by slightly displacing the probe space according to the observation direction, thereby improving the lighting quality.
[0052] The present invention adopts a multi-level cascade probe placement method to achieve a larger global illumination coverage area without sacrificing the global illumination quality at near observation points, and at the same time has different update rates for illumination probe spaces of different levels of probes to obtain better performance.
[0053] The present invention constructs a state machine for the illumination probe, combines multiple methods to reduce the update of invalid probes, and enables the probe update, that is, the subsequent process to obtain better performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a flow chart of the method of the present invention;
[0055] Figure 2 Constructing a sparse global distance field schematic diagram for the scenario of the present invention;
[0056] Figure 3 Constructing a voxelized representation schematic diagram for the scene of the present invention;
[0057] Figure 4 This is a schematic diagram of the arrangement of the cascade illumination probes of the present invention;
[0058] Figure 5 This is a schematic diagram of the present invention for shifting the probe space according to the observation direction;
[0059] Figure 6 This is a schematic diagram of the repositioning of the illumination probe of the present invention;
[0060] Figure 7 It is a system flow chart of the present invention. DETAILED DESCRIPTION
[0061] The present invention will be described in detail below according to the accompanying drawings and preferred embodiments, and the purpose and effect of the present invention will become more clear. The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0062] The present invention provides a feasible solution for the diffuse global illumination system based on multiple optimization methods such as sparse distance field and voxelization.
[0063] like Figure 1 As shown, an embodiment of the present invention provides a diffuse global illumination method based on sparse distance field and voxelization, comprising the following steps:
[0064] 1. Construct a sparse global distance field.
[0065] like Figure 2As shown in the figure, a high-precision mesh distance field is first pre-generated for each mesh offline, and then a low-precision global distance field is synthesized in real time from the mesh distance fields in the scene. In the subsequent distance field ray tracing, the mesh can be quickly traced around the mesh using the low-precision global distance field, and then the ray tracing is switched to the high-precision mesh distance field for tracing when the ray tracing is continued around the mesh. This hybrid method can take into account both the storage overhead and the accuracy of the ray tracing results.
[0066] 2. Voxelize the scene that needs global illumination, voxelize the scene through a rasterization process, and record the albedo map, self-luminous information, and direct illumination information of the scene.
[0067] like Figure 3 As shown, the following process is used to voxelize the scene:
[0068] 2.1. Create a 3D texture to store voxel information during initialization, including diffuse voxel texture, luminous voxel texture and illumination voxel texture. The voxel resolution is set to 128×128×128, and the cascade texture technology is used. Therefore, it is necessary to create 3 additional 3D textures to form a 4-level hierarchical texture when creating the voxel 3D texture.
[0069] 2.2. Execute the geometry shader of mesh voxelization, calculate the normal for each triangle face, and select the main axis as the projection direction according to the maximum component of the normal. In addition, the three sides of the triangle face need to be expanded for subsequent conservative rasterization. The significance of conservative rasterization is to prevent dangerous holes when voxelizing the surface.
[0070] 2.3. Execute the voxelized pixel shader, calculate the coordinates in the voxel texture for each face element, and update the texture information. The updated information includes the albedo map, self-luminous information, and direct lighting information of the scene.
[0071] 3. Inject direct lighting information into the direct lighting voxelized 3D texture.
[0072] 4. In the scene, light probes are placed in a cascaded manner around the observation center to generate four light probe spaces with different probe spacings.
[0073] like Figure 4 As shown in the figure, when placing the light probes, a 4-cascade light probe space is implemented. The number of probes in the space is the same, but the distance between probes in different levels of probe space is different. In order to ensure the global illumination quality near the observation point, the distance between probes in the light probe space closer to the observation point will be smaller. Conversely, as the level of the light probe space increases, the distance between probes increases.
[0074] 5. Offset the origin of the light probe space according to the current viewing direction to obtain more lighting information.
[0075] 6. Construct a state machine for the light probe, and use the state machine to eliminate unnecessary updates of the light probe, such as the absence of colored objects near the probe; after repositioning the light probe, perform distance field ray tracing on the light probe that needs to be updated to obtain voxel surface information and update the radiance texture; and mix the radiance texture to obtain irradiance information.
[0076] like Figure 5 As shown, the origin of the light probe space is offset according to the current viewing direction to obtain more lighting information, as follows:
[0077] First, calculate the intersection point of the viewing direction vector and the light probe space, calculate the distance ViewOriginToHitPoint from the viewing point to the intersection point based on the intersection point with the light probe space, and take 0.3 times of this distance as the adjustment distance.
[0078] Adds the distance from the origin of the Light Probe space towards the viewing direction.
[0079] The state machine of the probe is constructed as follows:
[0080] DDGI_PROBE_STATE_INACTIVE state: This means that it is not a valid probe to sample and it is not being updated. Probes that are marked in this state are usually because the probe is too far away from the geometry, or the probe is stuck inside the geometry (even after repositioning attempts to move them).
[0081] DDGI_PROBE_STATE_ACTIVATED state: When this probe is updated, it is marked as activated. This means that it was recently activated and its information is temporally relevant, so an attempt is made to update the probe (even if the probe is on the back of the camera).
[0082] DDGI_PROBE_STATE_ACTIVE state: In this state, the probe budget is set in a frame to evenly distribute the overhead. A portion of the probes are updated in each frame using round-robin requests. Therefore, those probes in the request portion will be marked as active.
[0083] DDGI_PROBE_STATE_SLEEP state: No ray tracing updates are done for this probe, but it is sampled. Probes behind the camera are marked in this state. To evenly distribute the cost, the probe budget is set in one frame. Use round-robin requests to update a subset of probes each frame, and those probes that are not part of the request will be marked in this state.
[0084] like Figure 6 As shown, the probe relocation operation is as follows:
[0085] For probes located inside the wall, they will be determined by the probe state machine as not being sampled during shading, resulting in a reduction in the amount of information available for the shading point. For such probes, the probes are moved outside the wall.
[0086] For the probe located near the surface of the wall, the distance field detection is performed on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the surface of the nearest object. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the surface.
[0087] Distance field ray tracing for a probe is done as follows:
[0088] Select the number of rays to be traced by each probe. This can be selected as needed on platforms with different configurations. There are four levels: 96, 128, 192, and 256 rays.
[0089] Perform distance field ray tracing to obtain the information of the hit point. The information of the hit point is sampled in the voxelized 3D texture, which contains information such as the radiance and distance of the point, and is finally recorded in the light probe.
[0090] The probe collection data is mixed as follows:
[0091] Determine the state of the light probe. If it is DDGI_PROBE_STATE_INACTIVE or DDGI_PROBE_STATE_SLEEP, skip the mixing stage. Other states can enter the update irradiance.
[0092] The specific process of updating irradiance is as follows: when mixing in a certain sampling direction of the probe, the radiance information of each direction collected in the probe is merged, and at the same time, the normal unit vector n and the sampling direction w are combined according to the Lambert cosine theorem. j Perform dot multiplication to calculate the weight value dot(n,ω j ), will be from position p, direction w j The radiance L(p,ω j ) and weight value dot(n,ω j) to get the contribution value in that direction, and finally calculate the irradiance Texel(n) at that location:
[0093]
[0094] Where N represents the number of sampling times.
[0095] 7. Shade the scene, search for 8 lighting probes around the shading point in the lighting probe space, and perform trilinear interpolation calculation to obtain the color of the shading point.
[0096] like Figure 7 As shown, an embodiment of the present invention further provides a diffuse global illumination system based on sparse distance field and voxelization, the system comprising the following modules:
[0097] Distance field construction module: The distance field system is constructed based on the pre-processed mesh high-precision distance field and the sparse low-precision global distance field, which is used to calculate the distance from a point to the nearest surface during distance field ray tracing.
[0098] Voxelization building block: A voxelization system is implemented based on the rasterization process and the triangle expansion process, which is used to query the scene lighting information at the hit point of distance field ray tracing.
[0099] Probe state machine module: Build a state machine based on the location of the probe, whether it has been activated recently, and other information, set the probe state, and use it to determine whether the probe is updated and sampled, thereby reducing time overhead.
[0100] Distance Field Ray Tracing Module: Performs ray tracing based on distance fields, which is used to replace dedicated hardware ray tracing and realize ray tracing capabilities without dedicated ray tracing hardware platforms.
[0101] Probe relocation module: Adjust according to the position of the probe. For probes located near the surface of the wall, perform distance field detection on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the nearest object surface. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the surface. For probes located inside the wall, they will be determined as not being sampled by the probe state machine during shading, resulting in a reduction in the amount of information available for the shading point. For such probes, choose to move the probe outside the wall to obtain better lighting effects during shading.
[0102] Probe radiance mixing module: Mixing is performed according to a certain sampling direction of the probe, that is, the radiance information collected in the probe in each direction needs to be merged to calculate the irradiance of the probe in each direction
[0103] Shading module: The sampling space of the shading point is composed of the 8 nearest probes, and the irradiance at the shading point is calculated by trilinear interpolation. Finally, the color is calculated by a physically based shading model.
[0104] Those skilled in the art can understand that the above are only preferred examples of the invention and are not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention shall be included in the protection scope of the invention.
Claims
1. A diffuse global illumination method based on sparse distance fields and voxelization, It is characterized in that The following steps are involved: (S1) constructing a sparse global distance field; (S2) voxelizing a scene that needs global illumination, voxelizing the scene through a rasterization process, and recording an albedo map, self-luminous information, and direct illumination information of the scene; (S3) injecting the direct lighting information obtained in step (S2) into the direct lighting voxelized three-dimensional texture; (S4) in the scene, placing light probes around the camera center in a cascaded light probe placement manner to generate four light probe spaces with different probe spacings; (S5) offsetting the origin of the illumination probe space according to the current observation direction to obtain more illumination information; (S6) constructing a state machine for the light probe, eliminating unnecessary updates of the light probe through the state machine, repositioning the light probe, performing distance field ray tracing on the light probe that needs to be updated to obtain information of the voxel surface and update the radiance texture; Mixing the radiance texture to obtain irradiance information; (S7) Shading the scene according to the irradiance information obtained in step (S6), searching for light probes around the shading point in the light probe space, and performing trilinear interpolation calculations to obtain the color of the shading point.
2. A diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that The step (S1) is specifically as follows: first, pre-generate a high-precision mesh distance field for each mesh under offline conditions, then, synthesize the mesh distance fields in the scene into a low-precision global distance field in real time; in subsequent distance field ray tracing, after the low-precision global distance field is quickly traced around the mesh, it is converted to the high-precision mesh distance field for tracing.
3. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that In the step (S2), voxelizing the scene that needs global illumination includes the following steps: Creating a three-dimensional texture storing voxel information, wherein the three-dimensional texture includes a diffuse reflection voxel texture, a luminous voxel texture, and an illuminated voxel texture; wherein the voxel resolution is set to 128×128×128, and four three-dimensional textures are created when creating the voxel three-dimensional texture, and the four three-dimensional textures together constitute a four-level cascade texture; Execute the geometry shader of mesh voxelization, calculate the normal of each triangle face, select the normal with the largest component as the principal axis as the projection direction; when performing conservative rasterization later, expand the three sides of the triangle face; A voxelized pixel shader is executed to calculate the coordinates in the voxel texture of each face and update the texture's information, including the albedo map, self-illumination information, and direct lighting information.
4. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that The lighting probes in step (S4) are specifically placed in the following manner: a 4-cascade lighting probe space is used, the number of probes in the probe space is the same, and the probe spacings in probe spaces of different levels are different, so as to ensure the global lighting quality near the observation point, and the distance between the probes in the lighting probe space closer to the observation point is smaller; As the number of levels in the Light Probe Space increases, the spacing between probes increases.
5. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that The step (S5) is specifically: Calculate the intersection point of the observation direction vector and the light probe space, calculate the distance from the observation point to the intersection point based on the intersection point, and take 0.3 times the distance from the observation point to the intersection point as the adjustment distance; Move the origin of the light probe space in the viewing direction by an amount equal to 0.15 times the longest dimension of the three dimensions of the probe space.
6. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that In the step (S6), constructing a state machine for the illumination probe includes: Probe inactive state: indicates that the probe is a valid probe that needs to be sampled, but the probe is not updated; the probe marked in this state is farther away from the geometry than the distance between probes, or the probe is inside the geometry; Probe Activated Status: When this probe is updated, it is marked as activated; Probe active state: In this state, the probe budget is set in a frame to evenly distribute the overhead; a portion of the probes are updated in each frame using round-robin requests, marking the requested portion of probes as active; Probe dormant state: no ray tracing updates are done on this probe, but it is sampled; probes behind the camera are marked in this state; the probe budget is set in one frame so that the overhead is evenly distributed; round robin requests are used to update a portion of the probes each frame, and probes that are not in the requested portion are marked in this state.
7. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that In the step (S6), repositioning the illumination probe is specifically performed as follows: For a probe located inside a wall, the probe is determined by the probe state machine to be not sampled during shading, resulting in a reduction in the amount of information available for the shading point, and the probe is moved outside the wall; When the probe is located near the surface of the wall, the distance field detection is performed on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the surface of the nearest object. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the wall surface.
8. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that In the step (S6), the distance field ray tracing of the probe is specifically performed as follows: Select the number of rays to be traced by each probe, and divide the number of rays to be traced by each probe into four levels, which are 96, 128, 192, and 256 rays respectively; Perform distance field ray tracing to obtain information about the hit point; sample the hit point information in the voxelized 3D texture, and finally record the information in the lighting probe, wherein the information includes the radiance and distance information of the point.
9. The diffuse global illumination method based on sparse distance field and voxelization according to claim 1, It is characterized in that In the step (S6), mixing the radiance texture is specifically performed as follows: Determine the state of the light probe. If the probe is inactive or dormant, skip the mixing phase. If it is in other states, enter the irradiance update process. The specific process of updating irradiance is as follows: when mixing in a certain sampling direction of the probe, the radiance information of each direction collected in the probe is merged, and at the same time, the normal unit vector n and the sampling direction w are combined according to the Lambert cosine theorem. j Perform dot multiplication to calculate the weight value dot(n,ω j ), will be from position p, direction w j The radiance L(p,ω j ) and weight value dot(n,ω j ) to get the contribution value in that direction, and finally calculate the irradiance Texel(n) at that location: Where N represents the number of sampling times.
10. A diffuse global illumination system based on sparse distance fields and voxelization, It is characterized in that Includes the following modules: Distance field construction module: The distance field system is constructed based on the pre-processed mesh high-precision distance field and the sparse low-precision global distance field, which is used to calculate the distance from a point to the nearest surface during distance field ray tracing; Voxelization building block: implements a voxelization system based on the rasterization process and triangle expansion process, which is used to query scene lighting information at the hit point of distance field ray tracing; Probe state machine module: Build a state machine and set the probe state based on the probe's location and whether it has been activated recently, to determine whether the probe is updated and sampled, thus reducing time overhead; Distance Field Ray Tracing Module: Performs ray tracing based on distance fields, which is used to replace dedicated hardware ray tracing and realizes ray tracing capabilities without dedicated ray tracing hardware platforms; Probe relocation module: Adjust according to the position of the probe. For probes located near the wall surface, perform distance field detection on 27 points in the surrounding 3×3×3 space. The detection content is the distance from the sampling detection point to the nearest object surface. The point with the largest distance in the distance field among the 27 points is selected as the new position of the original probe to move away from the surface. For probes located inside the wall, they will be determined as not being sampled by the probe state machine during shading, resulting in a reduction in the amount of information available for the shading point. For such probes, the probes are moved outside the wall. Probe radiance mixing module: Mixing is performed according to a certain sampling direction of the probe, that is, the radiance information collected in the probe in various directions needs to be merged to calculate the irradiance of the probe in various directions; Shading module: The sampling space of the shading point is composed of the 8 nearest probes, and the irradiance at the shading point is calculated by trilinear interpolation. Finally, the color is calculated by a physically based shading model.
Citation Information
Patent Citations
Illumination rendering method and device, equipment and storage medium
CN117876572A
Method and device for realizing real-time global illumination of mobile terminal
CN118365773A
Probe-based dynamic global illumination
US20210012562A1
Cited By
Real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration
CN120747329A
