Dynamic shielding elimination method and system based on structured sight distance field
By constructing a structured view distance field and serializing data storage, the problem of high computational overhead and insufficient adaptability of existing occlusion culling methods in large 3D scenes is solved. This achieves low CPU overhead, efficient object culling and dynamic support, and is applicable to various platforms.
Patent Information
- Application Number
- CN202511059566.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-14
AI Technical Summary
Existing occlusion culling methods suffer from high computational overhead in large 3D scenes, difficulty in adapting to different scene types, incompatibility with multiple platforms, and lack of support for dynamic object culling, especially performing poorly on mobile devices.
By pre-calculating the maximum observable distances of each viewpoint in different directions in three-dimensional space, structured line-of-sight field data is constructed and serialized into a compact binary format for storage. At runtime, the visibility of objects is determined by fast distance comparison, and invisible objects are eliminated.
It achieves low CPU overhead and high efficiency in object culling, supports dynamic object culling, adapts to different types of scenarios, and is compatible with multiple platforms, especially performing well on mobile devices.
Smart Images

Figure CN120953468A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of virtual reality, digital twins, 3D games and other 3D scene technologies, and specifically to a dynamic occlusion culling method and system based on structured view distance field, which is suitable for real-time rendering optimization of large 3D scenes. Background Technology
[0002] In 3D scenes such as virtual reality, digital twins, and 3D games, as scene complexity increases, a large number of 3D object models exist. If the GPU directly renders all the models, it will consume a significant amount of time within a single frame rendering cycle, causing a significant drop in rendering frame rate or even screen stuttering, severely impacting rendering real-time performance and user experience. Therefore, before transferring model data to the GPU for rendering, it is essential for 3D scene rendering engines to adopt effective strategies to reduce the amount of data that needs to be processed for rendering.
[0003] Against this backdrop, visibility culling has become a key method for solving this problem. Visibility culling determines which objects in the scene are visible and which are invisible from the current viewpoint, avoiding unnecessary rendering of invisible objects. This significantly reduces wasted computational resources and ultimately improves the rendering frame rate. Visibility culling includes three techniques: backface culling, frustum culling, and occlusion culling. Backface culling filters out faces facing away from the viewer, and frustum culling avoids rendering objects that do not intersect with the view frustum. In densely packed 3D scenes, after backface culling and frustum culling, a large number of objects remain to be rendered. Occlusion culling is then needed to identify geometry completely occluded by other objects, further reducing the number of polygons that need to be rendered. Research shows that occlusion culling can remove an average of over 60% of objects in a scene.
[0004] However, occlusion determination in 3D space is a complex process. Although the initial intention of occlusion culling is to reduce the waste of computational resources caused by over-drawing, it also introduces additional computation in the scene rendering of each frame. Therefore, the core key point of occlusion culling is to balance its own computational overhead with the culling effect. The current mainstream occlusion culling methods include: (1) online methods, such as soft raster and GPU-driven rendering pipeline culling; (2) offline methods, such as latent visibility sets and the Portal method. Among them, offline methods are a pre-computational method that is very worthy of in-depth study.
[0005] The Visible Potential Set (PVS) method partitions the scene and pre-computes the set of objects visible from each partition space. While it has extremely low runtime overhead, the pre-computation process is time-consuming and struggles to handle dynamic scenes. To address the dynamic scene problem, researchers have proposed Dynamic Visible Potential Sets (DPVS), but its online computational overhead remains significant.
[0006] The Portal method divides the scene into different regions, identifies doors and windows connecting these regions as Portals, and constructs a scene topology graph (CPG). This method performs well in indoor scene occlusion culling, but its application in open outdoor scenes is not ideal.
[0007] Soft raster culling is a technique that renders low-resolution depth maps in the CPU to determine whether an object is occluded. It has good versatility, but it may lead to a large CPU resource consumption in large-scale scenes.
[0008] GPU-driven rendering pipeline culling leverages the parallel processing capabilities of the GPU to accelerate visibility determination, but it is highly dependent on the GPU's computing power and performs poorly on low-end mobile devices.
[0009] The problems and shortcomings of the above solutions can be summarized as follows: the potential visible set method has a long pre-computation time, large storage requirements, and difficulty in handling dynamic scenes; the Portal method is mainly suitable for indoor scenes and has insufficient support for outdoor open scenes; the soft raster culling technique consumes a lot of CPU resources in large-scale scenes; the GPU-driven method depends on hardware performance and performs poorly on low-end platforms such as mobile devices.
[0010] Patent application CN119091029A discloses a GPU-based method and system for culling invisible objects. It generates hierarchical Z-buffer data in the GPU using the depth map of the current frame, and then passes the bounding box information and coordinate information of the objects to the GPU for calculation with the hierarchical Z-buffer data, thus culling completely occluded objects from the rendering queue. However, because this method is highly dependent on GPU performance, its performance is not ideal on devices with limited hardware resources, such as mobile devices.
[0011] Patent application CN119488716A discloses a method, apparatus, electronic device, and storage medium for culling occluded objects. This patent establishes a building structure for a virtual scene to be rendered, performs view frustum clipping based on the player's current position in the virtual scene and the entrances connecting rooms, calculates the clipping view frustum at the current position, and treats objects that do not intersect with the clipping view frustum as occluders for culling. While this method can achieve efficient culling in indoor scenes, it is difficult to apply to open scenes due to its reliance on the connecting structure of building rooms.
[0012] Currently, there is no universal and efficient occlusion culling method that can achieve low runtime overhead, adaptability to different types of scenarios, compatibility with multiple platforms, and support for dynamic object culling. Summary of the Invention
[0013] To overcome the shortcomings of the prior art, the present invention aims to provide a dynamic occlusion culling method and system based on a structured view distance field. This method pre-calculates the maximum observable distance of each viewpoint in three-dimensional space in different directions to characterize the occlusion relationship of the scene. This view distance information is organized into efficient structured view distance field data and serialized into a compact binary format for storage. During runtime, the program only needs to load this pre-calculated data, and the visibility of objects can be determined by rapid distance comparison, and invisible objects can be culled, thereby effectively improving the rendering efficiency of the scene and providing good support for the culling of dynamic objects.
[0014] On one hand, the present invention provides a dynamic occlusion culling method based on a structured line-of-sight field, comprising:
[0015] Step 1: Load and initialize the 3D scene model, and construct the observed space and the observation space according to the distribution of objects;
[0016] Step 2: Divide the observation space constructed in Step 1 into multiple coarse-grained observation grid units;
[0017] Step 3: Based on the spatial occlusion features of the scene, perform non-uniform adaptive partitioning on the observed space constructed in Step 1 to obtain multiple observed grid cells with multi-level sizes.
[0018] Step 4: Perform omnidirectional line-of-sight sampling on the center point of each coarse-grained observation grid cell obtained in Step 2 to obtain the visible distance values in each direction. The visible distance values of all coarse-grained observation grid cells in all directions together constitute the coarse-grained line-of-sight field.
[0019] Step 5: Pair the coarse-grained observation grid cells obtained in Step 2 with the multi-level observed grid cells obtained in Step 3. Using the coarse-grained line-of-sight field calculated in Step 4, prune the grid cell pairings whose visibility has been determined to obtain multiple observation grid cells and observed grid cells with visibility to be calculated.
[0020] Step 6: Pair each observation grid cell with visibility to be calculated after pruning in Step 5 with the observed grid cell, and calculate the visibility relationship between the observation grid and the observed grid.
[0021] Step 7: Based on the coarse-grained observation grid cells obtained in Step 2, further refine the division to obtain multiple fine-grained observation grid cells;
[0022] Step 8: Perform high-precision omnidirectional line-of-sight sampling on the center point of each fine-grained observation grid cell obtained in Step 7 to obtain a fine-grained line-of-sight field.
[0023] Step 9: Serialize the fine-grained line-of-sight field obtained in Step 8 and the visibility relationship between the observation grid and the observed grid obtained in Step 6 into binary format, perform compression optimization, and store them in blocks into a file;
[0024] Step 10: During runtime, the pre-calculated data of the viewpoint-related region is dynamically loaded from the file stored in Step 9 according to the viewpoint position. The viewpoint movement status is monitored and possible movement trajectories are predicted. Based on the predicted movement trajectories, the file blocks to be loaded are prioritized and loaded in order. An asynchronous loading method is adopted to finally complete the loading of the pre-calculated data of the viewpoint-related region.
[0025] Step 11: Combine the pre-calculated data loaded in Step 10 with the real-time scene state to determine the visibility of each object in the scene.
[0026] Furthermore, in step 1, firstly, the three-dimensional scene geometric data is imported, including static obstacles and potential dynamic objects, and objects with complex hole structures are filtered out. Then, the axisymmetric bounding box containing all objects in the scene is calculated, and its region is the observed space. In addition, the xyz range is the axisymmetric bounding box specified by the user, and its region is the observed space.
[0027] Furthermore, in step 2, the observation space constructed in step 1 is uniformly divided into multiple cylindrical regions in the horizontal direction, and in the vertical direction, the layer height is dynamically adjusted according to the height above the ground, and each cylindrical region is divided into grids of different layer heights, ultimately obtaining multiple coarse-grained observation grid units.
[0028] Furthermore, the specific method of step 3 is as follows:
[0029] Step 3.1: Divide the observed space constructed in Step 1 into multiple cylindrical regions in the horizontal direction. For each cylindrical region, select multiple random points around it and connect them to form multiple horizontal rays. Emit the rays to detect whether a collision occurs. If the proportion of rays that cause a collision is less than a set threshold, the region is considered to be relatively empty. Otherwise, the region is judged to have a complex occlusion situation. The corresponding cylindrical region is then divided into multiple smaller cylindrical regions in a uniform manner. The division process is recursively carried out until all cylindrical regions have been judged to be empty or the maximum number of divisions has been reached.
[0030] Step 3.2: Using the same vertical division method as in Step 2, the multiple smaller cylindrical regions obtained in Step 3.1 are divided vertically to obtain multiple observed mesh cells with multiple sizes.
[0031] Furthermore, the specific method of step 4 is as follows:
[0032] The spherical space with the center point of each coarse-grained observation grid cell obtained in step 2 is divided into multiple directional cones. A three-dimensional polar coordinate system is used to determine the direction through azimuth and polar angle. Multiple sampling rays are emitted in each direction, and the farthest and nearest collision distances between the rays and scene objects are recorded. The farthest collision distance is the maximum visible distance, and the nearest collision distance is the guaranteed visible distance. Finally, the maximum visible distance and guaranteed visible distance of all coarse-grained observation grid cells in all directions are recorded to generate a coarse-grained line-of-sight field.
[0033] Furthermore, the specific method of step 5 is as follows:
[0034] Pair the coarse-grained observation grid cells obtained in step 2 with the observed grid cells with multiple sizes obtained in step 3. For each pair, based on the directional relationship between the grids, query the corresponding maximum visible distance and the guaranteed visible distance in the coarse-grained line-of-sight field obtained in step 4. When the distance between the paired grids is greater than the maximum visible distance, the grids are not visible to each other. When the distance between the paired grids is less than the guaranteed visible distance, the grids are visible to each other. In other cases, the visibility between the paired grids is uncertain and is retained. Finally, multiple pairs of observation grid cells and observed grid cells with visibility to be calculated are obtained.
[0035] Further, the specific method of step 6 is as follows: pair each observation grid cell and the observed grid cell obtained in step 5 for visibility to be calculated, use the Monte Carlo sampling method to randomly select multiple sampling points in both the observation grid and the observed grid, check whether the line of sight between these sampling points is blocked, and obtain the visibility relationship between the observation grid and the observed grid.
[0036] Furthermore, the specific method for step 7 is as follows:
[0037] For each coarse-grained observation grid cell obtained in step 2, perform several additional splits in the horizontal direction to obtain multiple fine-grained observation grid cells.
[0038] Furthermore, the specific method of step 8 is as follows:
[0039] Using the same directional cone division method as in step 4, the spherical space with the center point of each fine-grained observation grid cell obtained in step 7 as the origin is divided into multiple directional cones. Using a higher directional resolution than in step 2, more directional cones with a smaller angle range are obtained. Multiple sampling rays are emitted in each directional cone, and the farthest collision distance of the rays is recorded to obtain a fine-grained line-of-sight field.
[0040] Furthermore, the specific method for step 9 is as follows:
[0041] The fine-grained line-of-sight field obtained in step 8 and the visibility relationship between the observation grid and the observed grid obtained in step 6 are serialized into binary format and stream-compressed. All data are stored in multiple files according to spatial location, and the line-of-sight field and visibility information of neighboring observation grids are organized into the same file.
[0042] Furthermore, the specific method of step 10 is as follows:
[0043] Based on the current viewpoint position, pre-calculated data of the relevant area around the viewpoint is loaded from the file stored in step 9. The viewpoint movement trend is monitored, the possible location is predicted, and the file blocks of the relevant area around the viewpoint are prioritized. The file blocks that are more likely to be accessed in the future have higher priority. The file blocks are loaded in order of priority. A lock-free thread synchronization design is used to achieve asynchronous loading, and finally the pre-calculated data of the relevant area of the viewpoint is loaded.
[0044] Furthermore, the specific method of step 11 is as follows:
[0045] The complex object is simplified into a bounding sphere, its direction vector relative to the viewpoint is calculated, the corresponding direction cone is determined, the maximum visible distance in this direction is queried from the pre-calculated data of the viewpoint-related region loaded in step 10, and the pre-calculated visibility relationship between the observation grid where the viewpoint is located and the observed grid where the object is located is queried. The object is then comprehensively judged to determine whether it is occluded.
[0046] On the other hand, the present invention also provides a dynamic occlusion culling system based on a structured line-of-sight field, comprising: a pre-calculation module, a runtime module, a visualization module, and a general module, wherein:
[0047] The pre-computation module includes a view distance calculation unit, a mesh visibility calculation unit, and a data compression unit; it is used to implement scene loading, spatial partitioning, view distance field calculation, visibility calculation, data compression and serialization in the pre-computation stage.
[0048] The visible distance calculation unit is used to perform omnidirectional visible distance sampling on the center point of each coarse-grained observation grid unit to obtain visible distance values in each direction and obtain a coarse-grained visible distance field; and to perform high-precision omnidirectional visible distance sampling on the center point of each fine-grained observation grid unit to obtain a fine-grained visible distance field.
[0049] The mesh visibility calculation unit is used to pair each observed mesh unit with the observed mesh unit after pruning to calculate the visibility of each observed mesh, and to calculate the visibility relationship between the observed mesh and the observed mesh.
[0050] The data compression unit is used to compress and optimize the pre-calculated fine-grained field of view and the visibility relationship between the observation grid and the observed grid;
[0051] The runtime module includes a motion prediction unit, a priority loading unit, and an occlusion query unit; it is used to implement motion prediction, file block priority partitioning and loading, and object occlusion query during the runtime phase.
[0052] The motion prediction unit is used to monitor the viewpoint's movement status and predict possible movement trajectories.
[0053] The priority loading unit is used to prioritize file blocks in the relevant area around the viewpoint based on the predicted movement trajectory results, and load the file blocks sequentially.
[0054] The occlusion query unit is used to determine the visibility of each object in the scene by combining the pre-calculated data and the real-time scene status.
[0055] The visualization module includes a performance monitoring unit and a basic graphics drawing unit; it is used to visualize intermediate data during program execution into intuitive graphics, facilitating debugging and analysis.
[0056] The performance monitoring unit monitors the system's operational performance indicators and is used for system debugging and optimization.
[0057] The basic graphics drawing unit provides basic graphics rendering support for drawing intuitive visualization results, which facilitates debugging and analysis.
[0058] The general modules include a space partitioning and management unit, a thread management unit, a data management unit, a combined graphics drawing unit, and a ray detection unit;
[0059] The combined graphics drawing unit: based on basic graphics rendering elements, it improves the drawing and rendering of more complex combined graphics, and is used to draw intuitive visualization results, which are convenient for debugging and analysis;
[0060] The spatial partitioning and management unit is used for all spatial partitioning-related logic, including dividing the constructed observation space into multiple coarse-grained observation grid units, performing non-uniform adaptive partitioning on the constructed observed space to obtain multiple observed grid units with multi-level sizes, and performing more refined partitioning on the basis of coarse-grained observation grid units to obtain multiple fine-grained observation grid units.
[0061] The thread management unit is used to implement asynchronous loading and coordinate the data synchronization process of multiple threads.
[0062] The data management unit is used to serialize the pre-calculated fine-grained field of view and the visibility relationship between the observation grid and the observed grid into binary format, and is also responsible for dynamically loading the pre-calculated data of the viewpoint-related region from the stored file into memory.
[0063] The ray detection unit encapsulates the ray detection function of the underlying engine and is used to call it during line-of-sight sampling.
[0064] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0065] 1. This invention constructs a structured view distance field by pre-calculating the maximum visible distance from different positions in various directions in the scene and stores it as file data in blocks. During runtime, the pre-calculated file data is loaded on demand. The visibility of objects can be determined by simply looking up a table and comparing distances. Therefore, it has the advantages of low CPU overhead and high running efficiency.
[0066] 2. This invention employs a dynamic loading mechanism, loading only pre-calculated data related to the viewpoint's surroundings into memory at any given time. Furthermore, it predicts the motion trajectory based on the current viewpoint's movement trend, thereby prioritizing the loading of file blocks and ensuring that data most likely to be used in the future is loaded first. Therefore, the system has a small memory footprint and high stability in its culling function.
[0067] 3. The method of the present invention does not rely on GPU, has good cross-platform compatibility, and is suitable for application on low-end platforms such as mobile devices.
[0068] 4. This invention supports the culling of dynamic objects by dividing the observation space and the observed space, and mapping dynamic objects to static observed grids according to the spatial position of objects during runtime.
[0069] 5. This invention generates a line-of-sight field through pre-calculation, transforming the complex visibility problem into a line-of-sight comparison process. It does not depend on specific scene features and can be applied to various types of scenes.
[0070] In summary, this invention describes occlusion relationships in a scene by pre-calculating the maximum observable distances of each viewpoint in different directions within a 3D space. Subsequently, this distance information is organized into efficient structured data and serialized into a compact binary format for storage. At runtime, the program only needs to load this pre-calculated data and quickly determine object visibility through distance comparison, thus eliminating invisible objects. This method has the advantages of high versatility, low CPU overhead, and support for multiple platforms. Attached Figure Description
[0071] Figure 1 This is a flowchart of the method of the present invention.
[0072] Figure 2 This is an architecture diagram of the system of the present invention.
[0073] Figure 3 This is a schematic diagram of the town, the test scenario for this invention.
[0074] Figure 4 This is a schematic diagram of the horizontal division of the observed space in this invention.
[0075] Figure 5 This is a schematic diagram of the vertical division of the observed space in this invention.
[0076] Figure 6 This is a schematic diagram of the directional sector division for all-around line-of-sight sampling according to the present invention.
[0077] Figure 7 This is a schematic diagram illustrating the priority division of file blocks around the viewpoint based on motion prediction in this invention.
[0078] Figure 8 This is a comparison chart of rendering effects and performance metrics before and after enabling occlusion culling in this invention; among them, Figure 8 (a) is a graph showing the rendering effect and performance metrics without occlusion culling enabled. Figure 8 (b) Rendering effects and performance metrics for enabling occlusion culling.
[0079] Figure 9 This is a performance curve of the 30-second scene roaming test of this invention.
[0080] Figure 10 This is a comparison chart of CPU time consumption between the present invention and the Unreal Engine's built-in soft raster occlusion removal system.
[0081] Figure 11 This is a frame rate comparison chart between the present invention and the Unreal Engine's built-in soft raster occlusion removal system. Detailed Implementation
[0082] To more clearly illustrate the purpose, technical solution, and advantages of this invention, the following detailed description is provided in conjunction with specific embodiments. It should be understood that the specific embodiments described below are for illustrative purposes only and are not intended to limit the scope of this invention.
[0083] like Figure 1 As shown, this method quickly determines object visibility at runtime by pre-calculating the scene's view distance field information and the visibility of mesh pairs. The specific method includes the following steps:
[0084] Step 1, Scene Construction: Load and initialize the 3D scene model, mainly including static obstacles (such as buildings, walls, etc.), and filter out objects with complex hole structures (such as fences, vegetation, etc.) to avoid them interfering with occlusion detection. This embodiment adopts... Figure 3 The town shown is used as a test scenario. The system determines the reachable area of the viewpoint within the scene. The observation space, i.e., the area that the player character or camera can reach, usually needs to be manually set by the user because the player character's mobility varies in different situations; in some cases, the character can fly or dive, etc. Afterward, an axisymmetric bounding box containing all objects in the scene is calculated as the observed space.
[0085] Step 2, Coarse-grained Observation Space Division: The observation space constructed in Step 1 is divided into coarse-grained observation grid units. First, these areas are horizontally and uniformly divided into several cylindrical regions. The size of these regions can be adjusted according to the size of obstacles in the scene and the user's final storage limitations, typically ranging from 8m*8m to 32m*32m. Vertically, because the sensitivity of visibility changes varies at different heights, the granularity of the division is dynamically adjusted according to the ground clearance. Regions closer to the ground are divided using smaller layer heights, while regions farther from the ground are divided using larger layer heights. Finally, multiple coarse-grained observation grid units are obtained, laying the foundation for subsequent pruning and optimization.
[0086] Step 3, Adaptive Partitioning of the Observed Space: Based on scene complexity and importance, the observed space constructed in Step 1 is subjected to non-uniform adaptive partitioning. First, the observed space is uniformly divided into several cylindrical regions. For each cylindrical region, the system analyzes the geometric distribution characteristics of the scene around it, and tests occlusion through random horizontal ray sampling to identify areas with dense object distribution. For cylindrical regions with dense object distribution, they are further subdivided into multiple smaller cylindrical regions. Then, each cylindrical region is partitioned vertically. Spaces closer to the ground are more sensitive to changes in visibility; therefore, smaller layer heights are used to capture scene spatial features. After horizontal and vertical partitioning, multiple observed mesh cells with multi-level sizes are finally obtained. This adaptive partitioning strategy effectively balances accuracy and computational efficiency, allowing the system to concentrate limited computational resources on key areas. Figure 4 and Figure 5 The visualization results of the horizontal and vertical division of the observed space are presented.
[0087] Step 4, coarse-grained line-of-sight calculation: Divide the spherical space with the center point of each coarse-grained observation grid cell obtained in Step 2 into multiple directional sectors, such as... Figure 6 As shown, a three-dimensional polar coordinate system is used, through azimuth angles... The direction is determined by the polar angle θ (range [0, 2π)) and the polar angle θ (range [-π / 2, π / 2]). The system emits sampled rays in each direction, calculates the minimum and maximum collision distances between the rays and scene objects, and generates a coarse-grained view distance field for quickly determining the visibility of mesh pairs.
[0088] Step 5, Pruning based on line-of-sight information: Pair the coarse-grained observation grid cells obtained in Step 2 with the observed grid cells with multiple sizes obtained in Step 3. Using the coarse-grained line-of-sight calculated in Step 4, preliminarily determine the visibility of the grid pairings. Prune the obviously invisible and obviously visible grid pairings. The visibility of the remaining grid pairings is still uncertain. Finally, multiple observation grid cells with visibility to be calculated are paired with observed grid cells.
[0089] Step 6, Grid Visibility Calculation: For each observation grid cell whose visibility is to be calculated after pruning in Step 5, pair it with the observed grid cell and calculate the visibility relationship between them. The system uses the Monte Carlo sampling method to randomly select multiple sampling points in both the observation grid and the observed grid, check whether the line of sight between these sampling points is blocked, and record the visibility relationship between the observation grid and the observed grid. These data will be used to handle long-distance occlusion.
[0090] Step 7, Observation Spatial Fine-Grained Subdivision: Each coarse-grained observation grid cell obtained in Step 2 is subdivided several times, ultimately resulting in multiple smaller fine-grained observation grid cells. Fine-grained subdivision provides a basis for higher-precision spatial sampling.
[0091] Step 8, Fine-grained line-of-sight field calculation: For the center point of each fine-grained observation grid cell obtained in Step 7, perform high-precision omnidirectional line-of-sight sampling. Divide the directional cones using the same method as in Step 4 for coarse-grained line-of-sight field calculation, using a higher directional resolution than in Step 2 to obtain a more accurate directional spatial division. Sampling is performed by emitting several rays in each directional cone, recording the farthest collision distance of the rays, and constructing a fine-grained line-of-sight field to handle near-range obstacle occlusion.
[0092] Step 9, Data Serialization and Storage: The fine-grained line-of-sight data obtained in Step 8 and the visibility relationships between the observed and observed grids obtained in Step 6 are compressed and optimized, and then serialized and stored in the file system. The system stores spatial partitioning parameters (such as grid size, level, etc.) and grid index data in a compact binary format. For line-of-sight data, floating-point distance values are quantized into 4-bit integers. For grid visibility relationship data, a 0-1 sequence is used to indicate whether a grid pair is visible.
[0093] Step 10, Dynamic Data Loading: At runtime, pre-calculated data for relevant regions is dynamically loaded based on the viewpoint location. The system first loads a file containing spatial partitioning parameters and index data, constructing an in-memory spatial index structure. Based on the current viewpoint location, the system only loads the line-of-sight field data and grid visibility data for relevant regions surrounding the viewpoint. The system monitors the viewpoint's movement trend, predicts possible destinations, and prioritizes neighboring data blocks based on the predicted trajectory and their spatial relationship. Figure 7 As shown, smaller numbers indicate higher priority, and the system loads data blocks sequentially according to priority. To avoid data loading impacting rendering performance, the system employs a lock-free thread synchronization design and a double-buffered storage structure to ensure the main rendering thread is not blocked.
[0094] Step 11, Object Visibility Query: Combining pre-calculated data and real-time scene status, the system quickly determines the visibility of each object in the scene. Complex objects are simplified into bounding spheres, their direction vectors relative to the viewpoint are calculated, the corresponding direction cones are determined, and the maximum visible distance in that direction is queried. Simultaneously, the system queries the pre-calculated visibility relationship between the viewpoint's observation grid and the object's observed grid. By comprehensively considering factors such as view distance field information, grid visibility relationships, and object size, the system can quickly and accurately determine whether an object is occluded. For objects determined to be invisible, the system removes them from the rendering queue, significantly reducing the GPU rendering burden and improving overall rendering performance.
[0095] This invention implements a dynamic occlusion culling system based on structured view distance field on the Unreal Engine platform. It adopts a four-layer structure design, the specific architecture of which is as follows: Figure 2 As shown.
[0096] The highest layer of the system is the user interface layer, which includes three functional modules: a pre-computation module, a runtime module, and a visualization module. These modules directly provide functional interfaces to the outside world, supporting user interaction with the system. The pre-computation module is responsible for generating the data required for occlusion culling in advance; the runtime module handles the occlusion culling operation during program execution; and the visualization module is used to display the effects and data of occlusion culling.
[0097] The occlusion algorithm layer is the core of the system, encapsulating all relevant algorithm logic so that users do not need to understand the specific content of this layer, thereby reducing the learning and understanding cost. Specifically, the visibility distance calculation unit, grid visibility calculation unit, and data compression unit implement the functions of the pre-computation module; the movement prediction unit, priority loading unit, and occlusion query unit support the functions of the runtime module; the performance monitoring unit and basic graphics drawing unit implement the functions of the visualization module; in addition, the spatial partitioning and management unit, thread management unit, data management unit, and combined graphics drawing unit provide functional implementations for general modules.
[0098] To enhance the system's cross-engine portability, an engine dependency layer has been introduced, encapsulating all engine-related functionalities within this layer. In the future, when switching engines, only a small amount of code in this layer needs to be modified to achieve adaptation. Within this layer, the raycasting unit provides functional support for general modules; the performance monitoring unit and the basic graphics drawing unit provide functional support for visualization modules.
[0099] The lowest layer is the UE engine layer, which is the internal function API of Unreal Engine, providing underlying basic support for the system.
[0100] The pre-computation module, located in the user interface layer, includes a view distance calculation unit, a mesh visibility calculation unit, and a data compression unit. It is used to implement scene loading, spatial partitioning, view distance field calculation, visibility calculation, data compression, and serialization in the pre-computation stage; it is the main interactive interface for the pre-computation stage. Among them:
[0101] The visible distance calculation unit, located in the pre-computation module of the occlusion algorithm layer, is used to perform omnidirectional visible distance sampling on the center point of each coarse-grained observation grid unit obtained in step 2 in step 4, obtain visible distance values in each direction, and obtain a coarse-grained visible distance field; and to perform high-precision omnidirectional visible distance sampling on the center point of each fine-grained observation grid unit obtained in step 7 in step 8, and obtain a fine-grained visible distance field.
[0102] The mesh visibility calculation unit, located in the pre-computation module of the occlusion algorithm layer, is used to pair the observation mesh unit and the observed mesh unit after each pruning in step 5 in step 6 to calculate the visibility relationship between the observation mesh and the observed mesh.
[0103] The data compression unit, located in the pre-computation module of the occlusion algorithm layer, is used to compress and optimize the fine-grained line-of-sight field pre-computed in step 8 and the visibility relationship between the observation grid and the observed grid obtained in step 6 in step 9.
[0104] The runtime module, located in the user interface layer, includes a motion prediction unit, a priority loading unit, and an occlusion query unit; it is used to implement motion prediction, file block priority partitioning and loading, and object occlusion query during the runtime phase; among which:
[0105] The motion prediction unit, a runtime module located in the occlusion algorithm layer, is used to monitor the viewpoint motion status and predict possible motion trajectories in step 10.
[0106] The priority loading unit, located in the runtime module of the occlusion algorithm layer, is used to implement the priority division of file blocks in the relevant areas around the viewpoint according to the predicted movement trajectory results in step 10, and to load the file blocks in sequence.
[0107] The occlusion query unit, located in the runtime module of the occlusion algorithm layer, is used to determine the visibility of each object in the scene by combining the pre-calculated data loaded in step 10 and the real-time scene state in step 11.
[0108] The visualization module, located in the user interface layer, includes a performance monitoring unit and a basic graphics drawing unit; it is used to visualize intermediate data during program execution into intuitive graphs, facilitating debugging and analysis; among which:
[0109] The performance monitoring unit, a visualization module located in the engine dependency layer, monitors system performance metrics for system debugging and optimization.
[0110] The basic graphics drawing unit, located in the engine dependency layer, is a visualization module that provides basic graphics rendering support for drawing intuitive visualization results, facilitating debugging and analysis.
[0111] The general module includes a space partitioning and management unit, a thread management unit, a data management unit, a combined graphics drawing unit, and a ray detection unit; among which:
[0112] The spatial partitioning and management unit, a general module located in the occlusion algorithm layer, is used for all spatial partitioning-related logic, including dividing the observation space constructed in step 1 into multiple coarse-grained observation grid units in step 2, performing non-uniform adaptive partitioning on the observed space constructed in step 1 in step 3 to obtain multiple observed grid units with multi-level sizes in step 3, and performing more refined partitioning on the coarse-grained observation grid units obtained in step 2 in step 7 to obtain multiple fine-grained observation grid units.
[0113] The thread management unit, a general module located in the occlusion algorithm layer, is used to implement asynchronous loading in step 10 and coordinate the data synchronization process of multiple threads.
[0114] The data management unit, a general module located in the occlusion algorithm layer, is used in step 9 to serialize the fine-grained viewing distance field pre-calculated in step 8 and the visibility relationship between the observation grid and the observed grid obtained in step 6 into binary format. It is also responsible for dynamically loading the pre-calculated data of the viewpoint-related region from the file stored in step 9 into memory in step 10.
[0115] Composite Graphics Rendering Unit: A general module located in the occlusion algorithm layer; based on basic graphics rendering elements, it improves the rendering of more complex composite graphics, used to draw intuitive visualization results, facilitating debugging and analysis;
[0116] The ray detection unit, a general module located in the engine dependency layer, encapsulates the ray detection function of the underlying engine and is used to call it during the line-of-sight sampling process in steps 4 and 8.
[0117] The system's lowest layer is a virtual engine platform, which provides basic hardware access support to ensure that the system can run efficiently in different hardware environments.
[0118] Experimental Analysis
[0119] Experimental testing showed that the system's pre-calculation process took an average of 953.5 seconds, generating a total data file size of 8.18MB, which included spatial information (0.1MB), visible distance data (2.11MB), and a distant occlusion visibility set (5.96MB). The pre-calculation time and storage requirements were within a reasonable range.
[0120] The experiment compared the rendering effects and performance metrics before and after enabling occlusion culling, such as... Figure 8 As shown, Figure 8 (a) shows the rendering effect and performance metrics without occlusion culling enabled. Figure 8 (b) Rendering effects and performance metrics with occlusion culling enabled. As can be seen from the figure, while maintaining consistent rendering results, the rendering frame rate increased from 67.29 to 100.32 after enabling occlusion culling, indicating that the system has a significant effect on improving rendering efficiency.
[0121] Table 1 Performance Comparison Before and After Enabling Obscuration Elimination
[0122] Performance indicators Occlusion removal not enabled Enable occlusion culling Percentage of change CPU time 6.94ms 7.37ms +6.2% DrawCall 5399 3305 -38.8% Rendering time 14.19ms 9.86ms -30.5% GPU-side time consumption 14.03ms 10.06ms -28.3% Total frame time 14.88ms 9.96ms -33.1% FPS 67.2 100.4 +49.4%
[0123] Table 1 presents the performance test results. This system can significantly reduce the number of DrawCalls (by 38.8%) and reduce rendering time (by 30.5%). Although CPU time has increased slightly (by 6.2%), the total frame time has decreased by 33.1%, and the frame rate has increased by approximately 49.4%.
[0124] In the 30-second scene roaming test, such as Figure 9 As shown, the system's performance after enabling occlusion culling is consistently better than when it is not enabled, with an average culling rate of 47.1% and a maximum of 88.4%.
[0125] This invention also compared the system with the Unreal Engine's built-in soft raster occlusion culling system. The CPU time per frame for this system at the same viewpoint is only 0.43 milliseconds, lower than the 2.03 milliseconds of the soft raster system. Figure 10 As shown. The frame rate of the system was tested while roaming the scene along the same path, and the experimental results are as follows. Figure 11 As shown, in most cases, the frame rate of this system is higher than that of the soft raster system built into Unreal Engine. This is mainly due to the pre-computation optimization strategy adopted by this system, which only needs to perform simple data queries to complete the object visibility judgment during runtime.
[0126] The experimental results above demonstrate that the dynamic occlusion culling method and system based on structured view distance field proposed in this invention can significantly improve the rendering efficiency of 3D scenes and maintain stable performance improvement under various scene conditions. Compared with existing technologies, this invention has outstanding advantages such as low runtime CPU overhead, reasonable storage requirements, high culling efficiency, and good adaptability, making it particularly suitable for use in virtual reality, digital twins, large-scale open-world 3D games, and mobile platform applications with low computing power.
[0127] The above description is merely a specific embodiment of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention, and within the spirit and principles of the present invention, should be covered within the protection scope of the present invention.
Claims
1. A dynamic occlusion culling method based on a structured line-of-sight field, characterized in that, include: Step 1: Load and initialize the 3D scene model, and construct the observed space and the observation space according to the distribution of objects; Step 2: Divide the observation space constructed in Step 1 into multiple coarse-grained observation grid units; Step 3: Based on the spatial occlusion features of the scene, perform non-uniform adaptive partitioning on the observed space constructed in Step 1 to obtain multiple observed grid cells with multi-level sizes. Step 4: Perform omnidirectional line-of-sight sampling on the center point of each coarse-grained observation grid cell obtained in Step 2 to obtain the visible distance values in each direction. The visible distance values of all coarse-grained observation grid cells in all directions together constitute the coarse-grained line-of-sight field. Step 5: Pair the coarse-grained observation grid cells obtained in Step 2 with the multi-level observed grid cells obtained in Step 3. Using the coarse-grained line-of-sight field calculated in Step 4, prune the grid cell pairings whose visibility has been determined to obtain multiple observation grid cells and observed grid cells with visibility to be calculated. Step 6: Pair each observation grid cell with visibility to be calculated after pruning in Step 5 with the observed grid cell, and calculate the visibility relationship between the observation grid and the observed grid. Step 7: Based on the coarse-grained observation grid cells obtained in Step 2, further refine the division to obtain multiple fine-grained observation grid cells; Step 8: Perform high-precision omnidirectional line-of-sight sampling on the center point of each fine-grained observation grid cell obtained in Step 7 to obtain a fine-grained line-of-sight field. Step 9: Serialize the fine-grained line-of-sight field obtained in Step 8 and the visibility relationship between the observation grid and the observed grid obtained in Step 6 into binary format, perform compression optimization, and store them in blocks into a file; Step 10: During runtime, the pre-calculated data of the viewpoint-related region is dynamically loaded from the file stored in Step 9 according to the viewpoint position. The viewpoint movement status is monitored and possible movement trajectories are predicted. Based on the predicted movement trajectories, the file blocks to be loaded are prioritized and loaded in order. An asynchronous loading method is adopted to finally complete the loading of the pre-calculated data of the viewpoint-related region. Step 11: Combine the pre-calculated data loaded in Step 10 with the real-time scene state to determine the visibility of each object in the scene.
2. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, In step 1, firstly, the three-dimensional scene geometric data is imported, including static obstacles and potential dynamic objects, and objects with complex hole structures are filtered out. Then, the axisymmetric bounding box containing all objects in the scene is calculated, and its area is the observed space. In addition, the xyz range is the axisymmetric bounding box specified by the user, and its area is the observed space. In step 2, the observation space constructed in step 1 is uniformly divided into multiple cylindrical regions in the horizontal direction. In the vertical direction, the layer height is dynamically adjusted according to the height above the ground, and each cylindrical region is divided into grids of different layer heights, ultimately resulting in multiple coarse-grained observation grid units.
3. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 3 is as follows: Step 3.1: Divide the observed space constructed in Step 1 into multiple cylindrical regions in the horizontal direction. For each cylindrical region, select multiple random points around it and connect them to form multiple horizontal rays. Emit the rays to detect whether a collision occurs. If the proportion of rays that cause a collision is less than a set threshold, the region is considered to be relatively empty. Otherwise, the region is judged to have a complex occlusion situation. The corresponding cylindrical region is then divided into multiple smaller cylindrical regions in a uniform manner. The division process is recursively carried out until all cylindrical regions have been judged to be empty or the maximum number of divisions has been reached. Step 3.2: Using the same vertical division method as in Step 2, the multiple smaller cylindrical regions obtained in Step 3.1 are divided vertically to obtain multiple observed mesh cells with multiple sizes.
4. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 4 is as follows: The spherical space with the center point of each coarse-grained observation grid cell obtained in step 2 is divided into multiple directional cones. A three-dimensional polar coordinate system is used to determine the direction through azimuth and polar angle. Multiple sampling rays are emitted in each direction, and the farthest and nearest collision distances between the rays and scene objects are recorded. The farthest collision distance is the maximum visible distance, and the nearest collision distance is the guaranteed visible distance. Finally, the maximum visible distance and guaranteed visible distance of all coarse-grained observation grid cells in all directions are recorded to generate a coarse-grained line-of-sight field.
5. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 5 is as follows: Pair the coarse-grained observation grid cells obtained in step 2 with the observed grid cells with multiple sizes obtained in step 3. For each pair, based on the directional relationship between the grids, query the corresponding maximum visible distance and the guaranteed visible distance in the coarse-grained line-of-sight field obtained in step 4. When the distance between the paired grids is greater than the maximum visible distance, the grids are not visible to each other. When the distance between the paired grids is less than the guaranteed visible distance, the grids are visible to each other. In other cases, the visibility between the paired grids is uncertain and is retained. Finally, multiple pairs of observation grid cells and observed grid cells with visibility to be calculated are obtained.
6. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method of step 6 is as follows: pair each observation grid cell and the observed grid cell obtained in step 5 for visibility to be calculated, use the Monte Carlo sampling method to randomly select multiple sampling points in both the observation grid and the observed grid, check whether the line of sight between these sampling points is blocked, and obtain the visibility relationship between the observation grid and the observed grid. The specific method for step 7 is as follows: For each coarse-grained observation grid cell obtained in step 2, perform several additional splits in the horizontal direction to obtain multiple fine-grained observation grid cells.
7. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 8 is as follows: Using the same direction cone division method as in step 4, the spherical space with the center point of each fine-grained observation grid cell obtained in step 7 as the origin is divided into multiple direction cones. Using a higher direction resolution than in step 2, more direction cones with a smaller angle range are obtained. Multiple sampling rays are emitted in each direction cone, and the farthest collision distance of the rays is recorded to obtain a fine-grained line-of-sight field. The specific method for step 9 is as follows: The fine-grained line-of-sight field obtained in step 8 and the visibility relationship between the observation grid and the observed grid obtained in step 6 are serialized into binary format and stream-compressed. All data are stored in multiple files according to spatial location, and the line-of-sight field and visibility information of neighboring observation grids are organized into the same file.
8. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 10 is as follows: Based on the current viewpoint position, pre-calculated data of the relevant area around the viewpoint is loaded from the file stored in step 9. The viewpoint movement trend is monitored, the possible location is predicted, and the file blocks of the relevant area around the viewpoint are prioritized. The file blocks that are more likely to be accessed in the future have higher priority. The file blocks are loaded in order of priority. A lock-free thread synchronization design is used to achieve asynchronous loading, and finally the pre-calculated data of the relevant area of the viewpoint is loaded.
9. The dynamic occlusion removal method based on a structured line-of-sight field according to claim 1, characterized in that, The specific method for step 11 is as follows: The complex object is simplified into a bounding sphere, its direction vector relative to the viewpoint is calculated, the corresponding direction cone is determined, the maximum visible distance in this direction is queried from the pre-calculated data of the viewpoint-related region loaded in step 10, and the pre-calculated visibility relationship between the observation grid where the viewpoint is located and the observed grid where the object is located is queried. The object is then comprehensively judged to determine whether it is occluded.
10. A dynamic occlusion culling system based on a structured line-of-sight field, characterized in that, include: The module consists of a pre-computation module, a runtime module, a visualization module, and a general module, among which: The pre-computation module includes a view distance calculation unit, a mesh visibility calculation unit, and a data compression unit; it is used to implement scene loading, spatial partitioning, view distance field calculation, visibility calculation, data compression and serialization in the pre-computation stage. The visible distance calculation unit is used to perform omnidirectional visible distance sampling on the center point of each coarse-grained observation grid unit to obtain visible distance values in each direction and obtain a coarse-grained visible distance field; and to perform high-precision omnidirectional visible distance sampling on the center point of each fine-grained observation grid unit to obtain a fine-grained visible distance field. The mesh visibility calculation unit is used to pair each observed mesh unit with the observed mesh unit after pruning to calculate the visibility of each observed mesh, and to calculate the visibility relationship between the observed mesh and the observed mesh. The data compression unit is used to compress and optimize the pre-calculated fine-grained field of view and the visibility relationship between the observation grid and the observed grid; The runtime module includes a motion prediction unit, a priority loading unit, and an occlusion query unit; it is used to implement motion prediction, file block priority partitioning and loading, and object occlusion query during the runtime phase. The motion prediction unit is used to monitor the viewpoint's movement status and predict possible movement trajectories. The priority loading unit is used to prioritize file blocks in the relevant area around the viewpoint based on the predicted movement trajectory results, and load the file blocks sequentially. The occlusion query unit is used to determine the visibility of each object in the scene by combining the pre-calculated data and the real-time scene status. The visualization module includes a performance monitoring unit and a basic graphics drawing unit; it is used to visualize intermediate data during program execution into intuitive graphics, facilitating debugging and analysis. The performance monitoring unit monitors the system's operational performance indicators and is used for system debugging and optimization. The basic graphics drawing unit provides basic graphics rendering support for drawing intuitive visualization results, which facilitates debugging and analysis. The general modules include a space partitioning and management unit, a thread management unit, a data management unit, a combined graphics drawing unit, and a ray detection unit; The combined graphics drawing unit: based on basic graphics rendering elements, it improves the drawing and rendering of more complex combined graphics, and is used to draw intuitive visualization results, which are convenient for debugging and analysis; The spatial partitioning and management unit is used for all spatial partitioning-related logic, including dividing the constructed observation space into multiple coarse-grained observation grid units, performing non-uniform adaptive partitioning on the constructed observed space to obtain multiple observed grid units with multi-level sizes, and performing more refined partitioning on the basis of coarse-grained observation grid units to obtain multiple fine-grained observation grid units. The thread management unit is used to implement asynchronous loading and coordinate the data synchronization process of multiple threads. The data management unit is used to serialize the pre-calculated fine-grained field of view and the visibility relationship between the observation grid and the observed grid into binary format, and is also responsible for dynamically loading the pre-calculated data of the viewpoint-related region from the stored file into memory. The ray detection unit encapsulates the ray detection function of the underlying engine and is used to call it during line-of-sight sampling.
Citation Information
Patent Citations
Method and system for removing invisible objects based on GPU (Graphics Processing Unit)
CN119091029A
Shielding object removing method and device, electronic equipment and storage medium
CN119488716A