Real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration
By using a multi-layer ray tracing and caching collaborative method, combined with software and hardware ray tracing, the problem of real-time lighting rendering in energy stations was solved, efficient and realistic dynamic lighting effects were achieved, and rendering efficiency and resource utilization were optimized.
Patent Information
- Application Number
- CN202511156629.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-19
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-08-19
AI Technical Summary
Existing technologies make it difficult to achieve real-time, high-quality lighting rendering for energy stations. Traditional global illumination methods have high computational costs, and dynamic lighting changes lead to incorrect lighting states. Existing methods cannot achieve high-quality dynamic lighting effects.
A real-time dynamic rendering method that uses multi-layer ray tracing and caching is adopted, combining software ray tracing and hardware ray tracing, processing static and dynamic objects through hybrid ray tracing mode, using global distance fields and voxelized grids to accelerate ray tracing, combining adaptive probes and importance sampling to optimize lighting calculations, using virtual paging to manage memory, and incrementally updating the cache to ensure the real-time and efficient lighting effects.
It achieves real-time, high-quality lighting rendering of energy station scenes, improves the real-time and dynamic nature of rendering, optimizes memory usage and hardware resources, and ensures the authenticity and consistency of lighting effects.
Smart Images

Figure CN120747329A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of three-dimensional rendering technology for energy stations, and in particular to a real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration. Background Art
[0002] Energy sites (such as wind farms, photovoltaic power stations, and oil drilling platforms) typically contain complex dynamic equipment and environments, requiring real-time rendering of the impact of lighting changes (such as day and night, weather changes) on the equipment. In the field of computer graphics, achieving realistic lighting effects has always been an important research goal. In the three-dimensional management and monitoring of energy sites, real-time, high-quality lighting rendering is crucial for accurately simulating and evaluating environmental lighting conditions, equipment layout, and safety monitoring.
[0003] In the existing technology, traditional global illumination methods have many limitations. In the past, global illumination in most games was mainly handled by an offline process called "lightmap baking", which has extremely high computational cost and is difficult to achieve real-time calculation. Although lightmap baking using CPU Lightmass or GPU Lightmass can provide high-quality static lighting, the build time is long, which seriously limits the dynamic nature of three-dimensional rendering. Moreover, any operation that significantly changes indirect lighting will cause errors in the lighting state. To meet the needs of dynamic scenes, some methods rely on low-quality lighting based on irradiance probes and methods that approximate global illumination effects such as ambient occlusion. However, these methods cannot achieve quality comparable to baked lighting. Therefore, a real-time dynamic rendering method based on multi-layer ray tracing and caching is proposed to solve the above-mentioned problems. Summary of the Invention
[0004] The present invention aims to provide a real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration to solve the problems raised in the above background technology.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: A real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration includes the following steps: Step 1: Convert the scene grid of the energy station into a voxel grid, generate a global distance field (SDF), and generate grid surface data at the same time; Step 2: Combine a hybrid ray tracing mode that includes software ray tracing (based on SDF) and hardware ray tracing (based on triangle geometry), processing static and dynamic objects separately, balancing calculation accuracy and performance, and performing initial lighting sampling; Step 3: Capture the scene surface material properties, store them as texture atlases, manage memory through virtual paging, reduce redundant calculations, and pre-capture static lighting information; Step 4: Deploy adaptive probes in screen space and world space to collect indirect lighting information, optimize lighting calculation efficiency through importance sampling, and optimize the distribution and noise suppression of indirect lighting; Step 5: Use an incremental update mechanism to dynamically update the surface cache and radiation cache based on a priority queue, adjust the refresh frequency according to visibility and timestamp, and give priority to refreshing high-frequency visible areas; Step 6. Select the ray tracing mode based on the hardware capabilities, fuse direct light, indirect light and cached data, and output the final rendered frame to ensure a balance between performance and image quality under different configurations.
[0006] A further improvement of the technical solution of the present invention is that: the step 1 specifically includes: Import the energy station scene mesh into the graphics engine, parse the vertex, facet, material, and texture coordinates, check the mesh unit consistency, ensure that the coordinate system matches the project requirements, and perform topology optimization and degenerate triangle filtering. For topology optimization, use MeshLab to repair non-manifold edges and isolated vertices. For degenerate triangle filtering, calculate the triangle area and remove faces with an area smaller than a preset threshold. A KD-Tree acceleration structure is used to divide the grid space and generate a voxelized grid for the energy station. The center point coordinates of each voxel unit in the voxelized grid are calculated, and the KD-Tree is used to query the nearest surface point. If the distance is less than half the length of the voxel diagonal, it is marked as an internal voxel. Each voxel unit stores spatial coordinates and geometric association information. The splitting axis is selected based on the surface area heuristic (SAH) to divide the grid space. The leaf nodes of the KD-Tree are used to store the triangle index list, and the internal nodes store the splitting plane information to accelerate the nearest surface query during subsequent voxelization. Based on the voxel center points of the voxelized grid, the distance from each point to the nearest grid surface is calculated to generate a global distance field (SDF). At the same time, a hierarchical approach is used to optimize the storage structure of the global distance field to improve query efficiency and reduce memory usage. Generate mesh surface data (Mesh Card) for each mesh, record the material properties, lighting sampling position and direction information of the mesh surface, which is used for subsequent lighting calculations and provides an accurate spatial query basis.
[0007] A further improvement of the technical solution of the present invention is that: the step 2 specifically includes: Analyze the 3D scene of the energy station, distinguish between static and dynamic objects, and assign ray tracing modes based on the characteristics of the objects: static objects use software ray tracing (based on the global distance field (SDF)), and dynamic objects use hardware ray tracing; For static objects, software ray tracing technology based on global distance fields is used for initial lighting sampling. For dynamic objects, hardware ray tracing based on triangle geometry is enabled, leveraging the hardware acceleration capabilities of RTX graphics cards for high-precision reflections and dynamic mesh rendering, ensuring realistic and efficient lighting effects for dynamic objects. Integrate the lighting data obtained by software ray tracing and hardware ray tracing. For each pixel, combine the lighting contributions from static objects (software ray tracing) and dynamic objects (hardware ray tracing) to generate a unified lighting sampling result, seamlessly fusing the lighting data of the two modes.
[0008] A further improvement of the technical solution of the present invention is that: the step 3 specifically includes: For each mesh surface in the energy station scene, its material properties are captured, including key information such as albedo, normal, and self-illumination. The scene is divided into M×M uniform units, each of which stores the material of a mesh. The material properties are then encoded into a texture atlas, which combines multiple small textures into a large texture atlas to reduce the overhead of texture switching. Each unit in the texture atlas corresponds to the material properties of a mesh surface, and the material properties are stored in the atlas through UV mapping. Using virtual paging technology, the texture atlas is divided into multiple virtual pages, each page contains part of the texture data; Using the captured material properties and texture atlas, the scene is illuminated at multiple preset viewing angles, static lighting information is pre-calculated, and the calculation results of the static lighting information are stored as a lighting cache to ensure that the pre-captured lighting information can be quickly loaded at runtime.
[0009] A further improvement of the technical solution of the present invention is that the process of dividing the texture atlas into multiple virtual pages using the virtual paging technology is as follows: Based on the merged texture atlas, UV mapping is used to assign UV coordinates to each mesh surface to ensure that its material properties can be correctly stored in the texture atlas. Virtual paging technology is used to determine the size of each virtual page based on the video memory capacity and rendering requirements. The texture atlas is then divided into multiple virtual pages, each containing part of the texture data. Pages can have overlapping areas to avoid boundary issues. Create an index for each virtual page, record its position and range in the texture atlas, and store metadata for each page, including the page's resolution, offset, and whether it has been loaded into video memory. At runtime, based on the current view and rendering requirements, detect the virtual pages that need to be loaded and load the required virtual pages from disk into video memory. When the page is no longer needed, unload it from video memory to free up video memory space. When the renderer needs to access certain texture data, it checks whether the virtual page where the texture data is located has been loaded into the video memory. If the page is not loaded, it requests to load the page and stores it in the cache. When the camera moves or the view changes, it re-detects the virtual page that needs to be loaded, loads the new page according to the new view requirements, and unloads the page that is no longer needed, ensuring that only the currently required texture data is loaded into the video memory.
[0010] A further improvement of the technical solution of the present invention is that: the step 4 specifically includes: Adaptive probes are deployed in screen space and world space, and the number and position of probes are dynamically adjusted based on scene complexity and object distribution. Screen space probes are used to capture indirect lighting effects at close range, while world space probes are used to capture global illumination information at long range. The initial probe grid for screen space is generated, and the world space probe layout is loaded to initialize the probes and set their sampling range and resolution. Importance sampling technology is used to optimize the probe's lighting collection process, and the probe is used to collect indirect lighting information from different directions, including ambient light, reflected light, and shadows, to obtain a comprehensive lighting effect. Importance sampling allocates sampling points based on the expected importance of the lighting contribution, giving priority to areas that have a greater impact on the final lighting effect. Based on the obtained comprehensive lighting effect, the indirect lighting data collected by the screen space and world space probes are fused to generate a unified lighting field. At the same time, filtering and denoising algorithms are applied to further optimize the lighting data and reduce the noise caused by insufficient sampling or sparse probe distribution.
[0011] A further improvement of the technical solution of the present invention is that the process of obtaining the comprehensive lighting effect is: Analyze the light source distribution, object material properties, and geometric structure in the energy station scene, and define the importance function by combining the light contribution factors including light intensity, directionality, and distance; Generate sampling points based on the defined importance function. The distribution of sampling points should be proportional to the value of the importance function, that is, more sampling points are generated in areas with higher importance function values. A random number generator is used to generate sampling points to avoid artifacts that may be introduced by regular sampling. Probes are then used to collect indirect lighting information from different directions, including ambient light, reflected light, and shadows. For each sampling point, the incident light intensity, bidirectional reflectance distribution function, and the angle between the direction of the sampling point and the surface normal are analyzed to calculate their contribution to the lighting. Then, the lighting contributions of all sampling points are integrated to obtain the comprehensive lighting effect.
[0012] A further improvement of the technical solution of the present invention is that the expression of the importance function is as follows: ; Where, is the value of the importance function, indicating the direction The importance of the light contribution, is the incident light intensity, indicating the direction The intensity of light reaching the surface, is the cosine of the incident angle, indicating the incident direction Angle with the surface normal The cosine value of is the distance between the light source and the surface; The expression for the contribution to illumination is as follows: ; ; Where, For the The lighting contribution of each sampling point is For the The incident light intensity at each sampling point is is the bidirectional reflectance distribution function, For the The cosine of the incident angle at each sampling point, is the incident direction, is the emission direction (observation direction), is the differential reflected light intensity, indicating the direction The observed reflected light intensity, is the differential incident light intensity, indicating the direction The intensity of light reaching the surface, is the angle of incidence, indicating the direction of incidence Angle with the surface normal; The expression of the comprehensive lighting effect is as follows: ; Where, For comprehensive lighting effects, For the The lighting contribution of each sampling point is For the The importance function value of the sampling point, is the total number of sampling points, is the index of the sampling point, For the The importance function value of each sampling point.
[0013] A further improvement of the technical solution of the present invention is that: the step 5 specifically includes: In the energy station scenario, a priority queue is created based on regional visibility and the frequency of lighting changes to manage updates to the surface cache and radiation cache. Priority is assigned to each cache unit based on visibility and timestamp. The surface cache uses a pre-capture mechanism to capture mesh material properties (albedo, normal, self-illumination, etc.) from multiple angles, store them as texture atlases, and dynamically manage memory through virtual paging. The radiation cache includes a screen-space radiance cache and a spatial radiance cache. The screen-space radiance cache is used to downsample indirect lighting and, combined with full-resolution material data, reduce noise and improve performance. The world-space radiance cache is used to distinguish between near-field and far-field lighting, tracing more samples for distant rays and optimizing indoor scenes (such as skylight coming in through small windows). When rendering each frame, the cache unit with the highest priority is selected from the priority queue for update, and the surface cache and radiation cache are gradually updated according to the priority order in the queue, with high-frequency visible areas being refreshed first to ensure that the lighting data in high-frequency visible areas is the latest; Based on the current view and rendering requirements, the priority of cache units in the priority queue is dynamically adjusted, the visibility and timestamp of each cache unit are re-evaluated, and its position in the queue is adjusted. For areas that newly enter the field of view, the visibility changes from 0 to 1, increasing its priority, so that cache updates are always consistent with the current view requirements, balancing performance and data accuracy.
[0014] A further improvement of the technical solution of the present invention is that: the step 6 specifically includes: Detect the ray tracing capabilities of the current hardware and select an appropriate ray tracing mode. If the hardware supports RTX acceleration, hardware ray tracing is enabled to process high-precision reflections and shadows of dynamic objects. If not, software ray tracing based on the global distance field (SDF) is fully relied upon. At the same time, software ray tracing is always used for static objects to balance performance and image quality. According to the ray tracing mode, it dynamically mixes lighting data from different sources, fuses direct light, indirect light and cached data, and for each pixel, fuses the lighting contributions from static objects (software ray tracing) and dynamic objects (hardware ray tracing). It also uses the global distance field of the voxelized grid to accelerate ray tracing, and uses the material properties and lighting sampling positions recorded by the mesh surface data (Mesh Card); The fused lighting data is applied to each pixel of the scene. According to the material properties and lighting model, the final color value of each pixel is analyzed, and the fused lighting data is anti-aliased and filtered. The rendering results are color corrected and adjusted. According to the lighting conditions and material characteristics of the scene, the brightness, contrast and saturation of the color are adjusted to ensure that the color of the final image is accurate and meets the expected effect. Then, based on the processed lighting data, the final rendering frame is generated, and the rendering result is output to the screen. At the same time, it is saved as an image file to complete the entire rendering process and ensure that the rendering effect meets the actual needs of the energy station scene.
[0015] Due to the adoption of the above technical solution, the present invention has the following technical advancements compared to the prior art: 1. The present invention provides a real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration. Through a hybrid ray tracing mode, combined with the advantages of software ray tracing and hardware ray tracing, it can process lighting changes in dynamic scenes in real time. Software ray tracing uses the global distance field to quickly respond to intersection queries between light and scenes, which is suitable for complex static scenes. Hardware ray tracing uses the hardware acceleration capabilities of RTX graphics cards to process high-precision reflections and shadows of dynamic objects, ensuring that lighting effects can be updated in real time in dynamic scenes, improving the real-time and dynamic nature of rendering, and meeting the needs of energy station scenarios for real-time dynamic rendering.
[0016] 2. The present invention provides a real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration. By adopting virtual paging technology, it can effectively manage memory resources and reduce redundant calculations. The texture atlas is divided into multiple virtual pages using virtual paging technology, and the required pages are dynamically loaded and unloaded according to the current view and rendering requirements, avoiding loading the entire texture atlas, thereby optimizing memory usage, not only improving rendering efficiency, but also reducing the demand for hardware resources, so that the method can run efficiently in a resource-constrained environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It is a schematic diagram of the workflow of the present invention; Figure 2 Schematic diagram of the method of the present invention. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0020] Example 1, as Figure 1 、 Figure 2 As shown, the present invention provides a real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration, comprising the following steps: Step 1. Convert the scene mesh of the energy station into a voxel mesh and generate a global distance field (SDF) to support fast ray tracing. At the same time, generate mesh surface data (Mesh Card) to provide a spatial query basis for subsequent lighting calculations. Import the scene mesh of the energy station into the graphics engine, parse the vertices, faces, materials and texture coordinates, check the consistency of the mesh units, ensure that the coordinate system matches the engineering requirements, and perform topology optimization and degenerate triangle filtering. For topology optimization, use MeshLab to repair non-manifold edges and isolated vertices. For degenerate triangle filtering, calculate the area of triangles and remove faces with an area less than a preset threshold. The graphics engine supports common energy station model formats such as FBX, OBJ, glTF, etc., and uses the KD-Tree acceleration structure to divide the mesh space and generate a voxel mesh of the energy station. For each voxel unit of the voxel mesh, calculate the center point coordinates and use KD-Tree to query the nearest surface point. If the distance is less than half the length of the voxel diagonal, it is marked as internal. voxels, each voxel unit stores spatial coordinates and geometric association information, the spatial coordinates are the voxel center point, and the geometric association is the index, normal and material ID of the nearest surface point (mapped through the original mesh). The split axis is selected based on the surface area heuristic (SAH) to divide the mesh space, and the leaf nodes of the KD-Tree are used to store the triangle index list. The internal nodes store the split plane information to accelerate the nearest surface query during subsequent voxelization. Based on the voxel center point of the voxelized mesh, the distance from each point to the nearest mesh surface is calculated to generate a global distance field (SDF). SDF can quickly respond to intersection queries between light and the scene and support fast ray tracing. At the same time, a hierarchical approach is used to optimize the storage structure of the global distance field, improve query efficiency, reduce memory usage, and generate mesh surface data (Mesh Card) for each mesh to record the material properties, lighting sampling position and direction information of the mesh surface for subsequent lighting calculations, providing an accurate spatial query basis. The calculation formula of the voxel unit center point coordinates is as follows: ; ; ; Where, is the coordinate of the grid origin, indicating the starting position of the voxelized grid, is the size of each voxel unit, For voxel units in The size in the direction, is the index of the voxel unit in the grid, respectively Position in direction, is the coordinate of the voxel center point; The distance from each voxel center point to the nearest mesh surface is calculated as follows: ; Where, is the coordinate of the point on the grid surface, which is used to calculate the closest distance from the voxel center to the grid surface. is the set of all points on the mesh surface, which is a vertex set of a triangle mesh. Indicates the minimum value operation. Indicates the calculation of the voxel center point To mesh surface point The Euclidean distance of The distance from the voxel center to the nearest mesh surface, used to generate the global distance field; Step 2. Combine the hybrid ray tracing mode including software ray tracing (based on SDF) and hardware ray tracing (based on triangle geometry) to process static and dynamic objects respectively, balance the calculation accuracy and performance, perform the initial lighting sampling, analyze the three-dimensional scene of the energy station, distinguish between static objects (buildings, fixed equipment, etc.) and dynamic objects (such as rotating wind turbine blades, moving maintenance vehicles, etc.), and assign ray tracing modes according to the characteristics of the objects: static objects use software ray tracing (based on global distance field (SDF)), and dynamic objects use hardware ray tracing (based on triangle geometry) to balance the calculation accuracy and performance and ensure efficient operation under different hardware configurations. For static objects, the software ray tracing technology based on the global distance field is used for the initial lighting sampling. The global distance field can quickly respond to light and field. Intersection query of the scene supports fast ray tracing, which is especially suitable for processing complex scenes. For dynamic objects, hardware ray tracing based on triangle geometry is enabled, and the hardware acceleration capabilities of the RTX graphics card are used for high-precision reflection and dynamic mesh rendering to ensure that the lighting effects of dynamic objects are realistic and efficient. The lighting data obtained by software ray tracing and hardware ray tracing are integrated. For each pixel, the lighting contributions from static objects (software ray tracing) and dynamic objects (hardware ray tracing) are combined to generate a unified lighting sampling result, seamlessly integrating the lighting data of the two modes. At the same time, the lighting effect is further optimized by combining voxelized meshes and mesh surface data to ensure that the lighting effects of the entire scene are natural, realistic and efficient. Among them, the global distance field (SDF) of the voxelized mesh is used to accelerate ray tracing, and the material properties and lighting sampling positions recorded by the mesh surface data (Mesh Card) provide an accurate spatial query basis. The expression of unified lighting sampling results is as follows: ; ; ; Where, For unified lighting sampling results, For a static object at point Along the direction The lighting contribution of is the incident light, i.e. from the direction Arrival point The light intensity, is the bidirectional reflectance distribution function (BRDF), describing the point From the direction To direction The reflection characteristics of is the incident direction, is the emission direction, is the angle of incidence, that is The angle between and the surface normal, is the set of all possible incident directions, For dynamic objects at point Along the direction Light contribution; Step 3. Capture the material properties of the scene surface and store them as a texture atlas. Manage memory through virtual paging to reduce redundant calculations and pre-capture static lighting information. For each grid surface in the energy station scene, capture its material properties, including albedo, normal, self-luminescence and other key information, and divide the scene into M×M uniform units. Each unit stores the material of a grid, and then encodes the material properties into a texture atlas, that is, merge multiple small textures into a large texture atlas to reduce the overhead of texture switching. Each unit of the texture atlas corresponds to the material properties of a grid surface. The material properties are stored in the atlas through UV mapping, and the texture atlas is divided using virtual paging technology. It is a set of multiple virtual pages, each of which contains part of the texture data. At runtime, it dynamically loads and unloads the required virtual pages according to the current view and rendering requirements to reduce memory usage and avoid loading the entire texture atlas. At the same time, it ensures that only the currently required texture data is loaded into the video memory, thereby optimizing memory usage. It uses the captured material properties and texture atlas to perform lighting calculations on the scene at multiple preset perspectives, pre-calculate static lighting information, and store the calculation results of the static lighting information as a lighting cache to ensure that the pre-captured lighting information can be quickly loaded at runtime, reducing the burden of real-time calculations, ensuring that the preset perspective can evenly cover the entire scene, and avoiding missing lighting information in certain areas. In addition, the process of splitting the texture atlas into multiple virtual pages using virtual paging technology is as follows: Based on the merged texture atlas, UV mapping is used to assign UV coordinates to each mesh surface to ensure that its material properties can be correctly stored in the texture atlas. Through virtual paging technology, combined with video memory capacity and rendering requirements, the size of each virtual page is determined, and then the texture atlas is divided into multiple virtual pages. Each page contains part of the texture data, and there can be overlapping areas between pages to avoid boundary problems. An index is created for each virtual page to record its position and range in the texture atlas. At the same time, metadata is stored for each page, including the resolution, offset, and whether the page has been loaded into the video memory. At runtime, according to the current view and rendering requirements, the virtual page that needs to be loaded is detected and the required virtual page is loaded from the disk to the video memory In the process of rendering, when a page is no longer needed, it is unloaded from the video memory to release the video memory space. The resolution refers to the resolution of the page, the offset refers to the offset of the page in the texture atlas, and the loading status refers to whether the page has been loaded into the video memory. When the renderer needs to access a certain texture data, it checks whether the virtual page where the texture data is located has been loaded into the video memory. If the page is not loaded, it requests to load the page and stores it in the cache. The cache uses the LRU (least recently used) strategy to manage the loading and unloading of pages. When the camera moves or the view changes, the virtual page that needs to be loaded is re-detected. According to the new view requirements, the new page is loaded and the no longer needed page is unloaded to ensure that only the currently required texture data is loaded into the video memory. Step 4: Deploy adaptive probes in screen space and world space to collect indirect lighting information, optimize lighting calculation efficiency through importance sampling, and optimize the distribution and noise suppression of indirect lighting; Step 5: Use an incremental update mechanism to dynamically update the surface cache and radiation cache based on a priority queue, adjust the refresh frequency based on visibility and timestamp, prioritize refreshing high-frequency visible areas, and balance performance and data accuracy; Step 6. Select the ray tracing mode based on the hardware capabilities, fuse direct light, indirect light and cached data, and output the final rendered frame to ensure a balance between performance and image quality under different configurations.
[0021] Example 2, as Figure 1 、 Figure 2 As shown, based on Example 1, the present invention provides a technical solution: preferably, step 4 specifically includes: Adaptive probes are deployed in screen space and world space, and the number and position of probes are dynamically adjusted according to the complexity of the scene and the distribution of objects. Screen space probes are used to capture indirect lighting effects at close range, and world space probes are used to capture global illumination information at long distances. The initial probe grid of screen space is generated. At the same time, the probe layout of world space is loaded, and then the probe is initialized, and its sampling range and resolution are set to ensure coverage of key areas of the energy station scene. The deployment rule of screen space probes is that when rendering each frame, the screen space depth buffer and normal buffer are used to generate the initial probe grid of screen space. The probe is generated by the energy source buffer and one probe is deployed in every N×N pixel area in the screen space. The deployment rule of the world space probe is to divide the energy station into multiple areas, deploy probes independently in each area, and increase the probe density in the area with dense objects. The importance sampling technology is used to optimize the lighting collection process of the probe, and the probe is used to collect indirect lighting information from different directions, including ambient light, reflected light and shadows, to obtain a comprehensive lighting effect. Among them, importance sampling allocates sampling points according to the expected importance of the lighting contribution, and prioritizes sampling in areas that have a greater impact on the final lighting effect, thereby improving sampling efficiency and reducing the waste of computing resources. Based on the obtained comprehensive lighting effect, the indirect lighting data collected by the screen space and world space probes are fused to generate a unified lighting field. Through data fusion, the lighting effects of different areas in the scene are naturally transitioned, avoiding the problem of lighting discontinuity caused by uneven probe distribution. At the same time, filtering and noise reduction algorithms are applied to further optimize the lighting data and reduce the noise caused by insufficient sampling or sparse probe distribution. In addition, the process of obtaining the comprehensive lighting effect is as follows: Analyze the light source distribution, object material properties, and geometric structure in the energy station scene, and define the importance function by combining the lighting contribution factors including light intensity, directionality, and distance. The higher the intensity of the light source, the greater its contribution to the lighting. The smaller the angle between the light source's direction and the surface normal, the greater its contribution to the lighting. The closer the distance between the light source and the surface, the greater its contribution to the lighting. Generate sampling points based on the defined importance function. The distribution of sampling points should be proportional to the value of the importance function, that is, more sampling points are generated in areas with higher importance function values. A random number generator is used to generate sampling points to avoid artifacts that may be introduced by regular sampling. Probes are then used to collect indirect lighting information from different directions, including ambient light, reflected light, and shadows. For each sampling point, the incident light intensity, bidirectional reflectance distribution function, and the angle between the sampling point's direction and the surface normal are analyzed to calculate its contribution to the lighting. The lighting contributions of all sampling points are then integrated to obtain a comprehensive lighting effect. The expression of the importance function is as follows: ; Where, is the value of the importance function, indicating the direction The importance of the light contribution, is the incident light intensity, indicating the direction The intensity of light reaching the surface, is the cosine of the incident angle, indicating the incident direction Angle with the surface normal The cosine value of reflects the degree of alignment between the light and the surface normal, and its value range is [0,1]. (that is, the light is perfectly aligned with the surface normal), ;when hour, Is the distance between the light source and the surface, indicating the distance from the light source to the surface, the square of the distance Used to attenuate light intensity, in accordance with the inverse square law in physics, the farther the distance, The smaller it is, the more the light intensity decreases with distance. The expression for the contribution to lighting is as follows: ; ; Where, For the The lighting contribution of each sampling point is For the The incident light intensity at each sampling point is is the bidirectional reflectance distribution function (BRDF), which represents the direction from the incident To the outgoing direction The reflection characteristics of For the The cosine of the incident angle at each sampling point, is the incident direction, is the emission direction (observation direction), is the differential reflected light intensity, indicating the direction The observed reflected light intensity, is the differential incident light intensity, indicating the direction The intensity of light reaching the surface, is the angle of incidence, indicating the direction of incidence The angle between the surface normal and When , the light is completely aligned with the surface normal and the reflection is strongest; when When the light is parallel to the surface, the reflection is weakest. hour, ;when hour, ; The expression of comprehensive lighting effect is as follows: ; Where, For comprehensive lighting effects, For the The lighting contribution of each sampling point is For the The importance function value of the sampling point, is the total number of sampling points, is the index of the sampling point, For the The importance function value of each sampling point; Step 5 specifically includes: In the energy station scenario, a priority queue is created based on regional visibility and the frequency of light changes to manage the update tasks of the surface cache and radiation cache. Priority is assigned to each cache unit based on visibility and timestamp. Cache units with high priority will be updated first to ensure that cache data in key areas is always kept up to date while optimizing overall performance. The surface cache uses a pre-capture mechanism to capture mesh material properties (albedo, normal, self-illumination, etc.) from multiple angles, store them as texture atlases, and update them through virtual paging. Page) dynamically manages memory and only supports simple geometries (such as independent walls and floors). Complex meshes (such as rooms with furniture) need to be split into independent meshes, otherwise it will cause lighting errors (manifested as pink uncovered areas); the radiation cache includes the screen space radiance cache and the space radiation cache. The screen space radiance cache is used to downsample indirect lighting, combined with full-resolution material data, to reduce noise and improve performance. The world space radiation cache is used to distinguish between near-field and far-field lighting, trace more samples for distant rays, and optimize indoor scenes (such as sky light from small windows). When rendering each frame, the cache unit with the highest priority is selected from the priority queue for update, and the surface cache and radiation cache are gradually updated according to the priority order in the queue. The surface cache can be updated at most per frame. New 1024×1024 pixels (direct light) and 512×512 pixels (indirect light) are sorted by "last use time - last update time", giving priority to refreshing high-frequency visible areas to ensure that the lighting data in high-frequency visible areas is the latest. At the same time, a maximum of a certain number of cache units are updated per frame to avoid excessive consumption of computing resources and reduce unnecessary calculations. The update frequency is dynamically adjusted based on visibility and timestamps. The priority of cache units in the priority queue is dynamically adjusted based on the current view and rendering requirements, and the visibility and timestamp of each cache unit are re-evaluated to adjust its position in the queue. For areas that have newly entered the field of view, the visibility is changed from 0 to 1, increasing its priority so that cache updates are always consistent with the current view requirements, balancing performance and data accuracy; Step 6 specifically includes: Detect the ray tracing capability of the current hardware and select an appropriate ray tracing mode. If the hardware supports RTX acceleration, hardware ray tracing is enabled to process high-precision reflections and shadows of dynamic objects. If not, it relies entirely on software ray tracing based on the global distance field (SDF). At the same time, static objects always use software ray tracing to balance performance and image quality. According to the ray tracing mode, dynamic mixing of lighting data from different sources, fusion of direct light, indirect light and cached data. For each pixel, the lighting contribution from static objects (software ray tracing) and dynamic objects (hardware ray tracing) is fused, and the global distance field of the voxelized grid is used to accelerate ray tracing, using mesh surface data (Mesh Card) records the material properties and lighting sampling positions, providing an accurate spatial query basis to ensure natural and realistic lighting effects. The fused lighting data is applied to each pixel of the scene. According to the material properties and lighting model, the final color value of each pixel is analyzed, and the fused lighting data is anti-aliased and filtered. The Gaussian filtering algorithm is used to reduce noise and aliasing in the lighting data, improve image quality, and make the rendering results smoother. The rendering results are color corrected and adjusted. According to the lighting conditions and material characteristics of the scene, the brightness, contrast, and saturation of the color are adjusted to ensure that the color of the final image is accurate and meets the expected effect. Then, based on the processed lighting data, the final rendering frame is generated, the rendering result is output to the screen, and saved as an image file to complete the entire rendering process, ensuring that the rendering effect meets the actual needs of the energy station scene.
[0022] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration, characterized in that: The following steps are involved: Step 1: Convert the scene grid of the energy station into a voxel grid, generate a global distance field, and generate grid surface data at the same time; Step 2: Combine the hybrid ray tracing mode including software ray tracing and hardware ray tracing to process static and dynamic objects respectively and perform initial lighting sampling; Step 3: Capture the scene surface material properties, store them as texture atlases, manage memory through virtual paging, and pre-capture static lighting information; Step 4: Deploy adaptive probes in screen space and world space to collect indirect lighting information and optimize lighting calculation efficiency through importance sampling; Step 5: Adopt an incremental update mechanism to dynamically update the surface cache and radiation cache based on the priority queue, and adjust the refresh frequency according to visibility and timestamp; Step 6. Select the ray tracing mode based on the hardware capabilities, fuse direct light, indirect light and cached data, and output the final rendered frame.
2. The real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration according to claim 1, characterized in that: The step 1 specifically includes: Import the energy station scene mesh into the graphics engine, analyze the vertices, faces, materials, and texture coordinates, and perform topology optimization and degenerate triangle filtering. For topology optimization, use MeshLab to repair non-manifold edges and isolated vertices. For degenerate triangle filtering, calculate the triangle area and remove faces with an area smaller than a preset threshold. A KD-Tree acceleration structure is used to divide the grid space and generate a voxelized grid for the energy station. The center point coordinates of each voxel unit in the voxelized grid are calculated, and the KD-Tree is used to query the nearest surface point. If the distance is less than half the length of the voxel diagonal, it is marked as an internal voxel. Each voxel unit stores spatial coordinates and geometric association information. The splitting axis is selected based on the surface area heuristic to divide the grid space, and the leaf nodes of the KD-Tree are used to store the triangle index list, and the internal nodes store the splitting plane information. Based on the voxel center point of the voxelized grid, the distance from each point to the nearest grid surface is calculated to generate a global distance field. At the same time, the storage structure of the global distance field is optimized in a hierarchical manner. Generate mesh surface data for each mesh, recording the material properties, lighting sampling position and direction information of the mesh surface.
3. The real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration according to claim 1, characterized in that: The step 2 specifically includes: Analyze the 3D scene of the energy station, distinguish between static and dynamic objects, and assign ray tracing modes based on the characteristics of the objects: static objects use software ray tracing, and dynamic objects use hardware ray tracing; For static objects, software ray tracing technology based on global distance fields is used for initial lighting sampling. For dynamic objects, hardware ray tracing based on triangle geometry is enabled, and the hardware acceleration capabilities of RTX graphics cards are used for high-precision reflections and dynamic mesh rendering. Integrate the lighting data obtained by software ray tracing and hardware ray tracing. For each pixel, combine the lighting contributions from static objects and dynamic objects to generate a unified lighting sampling result, fusing the lighting data of the two modes.
4. The real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration according to claim 1, characterized in that: The step 3 specifically includes: For each mesh surface in the energy station scene, its material properties are captured and the scene is divided into M×M uniform units. Each unit stores the material of a mesh. The material properties are then encoded into a texture atlas, which combines multiple small textures into a large texture atlas. Each unit in the texture atlas corresponds to the material properties of a mesh surface, and the material properties are stored in the atlas through UV mapping. Using virtual paging technology, the texture atlas is divided into multiple virtual pages, each page contains part of the texture data; Using the captured material properties and texture atlas, the scene is illuminated at multiple preset viewing angles, static lighting information is pre-calculated, and the calculation results of the static lighting information are stored as a lighting cache.
5. The real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration according to claim 4, characterized in that: The process of using virtual paging technology to divide the texture atlas into multiple virtual pages is as follows: Based on the merged texture atlas, UV mapping is used to assign UV coordinates to each mesh surface. The size of each virtual page is determined by virtual paging technology, combined with video memory capacity and rendering requirements. The texture atlas is then divided into multiple virtual pages, each of which contains part of the texture data. Create an index for each virtual page, record its position and range in the texture atlas, and store metadata for each page, including the page's resolution, offset, and whether it has been loaded into video memory. At runtime, based on the current view and rendering requirements, detect the virtual pages that need to be loaded and load the required virtual pages from disk into video memory. When the page is no longer needed, unload it from video memory to free up video memory space. When the renderer needs to access certain texture data, it checks whether the virtual page where the texture data is located has been loaded into the video memory. If the page is not loaded, it requests to load the page and stores it in the cache. When the camera moves or the view changes, it re-detects the virtual page that needs to be loaded, loads the new page according to the new view requirements, and unloads the page that is no longer needed, ensuring that only the currently required texture data is loaded into the video memory.
6. The real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration according to claim 1, characterized in that: The step 4 specifically includes: Adaptive probes are deployed in screen space and world space, and the number and position of probes are dynamically adjusted according to the scene complexity and object distribution. Screen space probes are used to capture indirect lighting effects at close range, while world space probes are used to capture global illumination information at long distances. The initial probe grid in screen space is generated, and the world space probe layout is loaded to initialize the probes and set their sampling range and resolution. Importance sampling technology is used to optimize the probe's lighting collection process, and the probe is used to collect indirect lighting information from different directions, including ambient light, reflected light, and shadows, to obtain a comprehensive lighting effect. Importance sampling allocates sampling points based on the expected importance of the lighting contribution; Based on the obtained comprehensive lighting effect, the indirect lighting data collected by the screen space and world space probes are fused to generate a unified lighting field. At the same time, filtering and denoising algorithms are applied to further optimize the lighting data.
7. The real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration according to claim 6, characterized in that: The process of obtaining the comprehensive lighting effect is as follows: Analyze the light source distribution, object material properties, and geometric structure in the energy station scene, and define the importance function by combining the light contribution factors including light intensity, directionality, and distance; Generate sampling points based on the defined importance function and use a random number generator to generate sampling points, and then use probes to collect indirect lighting information from different directions including ambient light, reflected light and shadows; For each sampling point, the incident light intensity, bidirectional reflectance distribution function, and the angle between the direction of the sampling point and the surface normal are analyzed to calculate their contribution to the lighting. Then, the lighting contributions of all sampling points are integrated to obtain the comprehensive lighting effect.
8. The real-time dynamic rendering method based on multi-layer ray tracing and caching collaboration according to claim 7, characterized in that: The expression of the importance function is as follows: ; Where, is the value of the importance function, is the incident light intensity, is the cosine of the incident angle, is the distance between the light source and the surface; The expression for the contribution to illumination is as follows: ; ; Where, For the The lighting contribution of each sampling point is For the The incident light intensity at each sampling point is is the bidirectional reflectance distribution function, For the The cosine of the incident angle at each sampling point, is the incident direction, is the emission direction, is the differential reflected light intensity, is the differential incident light intensity, is the angle of incidence; The expression of the comprehensive lighting effect is as follows: ; Where, For comprehensive lighting effects, For the The lighting contribution of each sampling point is For the The importance function value of the sampling point, is the total number of sampling points, is the index of the sampling point, For the The importance function value of each sampling point.
9. The real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration according to claim 1, characterized in that: The step 5 specifically includes: In the energy station scenario, a priority queue is created based on regional visibility and the frequency of lighting changes to manage the update tasks of the surface cache and radiation cache. Priority is assigned to each cache unit based on visibility and timestamp. The surface cache uses a pre-capture mechanism to capture mesh material properties from multiple angles, store them as texture atlases, and dynamically manage memory through virtual paging. The radiation cache includes a screen space radiance cache and a space radiation cache. The screen space radiance cache is used to downsample indirect lighting, and the world space radiation cache is used to distinguish between near-field and far-field lighting. When rendering each frame, the cache unit with the highest priority is selected from the priority queue for update, and the surface cache and radiation cache are gradually updated according to the priority order in the queue, giving priority to refreshing high-frequency visible areas; According to the current view and rendering requirements, the priority of the cache units in the priority queue is dynamically adjusted, the visibility and timestamp of each cache unit are re-evaluated, and its position in the queue is adjusted. For areas that newly enter the field of view, the visibility changes from 0 to 1, and its priority is increased, so that the cache update is always consistent with the current view requirements.
10. The real-time dynamic rendering method based on multi-layer ray tracing and cache collaboration according to claim 1, characterized in that: The step 6 specifically includes: Detect the ray tracing capabilities of the current hardware and select an appropriate ray tracing mode. If the hardware supports RTX acceleration, hardware ray tracing is enabled to process high-precision reflections and shadows of dynamic objects. If not, software ray tracing based on global distance fields is completely relied upon. At the same time, static objects always use software ray tracing. Dynamically blend lighting data from different sources, fusing direct light, indirect light, and cached data, depending on the ray tracing mode. For each pixel, it fuses lighting contributions from static and dynamic objects, and uses the global distance field of the voxelized grid to accelerate ray tracing, using the material properties and lighting sampling positions recorded in the grid surface data. The fused lighting data is applied to each pixel of the scene. According to the material properties and lighting model, the final color value of each pixel is analyzed. The fused lighting data is anti-aliased and filtered. The rendering results are color corrected and adjusted. According to the lighting conditions and material characteristics of the scene, the brightness, contrast and saturation of the color are adjusted. Then, based on the processed lighting data, the final rendering frame is generated, the rendering result is output to the screen and saved as an image file to complete the entire rendering process.
Citation Information
Patent Citations
Big data rendering method and device based on virtual paging technology
CN115981529A
Illumination rendering method and device, terminal and storage medium
CN116672706A
Computer graphic rendering method and system based on ray tracing
CN117523070A
Diffuse reflection global illumination method and system based on sparse distance field and voxelization
CN119091028A
Micro-architecture and instruction set architecture extensions for efficient equal area victim buffering through translation lookaside buffer partitioning
CN119718968A
Cited By
Layout and operation management method and system for entities in two-dimensional scene, and electronic equipment
CN121327913A
Layout and operation management method and system of entities in two-dimensional scene, and electronic device
CN121327913B
Superposition material processing method and device in virtual scene, electronic equipment and storage medium
CN121695493A