A gpu-based invisible object culling method and system
By building frustum culling and occlusion culling models on the GPU and utilizing the GPU to calculate the frustum plane equation and hierarchical Z-buffer data, the problem of excessive CPU load is solved, and efficient rendering performance is improved on low-end devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing frustum culling and hierarchical Z-buffered occlusion culling schemes are computationally intensive on CPUs, resulting in excessive CPU load and making it difficult to run efficiently on low-end devices.
A GPU-based invisible object culling method is adopted. By constructing a view frustum culling and occlusion culling model, the GPU is used to calculate the six plane equations of the view frustum and the hierarchical Z-buffer data to cull invisible objects.
This improves rendering efficiency and reduces the CPU's computational burden, enabling the view frustum culling and hierarchical Z-buffered occlusion culling schemes to be more widely used on low-end devices, thus enhancing rendering performance.
Smart Images

Figure CN119091029B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer graphics technology, and in particular relates to a GPU-based method and system for culling invisible objects. Background Technology
[0002] Invisible object culling is a fundamental problem in computer graphics research. Today, users have increasingly higher demands for the visual quality of 3D graphics systems, requiring more and more refined rendering and ensuring real-time interactive experiences even with limited hardware configurations. Therefore, in computer graphics rendering, removing objects that will ultimately be invisible due to occlusion before being rendered by the hardware is an effective optimization method.
[0003] Common methods for culling invisible objects include backface culling, frustum culling, and occlusion culling. Almost all rendering engines have these culling methods built-in. Backface culling removes triangles whose back faces the camera, as it doesn't contribute to the final image generation and is already implemented in the rendering engine; simply enabling the API is sufficient. Frustum culling removes models outside the view frustum of the camera. This typically involves aligning the object's axis with the bounding box and detecting it against the frustum. The method then performs a dot product between the normal vectors of the six plane equations of the frustum and the coordinates of the bounding box vertices. If the dot product of the bounding box vertex coordinates and a plane equation is positive or negative, the object is not inside the frustum. Occlusion culling aims to exclude objects that become invisible due to occlusion from subsequent processing. Several main techniques are used to achieve this, including latent visibility set methods, occlusion lookup methods, and hierarchical Z-buffers.
[0004] Traditional hierarchical Z-buffer schemes divide the space using an octree and generate a hierarchical Z-buffer structure, also known as a Z-pyramid, by downsampling the Z-buffer values. Object culling can be performed hierarchically from low to high resolution for occlusion query and culling, which is more efficient than directly comparing the highest resolution depth map.
[0005] However, a major problem with the aforementioned frustum culling and hierarchical Z-buffer culling is the high computational cost on the CPU, placing an excessive burden on it. Existing solutions for optimizing computation include using data structures to speed up the process and pre-calculating some data to reduce real-time overhead, but the results are still not ideal. They still consume significant performance on low-end platforms.
[0006] Therefore, in order to make the frustum culling and hierarchical Z-buffered occlusion culling schemes more widely used, there is a need for a high-efficiency computing method to improve culling efficiency, reduce the burden on the CPU, and enable low-end devices to run the above culling methods faster. Summary of the Invention
[0007] To address the shortcomings of existing technologies, this invention provides a GPU-based method and system for culling invisible objects. The system includes two modules: view frustum culling and occlusion culling. The technical solution of this invention is achieved through the following:
[0008] A first aspect of the present invention: a GPU-based method for culling invisible objects, the method comprising the following steps:
[0009] (1) Model construction: Construct an invisible object culling model, which includes two parts: view frustum culling and occlusion culling;
[0010] (2) View frustum culling: Calculate the equations of the six planes of the view frustum defined by the observation camera and the position of each observed object in the world coordinate system; by analyzing the spatial relationship between the coordinate position of each object and each view frustum plane, that is, determine whether the coordinate point is located in the positive or negative direction of each plane; if the object is located in the positive or negative direction of all relevant planes, it is confirmed that it is outside the view frustum and is culled from the rendering queue.
[0011] (3) Occlusion culling: Generate hierarchical Z-buffer data in the GPU using the depth map of the current frame, and pass the bounding box information and coordinate information of the object to the GPU for calculation with the hierarchical Z-buffer data. Remove the completely occluded object from the rendering queue.
[0012] Furthermore, the specific method for obtaining the six plane equations of the view cone in step (2) is as follows:
[0013] (2.1) Obtain the coordinates of points on the near and far planes of the view frustum;
[0014] (2.2) Obtain the shooting vector of the observation camera;
[0015] (2.3) Using the shooting vector obtained in step (2.2) and the coordinates of the near and far planes obtained in step (1), the equations of the near and far planes are obtained using the formulas for calculating normal vectors and points. The calculation formulas are as follows:
[0016] n x x+n y y+n z z-(n x x0+n y y0+n z z0) = 0;
[0017] Where x, y, z represent variables of the plane; n x ,n y ,n zThis represents the shooting vector of the observation camera, where x0, y0, and z0 represent the position coordinates of a point on the near or far plane.
[0018] (2.4) Using the coordinates of the four points on the far plane of the view frustum and the camera coordinates, the normal vector of the plane containing the three points is obtained by using the cross product formula. Then, using the normal vector and a coordinate, the equations of the planes up, down, left, and right are obtained by using the formula in step (3.3). The formula for calculating the normal vector n is as follows:
[0019]
[0020] Where a x ,a y ,a z b x ,b y ,b z c x ,c y ,c z The three coordinates representing the plane, For a x ,a y ,a z b x ,b y ,b z The vector formed by the two coordinates For a x ,a y ,a z c x ,c y ,c z The vector formed by the two coordinates, where n is the normal vector.
[0021] Further, step (2) analyzes the spatial relationship between the coordinate position of each object and each view frustum plane, that is, to determine whether the coordinate point is located in the positive or negative direction of each plane, specifically:
[0022] (3.1) Obtain the bounding box information of the object by using the object's own coordinate information and the object's size;
[0023] (3.2) Transform the coordinates of the eight vertices of the bounding box from their own coordinates to world coordinates;
[0024] (3.3) Perform a dot product between the normal vectors of the six plane equations of the view frustum and the coordinates of the bounding box vertices. If the dot product information of the bounding box vertex coordinates and a certain plane equation is positive or negative, it means that the object is not inside the view frustum.
[0025] Specifically, the depth map of the current frame in step (3) is obtained during the rasterization stage in the rendering pipeline, and is the depth of the mesh of the opaque object at the corresponding pixel calculated by the GPU, with a value ranging from 0 to 1 as a floating-point number.
[0026] Specifically, step (3) generates hierarchical Z-buffer data as hierarchical depth map data obtained by downsampling the depth map of the current frame. Taking the depth map of the current frame as the initial, the depth value with the largest pixel depth of 2*2 is taken as the sampling value each time, and so on, until downsampling can no longer be continued.
[0027] Furthermore, in step (3), the bounding box information and coordinate information of the object are passed to the GPU for calculation with the hierarchical Z-buffer data, specifically as follows:
[0028] (3.1) Calculate the depth value of the object using the bounding box coordinate information;
[0029] (3.2) Obtain the range of pixels covered by the object on the screen using the object bounding box coordinate information;
[0030] (3.3) Compare the object depth value with the depth map of the corresponding level. If the depth value is greater than the depth value of the depth map position, it means that the object is occluded and the object is removed from the rendering queue.
[0031] Further, in step (3.1), the depth value of the object is calculated using the object's bounding box coordinate information, specifically as follows:
[0032] (3.1.1) Calculate the coordinate values of each vertex of the object's bounding box in the normalized device coordinate space;
[0033] (3.1.2) Regenerate the coordinate axis parallel bounding box using the normalized device coordinates of the bounding box vertices;
[0034] (3.1.3) Find the plane that is closer to the object with the normal to the observation coordinate system. The Z value of the plane is the depth value of the object.
[0035] Further, in step (3.2), the range of pixel areas covered by the object on the screen is obtained through the object's bounding box coordinate information, specifically as follows:
[0036] (3.2.1) The plane that is closer to the observation coordinate system as the normal is found in step (3.1.3) above. Its area is calculated so that the size of the pixel area occupied by the plane in the normalized device coordinate space can be obtained.
[0037] (3.2.2) Multiply the size by the initial resolution of the image to obtain the screen pixel area covered by the original coordinate axis parallel bounding box.
[0038] A second aspect of the present invention provides a GPU-based system for culling invisible objects, the system comprising the following modules:
[0039] Model building module: Constructs an invisible object culling model, which includes two parts: view frustum culling and occlusion culling;
[0040] View frustum culling module: Calculates the equations of the six planes of the view frustum defined by the observation camera and the position of each observed object in the world coordinate system; by analyzing the spatial relationship of each object's coordinate position relative to each view frustum plane, that is, determining whether the coordinate point is located in the positive or negative direction of each plane; if the object is located in the positive or negative direction with respect to all relevant planes, it is confirmed that it is outside the view frustum and is culled from the rendering queue.
[0041] Occlusion culling module: Generates hierarchical Z-buffer data in the GPU using the depth map of the current frame, and passes the bounding box information and coordinate information of the object to the GPU for calculation with the hierarchical Z-buffer data, and removes the completely occluded object from the rendering queue.
[0042] The beneficial effects of this invention are as follows:
[0043] This system uses the GPU to quickly cullate invisible objects within the view camera's field of view in real-time rendering scenes. This improves rendering efficiency, reduces the CPU's computational burden, and enables the wider application of frustum culling and hierarchical Z-buffer occlusion culling schemes.
[0044] This system and rendering process can be used in CPU-intensive rendering applications, such as city tour applications and game clients. This is because each frame requires the execution of physical and animation calculations for complex models such as characters, as well as related special effects and business logic, which incurs significant overhead. Therefore, the efficient parallel computing performance of the GPU can be used to quickly remove objects that are not visible to the observation camera, thereby improving performance. Attached Figure Description
[0045] The accompanying drawings are incorporated into and form part of this specification, illustrating how the various modules involved in the invention are implemented in accordance with the principles of the invention. The focus of the drawings is not limitation, but rather to explain the principles of the invention. In the drawings,
[0046] Figure 1 This is an execution flowchart of each module of the invisible object culling system of the present invention;
[0047] Figure 2 This is a schematic diagram of the object to be rendered after using frustum culling according to the present invention;
[0048] Figure 3This is a schematic diagram of the generation of hierarchical Z-buffer data based on the depth map according to the present invention;
[0049] Figure 4 This is a schematic diagram of the object to be rendered after occlusion culling according to the present invention;
[0050] Figure 5 This is a schematic diagram of the system flow of the present invention. Detailed Implementation
[0051] The following detailed description, relating to the accompanying drawings, will set forth specific details of one embodiment to provide a full understanding of the various aspects of the claimed invention. It will be apparent to those skilled in the art that other embodiments, different from the specific details described below, may be employed to implement certain modules and systems of the invention. The following description is intended for explanation rather than limitation. Any modifications, equivalent substitutions, etc., made within the spirit and principles of the invention should be included within the scope of protection of the invention.
[0052] According to the present invention, the modules and processes of the designed invisible object culling system are as follows: Figure 1 As shown. We will apply this solution to an online game. The specific solution is as follows:
[0053] A GPU-based method for culling invisible objects, comprising the following steps:
[0054] (1) Model construction: Construct an invisible object culling model, which includes two parts: view frustum culling and occlusion culling;
[0055] (2) View frustum culling: Calculate the equations of the six planes of the view frustum defined by the observation camera and the position of each observed object in the world coordinate system; analyze the spatial relationship of each object's coordinate position relative to each view frustum plane, i.e., determine whether the coordinate point is located in the positive or negative direction of each plane; if the object is located in the positive or negative direction with respect to all relevant planes, it is confirmed that it is outside the view frustum and is culled from the rendering queue; the specific method for obtaining the equations of the six planes of the view frustum is as follows:
[0056] (2.1) Obtain the coordinates of points on the near and far planes of the view frustum;
[0057] (2.2) Obtain the shooting vector of the observation camera;
[0058] (2.3) Using the shooting vector obtained in step (2.2) and the coordinates of the near and far planes obtained in step (1), the equations of the near and far planes are obtained using the formulas for calculating normal vectors and points. The calculation formulas are as follows:
[0059] n x x+n y y+n zz-(n x x0+n y y0+n z z0) = 0;
[0060] Where x, y, z represent variables of the plane; n x ,n y ,n z This represents the shooting vector of the observation camera, where x0, y0, and z0 represent the position coordinates of a point on the near or far plane.
[0061] (2.4) Using the coordinates of the four points on the far plane of the view frustum and the camera coordinates, the normal vector of the plane containing the three points is obtained by using the cross product formula. Then, using the normal vector and a coordinate, the equations of the planes up, down, left, and right are obtained by using the formula in step (3.3). The formula for calculating the normal vector n is as follows:
[0062]
[0063] Where a x ,a y ,a z b x ,b y ,b z c x ,c y ,c z The three coordinates representing the plane, For a x ,a y ,a z b x ,b y ,b z The vector formed by the two coordinates For a x ,a y ,a z c x ,c y ,c z The vector formed by the two coordinates, where n is the normal vector.
[0064] The analysis of the spatial relationship between the coordinate position of each object and each view frustum plane, that is, determining whether the coordinate point is located in the positive or negative direction of each plane, specifically involves:
[0065] (3.1) Obtain the bounding box information of the object by using the object's own coordinate information and the object's size;
[0066] (3.2) Transform the coordinates of the eight vertices of the bounding box from their own coordinates to world coordinates;
[0067] (3.3) Perform a dot product between the normal vectors of the six plane equations of the view frustum and the coordinates of the bounding box vertices. If the dot product information of the bounding box vertex coordinates and a certain plane equation is positive or negative, it means that the object is not inside the view frustum.
[0068] (3) Occlusion Culling: Hierarchical Z-buffer data is generated in the GPU using the depth map of the current frame. The bounding box information and coordinate information of the objects are passed to the GPU for calculation with the hierarchical Z-buffer data. Objects that are completely occluded are culled from the rendering queue. Specifically, the bounding box information and coordinate information of the objects are passed to the GPU for calculation with the hierarchical Z-buffer data as follows:
[0069] (3.1) Calculate the depth value of the object using its bounding box coordinates; specifically:
[0070] (3.1.1) Calculate the coordinate values of each vertex of the object's bounding box in the normalized device coordinate space;
[0071] (3.1.2) Regenerate the coordinate axis parallel bounding box using the normalized device coordinates of the bounding box vertices;
[0072] (3.1.3) Find the plane that is closer to the object with the normal to the observation coordinate system. The Z value of the plane is the depth value of the object.
[0073] (3.2) Obtain the pixel area covered by the object on the screen using the object's bounding box coordinates; specifically:
[0074] (3.2.1) The plane that is closer to the observation coordinate system as the normal is found in step (3.1.3) above. Its area is calculated so that the size of the pixel area occupied by the plane in the normalized device coordinate space can be obtained.
[0075] (3.2.2) Multiply the size by the initial resolution of the image to obtain the screen pixel area covered by the original coordinate axis parallel bounding box.
[0076] (3.3) Compare the object depth value with the depth map of the corresponding level. If the depth value is greater than the depth value of the depth map position, it means that the object is occluded and the object is removed from the rendering queue.
[0077] like Figure 1As shown, for a 3D scene, firstly, based on the viewing angle and camera coordinates of the camera, the equations of the near and far planes are obtained using the formula for calculating the normal vector and the point. Then, using the coordinates of the four points on the far plane of the view frustum and the camera coordinates, the normal vector of the plane containing the three points is obtained using the cross product formula. Finally, using the normal vector and a coordinate, the equations of the up, down, left, and right planes are obtained, thus determining the six plane equations of the view frustum. Next, the spatial relationship between the observed objects in the scene and each view frustum plane is analyzed, i.e., determining whether the coordinate points are located in the positive (front) or negative (back) direction of each plane. The six plane coordinate equations and the object's coordinate information are input into the GPU for parallel computation. The bounding box information of the object is obtained using the object's own coordinate information and size. The coordinates of the eight vertices of the bounding box are transformed from their own coordinates to world coordinates. The dot product of the normal vectors of the six plane equations of the view frustum and the coordinates of the bounding box vertices is performed. If the dot product of the bounding box vertex coordinates with a certain plane equation is positive or negative, it means that the object is not inside the view frustum. The object is removed from the rendering queue, retaining only the information of the objects that need to be rendered, such as... Figure 2 As shown, the dashed objects are those that are removed from the view frustum.
[0078] Based on the preserved objects, occlusion culling continues in the GPU. During the rasterization stage of the rendering pipeline, a custom rendering step using the Command Buffer obtains the depth map of the current frame, which is the depth of the mesh of opaque objects at the corresponding pixels calculated by the GPU, a floating-point number ranging from 0 to 1. This depth map is used as the highest resolution hierarchical Z-buffer level. The hierarchical depth map data obtained by downsampling the current frame's depth map is used as the initial depth map. Using the current frame's depth map as the initial value, the maximum depth value of a 2x2 pixel depth is taken as the sample value each time, and so on, until downsampling can no longer be performed. Figure 3 As shown. After obtaining the hierarchical Z-buffer data, the depth information of each retained object after frustum culling is calculated. The coordinates of each vertex of the object's bounding box in the normalized device coordinate space are calculated. Using the normalized device coordinates of the bounding box vertices, a new coordinate axis parallel bounding box is generated. The plane with the view coordinate system as its normal is found, and the Z-value of this plane is the depth value of the object. Using the object's bounding box coordinate information, i.e., the lower left and upper right corners of the plane with the view coordinate system as its normal, the size of the pixel area occupied by this plane in the normalized device coordinate space can be obtained. This area size is multiplied by the initial resolution of the image to obtain the screen pixel area originally covered by the coordinate axis parallel bounding box. This is taken as the range of pixel area covered by the object on the screen. The above information is compared with the depth map of the corresponding level. If the depth value is greater than the depth of the location on the depth map, it means that the object is occluded, and the object is culled from the rendering queue. The final result may be as follows. Figure 4 As shown, the dashed objects are objects that have been culled because they are obscured by other objects.
[0079] In addition, such as Figure 5 As shown, the present invention also provides a GPU-based invisible object culling system, which includes the following modules:
[0080] Model building module: Constructs an invisible object culling model, which includes two parts: view frustum culling and occlusion culling;
[0081] The frustum culling module calculates the equations of the six planes of the view frustum defined by the observation camera and the position of each observed object in the world coordinate system. It analyzes the spatial relationship of each object's coordinate position relative to each view frustum plane, determining whether the coordinate point is located in the positive (front) or negative (back) direction of each plane. If an object is located in the positive or negative direction with respect to all relevant planes, it is confirmed to be outside the view frustum and is culled from the rendering queue.
[0082] Occlusion culling module: Generates hierarchical Z-buffer data in the GPU using the depth map of the current frame, and passes the object's position and other information to the GPU for calculation with the hierarchical Z-buffer data, culling objects that are completely occluded from the rendering queue.
[0083] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.
Claims
1. A GPU-based method for culling invisible objects, characterized in that, The method includes the following steps: (1) Model construction: Construct an invisible object culling model, which includes two parts: view frustum culling and occlusion culling; and both are executed in parallel within the GPU; (2) View frustum culling: The GPU performs parallel computation of the equations of the six planes of the view frustum defined by the observation camera and the position of each observed object in the world coordinate system; by analyzing the spatial relationship of each object's coordinate position relative to each view frustum plane, that is, determining whether the coordinate point is located in the positive or negative direction of each plane; if the object is located in the positive or negative direction with respect to all relevant planes, it is confirmed that it is outside the view frustum and is culled from the rendering queue; the analysis of the spatial relationship of each object's coordinate position relative to each view frustum plane, that is, determining whether the coordinate point is located in the positive or negative direction of each plane, specifically: The bounding box information of an object is obtained by using its own coordinate information and its size. Transform the coordinates of the eight vertices of the bounding box from their own coordinates to world coordinates; The dot product is performed between the normal vectors of the six plane equations of the view frustum and the coordinates of the bounding box vertices. If the dot product information of the bounding box vertex coordinates and a certain plane equation is positive or negative, it means that the object is not inside the view frustum. (3) Occlusion culling: Based on the real-time depth map generated by the GPU during the rasterization stage of the current frame, hierarchical Z-buffer data is generated in the GPU using the depth map of the current frame, and the bounding box information and coordinate information of the object are passed to the GPU and calculated with the hierarchical Z-buffer data. The completely occluded object is removed from the rendering queue; the depth map of the current frame is obtained during the rasterization stage in the rendering pipeline, and the depth of the mesh of the opaque object at the corresponding pixel is calculated by the GPU, with a value range of 0 to 1 floating-point number; the GPU hierarchical Z-buffer data is read, and each thread compares the depth values of 2*2 pixels at the same time.
2. The GPU-based method for culling invisible objects according to claim 1, characterized in that, The specific method for obtaining the six plane equations of the view cone in step (2) is as follows: (2.1) Obtain the coordinates of points on the near and far planes of the viewing cone; (2.2) Obtain the shooting vector of the observation camera; (2.3) Using the shooting vector obtained in step (2.2) and the coordinates of the near and far planes obtained in step (1), the equations of the near and far planes are obtained using the formulas for calculating normal vectors and points. The calculation formulas are as follows: ; in Variables representing a plane; This represents the shooting vector of the observing camera. Represents the position coordinates of a point on the near or far plane; (2.4) Using the coordinates of the four points on the far plane of the view frustum and the camera coordinates, obtain the normal vector of the plane containing the three points using the cross product formula. Then, using the normal vector and a coordinate, obtain the plane equations for up, down, left, and right using the formula in step (3.3). The calculation formula is as follows: ; ; ; in , , The three coordinates representing the plane, for , The vector formed by the two coordinates for , The vector formed by the two coordinates It is the normal vector.
3. The GPU-based invisible object culling method according to claim 1, characterized in that, The step (3) generates hierarchical Z-buffer data, which is the hierarchical depth map data obtained by downsampling the depth map of the current frame. Taking the depth map of the current frame as the initial, the current downsampled depth map is used, and the maximum depth c value of the 2*2 pixel depth is taken as the sampling value each time, and so on, until downsampling can no longer be continued.
4. The GPU-based invisible object culling method according to claim 1, characterized in that, In step (3), the bounding box information and coordinate information of the object are passed to the GPU for calculation with the hierarchical Z-buffer data, specifically as follows: (3.1) Calculate the depth value of the object using the bounding box coordinate information; (3.2) Obtain the range of pixels covered by the object on the screen using the object bounding box coordinate information; (3.3) Compare the object depth value with the depth map of the corresponding level. If the depth value is greater than the depth value of the depth map position, it means that the object is occluded and the object is removed from the rendering queue.
5. The GPU-based invisible object culling method according to claim 4, characterized in that, In step (3.1), the depth value of the object is calculated using the object's bounding box coordinate information, specifically as follows: (3.1.1) Calculate the coordinates of each vertex of the object's bounding box in the normalized device coordinate space; (3.1.2) Regenerate the coordinate axis parallel bounding box using the normalized device coordinates of the bounding box vertices; (3.1.3) Find the plane that is closer to the object with the normal to the observation coordinate system. The Z value of the plane is the depth value of the object.
6. The GPU-based method for culling invisible objects according to claim 4, characterized in that, In step (3.2), the range of pixel areas covered by the object on the screen is obtained through the object's bounding box coordinate information, specifically as follows: (3.2.1) The plane that is closer to the observation coordinate system as the normal is found in step (3.1.3) above. Its area is calculated to obtain the size of the pixel area occupied by the plane in the normalized device coordinate space. (3.2.2) Multiply the size by the initial resolution of the image to obtain the screen pixel area covered by the original coordinate axis parallel bounding box.
7. A GPU-based system for culling invisible objects, characterized in that, The system includes the following modules: Model building module: Constructs an invisible object culling model, which includes two parts: view frustum culling and occlusion culling; both are executed in parallel within the GPU; The frustum culling module uses GPU parallel computation to observe the equations of the six planes of the frustum defined by the camera and the position of each observed object in the world coordinate system. It analyzes the spatial relationship of each object's coordinate position relative to each frustum plane, i.e., determining whether the coordinate point is located in the positive or negative direction of each plane. If an object is located in the positive or negative direction with respect to all relevant planes, it is confirmed to be outside the frustum and culled from the rendering queue. Specifically, the analysis of the spatial relationship of each object's coordinate position relative to each frustum plane, i.e., determining whether the coordinate point is located in the positive or negative direction of each plane, involves: The bounding box information of an object is obtained by using its own coordinate information and its size. Transform the coordinates of the eight vertices of the bounding box from their own coordinates to world coordinates; The dot product is performed between the normal vectors of the six plane equations of the view frustum and the coordinates of the bounding box vertices. If the dot product information of the bounding box vertex coordinates and a certain plane equation is positive or negative, it means that the object is not inside the view frustum. Occlusion culling module: Based on the real-time depth map generated by the GPU during the rasterization stage of the current frame, hierarchical Z-buffer data is generated in the GPU using the depth map of the current frame. The bounding box information and coordinate information of the object are passed to the GPU and calculated with the hierarchical Z-buffer data. Objects that are completely occluded are removed from the rendering queue. The depth map of the current frame is obtained during the rasterization stage in the rendering pipeline. It is the depth of the mesh of the opaque object at the corresponding pixel calculated by the GPU, and the value is a floating-point number ranging from 0 to 1. The GPU hierarchical Z-buffer data is read, and each thread compares the depth values of 2*2 pixels simultaneously.
Citation Information
Patent Citations
Data driving method and device for mapping delay rendering
CN112614042A