3D Object Culling Method, Device and Storage Medium Based on Visual Contribution Degree
Through the three-dimensional object removal method based on visual contribution, the octree algorithm and node weights are used to calculate the visual contribution degree, and unnecessary rendering nodes are eliminated, which solves the problems of inaccurate results and large calculations in the existing technology, and achieves efficient and accurate three-dimensional object removal.
Patent Information
- Application Number
- CN202510413987.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-04-03
AI Technical Summary
Among the existing three-dimensional object removal methods, the cone removal method has a low accuracy and the calculation amount of the occlusion removal method is large, resulting in inaccurate removal results and wasted computing resources.
Using a method based on visual contribution, a rendering model tree is generated through the octree algorithm, and the visual contribution is calculated using node weights and projection parameters to eliminate rendering nodes that do not meet the threshold.
It improves the accuracy of 3D object removal, reduces computing resource consumption, and improves rendering efficiency.
Smart Images

Figure CN119942000B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of visual rendering, and particularly to a three-dimensional object culling method, device, and storage medium based on visual contribution degree. Background Art
[0002] Currently, before rendering three-dimensional objects, in order to further exclude invisible objects or objects that do not contribute to the final rendering result, reduce unnecessary consumption of computing resources, and improve rendering efficiency, it is necessary to first cull three-dimensional objects.
[0003] Existing three-dimensional object culling methods include frustum culling methods and occlusion culling methods, etc. However, the above existing three-dimensional object culling methods all have certain defects. For example, frustum culling methods usually use bounding boxes or bounding spheres to represent the spatial range of three-dimensional objects, but simple geometric shapes such as bounding boxes or bounding spheres may not be able to accurately match the actual shape of three-dimensional objects. If the difference between the bounding box or bounding sphere and the actual shape of the three-dimensional object is large, it may lead to inaccurate culling results (for example, the culling is not fine enough, there are a large number of objects that need to be culled but are not culled. That is, missed culling). Another example is that the core of the occlusion culling method is to judge whether a three-dimensional object is completely occluded by other objects through depth buffering or hardware occlusion queries. When judging whether a three-dimensional object is occluded by comparing the depth value of the three-dimensional object with the value in the depth buffer, it is necessary to perform depth testing on each pixel, and the calculation amount is large.
[0004] The publication number is CN119379880A, and the name is Three-Dimensional Data Visualization Rendering Method and Visualization Rendering Engine System. The method includes: using the LOD technology to perform spatial segmentation processing on the three-dimensional model data to be rendered to generate block slice data with different geometric detail levels, organizing the block slice data through a tree structure with spatial relationships, and outputting the tree structure as an index file; adaptively screening block slice data with different detail levels based on the user's viewing range and storing them in the rendering request queue, querying the block slice data to be rendered from the rendering request queue according to the index coding of the block slice data, and updating the layer class browser database; batch-parallel downloading and parsing the block slice data to be rendered by adopting a separate collaborative operation mode, and executing the rendering task according to the data parsing result, so as to significantly improve the rendering scheduling frame rate and realize the rapid visualization of a large amount of urban three-dimensional slice data on the web side.
[0005] The publication number is CN116129022A, and the name is a high-density three-dimensional scene rendering method, device, equipment and storage medium. Before the GPU renders a high-density three-dimensional scene, it first screens multiple potential three-dimensional rendering bodies in the high-density three-dimensional scene. When screening, N potential three-dimensional rendering bodies with the largest balance degree are selected from multiple potential three-dimensional rendering bodies according to the bounding box information corresponding to the potential three-dimensional rendering bodies as balanced rendering bodies. Based on the N balanced rendering bodies, the occluded three-dimensional rendering bodies among the remaining potential three-dimensional rendering bodies are removed to obtain the first three-dimensional rendering body, and the high-density three-dimensional scene is rendered based on the N balanced rendering bodies and the first three-dimensional rendering body.
[0006] In view of the technical problems in the above-mentioned existing technologies that when using the frustum culling method to cull three-dimensional objects, the accuracy of the culling result is relatively low; when using the occlusion culling method to cull three-dimensional objects, the computational complexity is relatively large, no effective solution has been proposed yet. Summary of the Invention
[0007] Embodiments of the present disclosure provide a three-dimensional object culling method, device and storage medium based on visual contribution degree, so as to at least solve the technical problems in the existing technologies that when using the frustum culling method to cull three-dimensional objects, the accuracy of the culling result is relatively low; when using the occlusion culling method to cull three-dimensional objects, the computational complexity is relatively large.
[0008] According to one aspect of the embodiments of the present disclosure, a three-dimensional object culling method based on visual contribution degree is provided, including: determining a product structure tree corresponding to a target three-dimensional object, and using an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; automatically generating node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree; pre-culling a list of first rendering nodes and generating a list of second rendering nodes, where the list of first rendering nodes includes a plurality of first rendering nodes, and the list of second rendering nodes includes a plurality of second rendering nodes; calculating the visual contribution degree corresponding to each second rendering node respectively according to the projection height corresponding to the target three-dimensional object of each second rendering node, the projection height threshold, the projection width corresponding to the target three-dimensional object of each second rendering node, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each second rendering node, and using the node weight corresponding to each second rendering node; and judging the magnitude relationship between the visual contribution degree corresponding to each second rendering node and a preset first threshold, and removing the corresponding second rendering node when the visual contribution degree is less than the first threshold, where the first threshold represents the visual contribution degree threshold.
[0009] According to another aspect of the embodiments of the present disclosure, there is also provided a storage medium, the storage medium including a stored program, wherein the method described in any one of the above is executed by a processor when the program runs.
[0010] According to another aspect of the embodiments of the present disclosure, there is also provided a three-dimensional object culling device based on visual contribution degree, including: a rendering model tree generation module, configured to determine a product structure tree corresponding to a target three-dimensional object, and perform spatial partitioning on the product structure tree by using an octree algorithm to generate a rendering model tree, wherein the target three-dimensional object is used to indicate a three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; a node weight generation module, configured to automatically generate node weights corresponding to the respective first rendering nodes based on the hierarchical depths of the respective nodes in the product structure tree; a first culling module, configured to perform pre-culling on a first rendering node list and generate a second rendering node list, wherein the first rendering node list includes a plurality of first rendering nodes, and the second rendering node list includes a plurality of second rendering nodes; a visual contribution degree calculation module, configured to calculate the visual contribution degrees corresponding to the respective second rendering nodes respectively according to the projection height corresponding to the target three-dimensional object of each second rendering node, a projection height threshold, the projection width corresponding to the target three-dimensional object of each second rendering node, a projection width threshold, and the projection area corresponding to the target three-dimensional object of each second rendering node, and by using the node weights corresponding to the respective second rendering nodes; and a second culling module, configured to judge the magnitude relationship between the visual contribution degree corresponding to each second rendering node and a preset first threshold, and cull the corresponding second rendering node when the visual contribution degree is less than the first threshold, wherein the first threshold represents a visual contribution degree threshold.
[0011] According to another aspect of the embodiments of the present disclosure, there is also provided a three-dimensional object culling device based on visual contribution degree, including: a processor; and a memory connected to the processor for providing instructions for the processor to process the following processing steps: determining a product structure tree corresponding to a target three-dimensional object, and using an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; automatically generating node weights corresponding to each of the first rendering nodes based on the hierarchical depths of the respective nodes in the product structure tree; performing pre-culling on the first rendering node list and generating a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes and the second rendering node list includes a plurality of second rendering nodes; calculating the visual contribution degree corresponding to each of the second rendering nodes respectively according to the projection height corresponding to the target three-dimensional object of each of the second rendering nodes, the projection height threshold, the projection width corresponding to the target three-dimensional object of each of the second rendering nodes, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each of the second rendering nodes, and using the node weights corresponding to each of the second rendering nodes; and judging the magnitude relationship between the visual contribution degree corresponding to each of the second rendering nodes and a preset first threshold, and culling the corresponding second rendering node when the visual contribution degree is less than the first threshold, where the first threshold represents the visual contribution degree threshold.
[0012] This application provides a method for culling three-dimensional objects based on visual contribution degree. First, the processor determines a product structure tree corresponding to a target three-dimensional object, and uses an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree. Then, the processor automatically generates node weights corresponding to each of the first rendering nodes based on the hierarchical depths of the respective nodes in the product structure tree. Further, the processor performs pre-culling on the first rendering node list and generates a second rendering node list. After that, the processor calculates the visual contribution degree corresponding to each of the second rendering nodes respectively according to the projection height corresponding to the target three-dimensional object of each of the second rendering nodes, the projection height threshold, the projection width corresponding to the target three-dimensional object of each of the second rendering nodes, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each of the second rendering nodes, and uses the node weights corresponding to each of the second rendering nodes. Finally, the processor judges the magnitude relationship between the visual contribution degree corresponding to each of the second rendering nodes and a preset first threshold, and culls the corresponding second rendering node when the visual contribution degree is less than the first threshold.
[0013] As can be seen from the above description, in the case where the present application first generates a corresponding product structure tree based on a target three-dimensional object, the octree algorithm is further used and based on the product structure tree, a rendering model tree is generated. And in the case of generating the rendering model tree, the first rendering node list (including a plurality of first rendering nodes) in the rendering model tree is pre-culled in advance, and a second rendering node list (including a plurality of second rendering nodes) is generated. Thus, in this process, the first rendering nodes that are not displayed in the rendering model tree, the first rendering nodes that do not meet the tile geometry error threshold, and the first rendering nodes that are not within the rendering range can be culled, thereby greatly reducing the resources required for calculating the visual contribution degrees corresponding to each rendering node subsequently and improving the calculation efficiency.
[0014] Further, in the case of pre-culling the first rendering node list and generating the second rendering node list, the node weights corresponding to each second rendering node can be determined based on the pre-determined node weights corresponding to each first rendering node, so as to calculate the visual contribution degrees corresponding to each second rendering node respectively. Then, based on the visual contribution degrees corresponding to each second rendering node and the pre-set visual contribution degree threshold, the second rendering nodes to be culled can be determined. Thus, in this process, the second rendering nodes with visual contribution degrees less than the pre-set visual contribution degree threshold are culled, and the second rendering nodes with visual contribution degrees greater than the pre-set visual contribution degree threshold are retained, and thus the technical effect of accurately culling the target three-dimensional object can be achieved.
[0015] Furthermore, it solves the technical problems in the prior art that when using the frustum culling method to cull three-dimensional objects, the accuracy of the culling result is relatively low; when using the occlusion culling method to cull three-dimensional objects, the amount of calculation is relatively large. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present disclosure, and constitute a part of this application. The illustrative embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation to the present disclosure. In the drawings:
[0017] Figure 1 is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of the present application;
[0018] Figure 2 is a schematic diagram of a three-dimensional object culling system based on visual contribution degree according to Embodiment 1 of the present application;
[0019] Figure 3 is a flow schematic diagram of a three-dimensional object culling method based on visual contribution degree according to Embodiment 1 of the present application;
[0020] Figure 4It is a schematic diagram of a product structure tree corresponding to a target three-dimensional object according to Embodiment 1 of the present application;
[0021] Figure 5 It is a schematic diagram of the product structure tree and the rendering model tree corresponding to the product structure tree according to Embodiment 1 of the present application;
[0022] Figure 6 It is a schematic diagram of a three-dimensional object culling device based on visual contribution degree according to Embodiment 2 of the present application;
[0023] Figure 7 It is a schematic diagram of a three-dimensional object culling device based on visual contribution degree according to Embodiment 3 of the present disclosure. Detailed implementation manners
[0024] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present disclosure described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment 1
[0027] According to this embodiment, a method embodiment for culling three-dimensional objects based on visual contribution degree is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0028] The method embodiment provided in this embodiment can be executed on a mobile terminal, a computer terminal, a server or a similar computing device. Figure 1The hardware structure block diagram of a computing device for implementing a three-dimensional object culling method based on visual contribution degree is shown. As Figure 1 shown, the computing device may include one or more processors (the processors may include, but are not limited to, processing devices such as microprocessor MCUs or programmable logic devices FPGAs), a memory for storing data, a transmission device for communication functions, and an input / output interface. Among them, the memory, the transmission device, and the input / output interface are connected to the processor through a bus. In addition, it may further include: a display, a keyboard, and a cursor control device connected to the input / output interface. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computing device may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.
[0029] It should be noted that the above one or more processors and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit may be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computing device. As involved in the embodiments of the present disclosure, the data processing circuit is a kind of processor control (such as the selection of a variable resistance terminal path connected to an interface).
[0030] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage devices corresponding to the three-dimensional object culling method based on visual contribution degree in the embodiments of the present disclosure. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the three-dimensional object culling method of the above application program. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely disposed relative to the processor, and these remote memories may be connected to the computing device through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0031] The transmission device is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a computing device. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0032] The display can be, for example, a touch-screen Liquid Crystal Display (LCD), which enables users to interact with the user interface of the computing device.
[0033] It should be noted here that in some alternative embodiments, the above Figure 1 illustrated computing device may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. It should be pointed out that Figure 1 is only an example of a specific concrete instance and is intended to illustrate the types of components that may exist in the above-mentioned computing device.
[0034] Figure 2 is a schematic diagram of a three-dimensional object culling system based on visual contribution according to the present embodiment. Referring to Figure 2 as shown, the system includes: a terminal device 100 and a processor 200 communicatively connected to the terminal device 100. Among them, the user can send a target three-dimensional object (i.e., the three-dimensional object to be culled) to the processor 200 through the terminal device 100.
[0035] Among them, when the processor 200 receives the target three-dimensional object, it first uses the octree algorithm and the product structure tree corresponding to the target three-dimensional object to generate a rendering model tree, and automatically generates node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree. The processor 200 performs pre-culling on the first rendering node list and generates a second rendering node list. In addition, the processor 200 is also used to calculate the visual contribution corresponding to each second rendering node, and judge the size relationship between the visual contribution corresponding to each second rendering node and a preset first threshold (i.e., the visual contribution threshold), so as to cull the second rendering nodes with visual contributions less than the first threshold.
[0036] It should be noted that both the terminal device 100 and the processor 200 in the system can apply the above-mentioned hardware structure.
[0037] Under the above operating environment, according to the first aspect of this embodiment, a three-dimensional object culling method based on visual contribution is provided. This method is implemented by the Figure 2 processor 200 shown in Figure 3 FIG. shows a schematic flow diagram of this method. Refer to Figure 3 shown, this method includes:
[0038] S302: Determine the product structure tree corresponding to the target three-dimensional object, and use the octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths;
[0039] S304: Automatically generate node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree;
[0040] S306: Perform pre-culling on the first rendering node list and generate a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes, and the second rendering node list includes a plurality of second rendering nodes;
[0041] S308: According to the projection height, projection height threshold, projection width, projection width threshold, and projection area corresponding to the target three-dimensional object of each second rendering node, and use the node weight corresponding to each second rendering node to calculate the visual contribution corresponding to each second rendering node respectively; and
[0042] S310: Judge the magnitude relationship between the visual contribution corresponding to each second rendering node and a preset first threshold, and in the case where the visual contribution is less than the first threshold, cull the corresponding second rendering node, where the first threshold represents the visual contribution threshold.
[0043] Specifically, first, the user sends the target three-dimensional object (i.e., the three-dimensional object to be culled) to the processor 200 through the corresponding terminal device 100. And when the processor 200 receives the target three-dimensional object, it first determines the product structure tree corresponding to the target three-dimensional object. Among them, the product structure tree corresponding to the target three-dimensional object is mainly used to describe the composition structure of the target three-dimensional object in a hierarchical representation form. Figure 4 is a schematic diagram of the product structure tree corresponding to the target three-dimensional object according to the embodiment of the present application. Refer to Figure 4 shown, the product structure corresponding to the target three-dimensional object is a tree-shaped data structure, and each node of the tree-shaped data structure represents a component or sub-component of the target three-dimensional object, and the relationship between the nodes represents the assembly relationship.
[0044] As Figure 4 shown, the product structure tree corresponding to the target three-dimensional object includes, for example, nodes 1 to 8. Node 1 and node 2 belong to the same hierarchical depth, and in this embodiment, the hierarchical depth of node 1 and node 2 is, for example, 1. Node 2 is further divided into node 3, node 4, and node 5, and in this embodiment, the hierarchical depth of node 3, node 4, and node 5 is, for example, 2. That is, node 3, node 4, and node 5 are at the next hierarchical depth relative to the current hierarchical depth where node 1 and node 2 are located.
[0045] Similarly, node 5 is further divided into node 6, node 7, and node 8, and in this embodiment, the hierarchical depth of node 6, node 7, and node 8 is, for example, 3. That is, node 6, node 7, and node 8 are at the next hierarchical depth relative to the current hierarchical depth where node 3, node 4, and node 5 are located.
[0046] Thus, it can be seen from the above that the product structure tree corresponding to the target three-dimensional object in this application includes nodes with multiple different hierarchical depths. For example, node 1 and node 2 with a hierarchical depth of 1, and node 3, node 4, and node 5 with a hierarchical depth of 2.
[0047] Then, when the processor 200 determines the product structure tree corresponding to the target three-dimensional object, the octree algorithm is used to perform spatial partitioning on the product structure tree to generate a rendering model tree (S302). Figure 5 is a schematic diagram of the product structure tree and the rendering model tree corresponding to the product structure tree according to the embodiment of this application. Refer to Figure 5 shown, node 1 in the product structure tree is divided into the first rendering node 1 with a hierarchical depth of 1 in the rendering model tree, and node 2 in the product structure tree is divided into the first rendering node 4 with a hierarchical depth of 1 in the rendering model tree.
[0048] Since node 2 with a hierarchical depth of 1 in the product structure tree is further divided into node 3, node 4, and node 5 with a hierarchical depth of 2, the first rendering node 4 with a hierarchical depth of 1 in the rendering model tree is also further divided using the octree algorithm. Thus, node 3 with a hierarchical depth of 2 in the product structure tree is divided into the first rendering node 3 with a hierarchical depth of 2 in the rendering model tree, node 4 with a hierarchical depth of 2 in the product structure tree is divided into the first rendering node 5 with a hierarchical depth of 2 in the rendering model tree, and node 5 with a hierarchical depth of 2 in the product structure tree is divided into the first rendering node 5 with a hierarchical depth of 2 in the rendering model tree.
[0049] Further, since node 4 with a hierarchical depth of 2 in the product structure tree and node 5 with a hierarchical depth of 2 in the product structure tree are both divided into the first rendering node 5 with a hierarchical depth of 2 in the rendering model tree, it is necessary to further divide the first rendering node 5 with a hierarchical depth of 2 in the rendering model tree using the octree algorithm to generate the first rendering node 3 and the first rendering node 4 with a hierarchical depth of 3. Among them, the first rendering node 3 with a hierarchical depth of 3 in the rendering model tree corresponds to node 4 with a hierarchical depth of 2 in the product structure tree. The first rendering node 4 with a hierarchical depth of 3 in the rendering model tree corresponds to node 5 with a hierarchical depth of 2 in the product structure tree.
[0050] Similarly, since node 5 with a hierarchical depth of 2 in the product structure tree is further divided into node 6, node 7, and node 8 with a hierarchical depth of 3, the first rendering node 4 with a hierarchical depth of 3 in the rendering model tree is also further divided using the octree algorithm. Thus, node 7 with a hierarchical depth of 3 in the product structure tree is divided into the first rendering node 3 with a hierarchical depth of 4 in the rendering model tree, node 6 with a hierarchical depth of 3 in the product structure tree is divided into the first rendering node 4 with a hierarchical depth of 4 in the rendering model tree, and node 8 with a hierarchical depth of 3 in the product structure tree is divided into the first rendering node 5 with a hierarchical depth of 4 in the rendering model tree.
[0051] In addition, the rendering model tree in this embodiment supports adding node data of LOD and envelope. For example, the processor 200 can generate refined LOD nodes according to the first rendering node 5 with a hierarchical depth of 4 in the rendering model tree. Table 1 shows the first rendering node 5 with a hierarchical depth of 4 and the corresponding multiple LOD nodes.
[0052] Table 1
[0053]
[0054] Referring to Table 1, the processor 200 can generate the corresponding LOD node 1, LOD node 2, and LOD node 3 according to the first rendering node 5 with a hierarchical depth of 4 in the rendering model tree.
[0055] Further, for example, the first rendering node 5 with a hierarchical depth of 2 in the rendering model tree supports generating the envelope bodies of the first rendering node 3 and the first rendering node 4 with a hierarchical depth of 3. During rendering, only the envelope on the first rendering node 5 with a hierarchical depth of 2 is tiled for rendering, improving the rendering performance.
[0056] Further, when the processor 200 generates a rendering model tree, it automatically generates node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree (S304). Specifically, during the process of the processor 200 generating the rendering model tree, the processor 200 can automatically generate node weights corresponding to each first rendering node according to the hierarchical depth of each node in the product structure tree. For example, based on node 1 with a hierarchical depth of 1 in the product structure tree, the processor 200 automatically generates a node weight of 0.7 for the corresponding first rendering node 1. Based on node 3 with a hierarchical depth of 2 in the product structure tree, the processor 200 automatically generates a node weight of 0.5 for the corresponding first rendering node 3. That is, the deeper the hierarchical depth of each node in the product structure tree, the smaller the node weight of the corresponding first rendering node.
[0057] After that, the processor 200 performs pre-culling on the first rendering node list and generates a second rendering node list (S306). The first rendering node list includes multiple first rendering nodes, and the second rendering node list includes multiple second rendering nodes. Specifically, for example, the processor 200 can cull the first rendering node list according to the display state of each first rendering node in the rendering model tree, the tile geometry error corresponding to each first rendering node, and whether each first rendering node is within the rendering range. The above content will be described in detail later and will not be elaborated here.
[0058] Further, the processor 200 determines the projection height corresponding to the target three-dimensional object of each second rendering node, the projection width corresponding to the target three-dimensional object of each second rendering node, and the projection area corresponding to the target three-dimensional object of each second rendering node.
[0059] Among them, when the object height of the target three-dimensional object, the near-plane distance corresponding to the target three-dimensional object of each second rendering node, and the distance from the object to the camera are determined, the projection height corresponding to the target three-dimensional object of each second rendering node can be determined.
[0060] When the object width of the target three-dimensional object, the near-plane distance corresponding to the target three-dimensional object of each second rendering node, and the distance from the object to the camera are determined, the projection width corresponding to the target three-dimensional object of each second rendering node can be determined.
[0061] Thus, when the processor 200 determines the projection height corresponding to the target three-dimensional object of each second rendering node, the projection width corresponding to the target three-dimensional object of each second rendering node, and the projection area corresponding to the target three-dimensional object of each second rendering node, it can calculate the visual contribution degree corresponding to each second rendering node respectively based on the projection height corresponding to the target three-dimensional object of each second rendering node, the projection height threshold, the projection width corresponding to the target three-dimensional object of each second rendering node, the projection width threshold, the projection area corresponding to the target three-dimensional object of each second rendering node, and by using the node weight corresponding to each second rendering node (S308).
[0062] Specifically, the processor 200 can calculate the visual contribution degree corresponding to each second rendering node based on the following formula:
[0063]
[0064] where i = 1 to n. represents the visual contribution degree corresponding to the target three-dimensional object of the i th second rendering node, represents the projection area corresponding to the target three-dimensional object of the i th second rendering node, represents the projection height corresponding to the target three-dimensional object of the i th second rendering node, represents the projection height threshold corresponding to the target three-dimensional object, represents the projection width corresponding to the target three-dimensional object of the i th second rendering node, represents the projection width threshold corresponding to the target three-dimensional object, represents the node weight corresponding to the i th second rendering node.
[0065] In addition, during the actual application process, in order to prevent the projection height corresponding to the target three-dimensional object of the i th second rendering node from being too large, a projection height threshold is also set, so as to effectively prevent the projection height corresponding to the target three-dimensional object of the i th second rendering node from being too large.
[0066] Further, since the projected heights of the target three-dimensional objects of each second rendering node are different, when determining the ratio between the projected height and the projected height threshold, there may be a case where the ratio between the two is less than 1.0. To avoid the above situation, in the above formula, the ratio between the two is set to be at least 1.0 at minimum. That is, when the ratio between the projected height and the projected height threshold is greater than 1.0, the ratio between the projected height and the projected height threshold is used; when the ratio between the projected height and the projected height threshold is less than 1.0, 1.0 is used.
[0067] Similarly, in the actual application process, to prevent the i projected width of the target three-dimensional object of the i nth second rendering node from being too large, a projected width threshold is also set, so as to effectively prevent the
[0068] projected width of the target three-dimensional object of the
[0069] nth second rendering node from being too large.
[0070] Further, since the projected widths of the target three-dimensional objects of each second rendering node are different, when determining the ratio between the projected width and the projected width threshold, there may be a case where the ratio between the two is less than 1.0. To avoid the above situation, in the above formula, the ratio between the two is set to be at least 1.0 at minimum. That is, when the ratio between the projected width and the projected width threshold is greater than 1.0, the ratio between the projected width and the projected width threshold is used; when the ratio between the projected width and the projected width threshold is less than 1.0, 1.0 is used.
[0069] Finally, when the processor 200 determines the visual contribution degrees corresponding to the respective second rendering nodes, the magnitude relationship between the visual contribution degrees corresponding to the respective second rendering nodes and a preset first threshold is determined. Among them, the first threshold represents a preset visual contribution degree threshold. And when the visual contribution degree is less than the first threshold, the second rendering node corresponding to the visual contribution degree is removed; when the visual contribution degree is greater than the first threshold, the second rendering node corresponding to the visual contribution degree is retained (S310).
[0070] As described in the background art, existing three-dimensional object culling methods include frustum culling methods and occlusion culling methods, etc. However, the above existing three-dimensional object culling methods all have certain defects. For example, frustum culling methods usually use bounding boxes or bounding spheres to represent the spatial range of three-dimensional objects, but simple geometric shapes such as bounding boxes or bounding spheres may not be able to accurately match the actual shape of three-dimensional objects. And if the difference between the bounding box or bounding sphere and the actual shape of the three-dimensional object is large, it may lead to inaccurate culling results (for example, the culling is not fine enough, there are a large number of objects that need to be culled but are not culled. That is, missed culling). Another example is that the core of the occlusion culling method is to judge whether a three-dimensional object is completely occluded by other objects through depth buffering or hardware occlusion queries. When judging whether a three-dimensional object is occluded by comparing the depth value of the three-dimensional object with the value in the depth buffer, it is necessary to perform depth tests on each pixel, and the computational cost is large.
[0071] In view of this, in the case where the present application first generates a corresponding product structure tree based on the target three-dimensional object, the octree algorithm is further used and based on the product structure tree, a rendering model tree is generated. And in the case of generating the rendering model tree, a pre-culling is performed on the first rendering node list (including a plurality of first rendering nodes) in the rendering model tree in advance, and a second rendering node list (including a plurality of second rendering nodes) is generated. Thus, in this process, the first rendering nodes that are not displayed in the rendering model tree, the first rendering nodes that do not meet the tile geometry error threshold, and the first rendering nodes that are not within the rendering range can be culled, thereby greatly reducing the resources required for calculating the visual contribution degrees corresponding to each rendering node in the subsequent process and improving the calculation efficiency.
[0072] Further, in the case of performing a pre-culling on the first rendering node list and generating the second rendering node list, the node weights corresponding to each second rendering node can be determined based on the pre-determined node weights corresponding to each first rendering node, so as to calculate the visual contribution degrees corresponding to each second rendering node respectively. Then, based on the visual contribution degrees corresponding to each second rendering node and the pre-set visual contribution degree threshold, the second rendering nodes to be culled can be determined. Thus, in this process, the second rendering nodes with visual contribution degrees less than the pre-set visual contribution degree threshold are culled, and the second rendering nodes with visual contribution degrees greater than the pre-set visual contribution degree threshold are retained, and further, the technical effect of accurately culling the target three-dimensional object can be achieved.
[0073] Furthermore, it solves the technical problems in the prior art that when using the frustum culling method to cull three-dimensional objects, the accuracy of the culling result is relatively low; when using the occlusion culling method to cull three-dimensional objects, the computational cost is large.
[0074] Optionally, the pre-culling stage is divided into a first culling stage, a second culling stage, and a third culling stage, and the operation of pre-culling the first rendering node list and generating the second rendering node list includes: in the first culling stage, culling the first rendering node list and generating a third rendering node list, where the first culling stage is used to indicate culling based on the display status of each first rendering node in the rendering model tree, and the third rendering node list includes multiple third rendering nodes; in the second culling stage, culling the third rendering node list and generating a fourth rendering node list, where the fourth rendering node list includes multiple fourth rendering nodes, and the second culling stage is used to indicate culling based on the tile geometry error corresponding to the third rendering nodes at different hierarchical depths, and each third rendering node generates a tile geometry error according to the rendering data corresponding to the target third object; and in the third culling stage, culling the fourth rendering node list and generating the second rendering node list, where the third culling stage is used to indicate culling multiple fourth rendering nodes based on the frustum culling method.
[0075] Specifically, in order to further reduce the resources required to calculate the visual contribution degree corresponding to each second rendering node and improve the subsequent culling efficiency, the present application also sets a pre-culling stage before determining whether to cull each second rendering node by using the visual contribution degree corresponding to each second rendering node. Among them, the pre-culling stage includes a first culling stage, a second culling stage, and a third culling stage.
[0076] The first culling stage is used to indicate culling based on the display status of each first rendering node in the first rendering node list in the rendering model tree. Thus, in the first culling stage, when culling some first rendering nodes based on the display status of each first rendering node in the rendering model tree, multiple third rendering nodes can be finally generated.
[0077] The second culling stage is used to indicate culling based on the tile geometry error corresponding to the third rendering nodes at different hierarchical depths in the third rendering node list. Thus, in the second culling stage, when culling some third rendering nodes based on the tile geometry error corresponding to each third rendering node at different hierarchical depths, multiple fourth rendering nodes can be finally generated. Among them, the tile geometry error corresponding to each third rendering node is generated based on the rendering data corresponding to the target three-dimensional object. And the rendering data is used to indicate the data expressed by the graphics that actually need to be rendered under each node in the product structure tree. For example, if the target three-dimensional object is a car, the graphics that need to be rendered corresponding to node 1 are the wheels, the graphics that need to be rendered corresponding to node 2 are the body, the graphics that need to be rendered corresponding to node 3 are the windows, the graphics that need to be rendered corresponding to node 4 are the doors, and the graphics that need to be rendered corresponding to node 5 are the frame.
[0078] The third culling stage is used to indicate culling of the fourth rendering nodes in the fourth rendering node list that are not within the rendering range based on the frustum culling method. Thus, in the third culling stage, when culling some of the fourth rendering nodes that are not within the rendering range based on the frustum culling method, multiple second rendering nodes can ultimately be generated.
[0079] Thus, by setting the first culling stage, the second culling stage, and the third culling stage, and performing pre-culling operations on multiple first rendering nodes in the rendering model tree, the technical effect of reducing waste of computing resources and improving culling efficiency is achieved.
[0080] Optionally, in the first culling stage, the operation of culling the first rendering node list and generating the third rendering node list includes: culling the first rendering nodes with a display state of not displayed in the rendering model tree, and retaining the first rendering nodes with a display state of displayed in the rendering model tree, thereby generating multiple third rendering nodes.
[0081] Optionally, in the second culling stage, the operation of culling the third rendering node list and generating the fourth rendering node list includes: judging the size relationship between the tile geometry error of the third rendering node at the current level depth and a preset second threshold, where the second threshold represents the tile geometry error threshold; when the tile geometry error of the third rendering node at the current level depth is less than the second threshold, retaining the third rendering node at the current level depth and culling the third rendering nodes at the next level depth, thereby generating multiple fourth rendering nodes; and when the tile geometry error of the third rendering node at the current level depth is greater than the second threshold, culling the third rendering node at the current level depth.
[0082] Specifically, when the processor 200 completes the first culling stage and generates multiple third rendering nodes, the processor 200 further judges the size relationship between the tile geometry error of the third rendering node at the current level depth and a preset second threshold. For example, the processor 200 judges the size relationship between the tile geometry error of the third rendering node 5 at level depth 2 and a preset second threshold.
[0083] When the tile geometry error of the third rendering node at the current level depth is less than the second threshold, retain the third rendering node at the current level depth and cull the third rendering nodes at the next level depth, thereby generating multiple fourth rendering nodes. For example, when the tile geometry error of the third rendering node 5 at level depth 2 is less than the second threshold, retain the third rendering node 5 at level depth 2 and cull the third rendering nodes 3 and 4 at level depth 3.
[0084] When the tile geometry error of the third rendering node at the current level depth is greater than the second threshold, the third rendering node at the current level depth is culled. For example, when the tile geometry error of the third rendering node 5 at level depth 2 is greater than the second threshold, the third rendering node 5 at level depth 2 is culled. When the tile geometry error of the third rendering node at the current level depth is less than the second threshold, whether to retain the third rendering node at the current level depth depends on its own tile geometry error.
[0085] In this embodiment, according to different threshold values, there is another situation in the second culling stage. Optionally, in the second culling stage, the operation of culling the third rendering node list and generating the fourth rendering node list includes: determining the size relationship between the tile geometry error of the third rendering node at the current level depth and a preset third threshold, where the third threshold represents the tile geometry error threshold, and the second threshold is different from the third threshold; when the tile geometry error of the third rendering node at the current level depth is greater than the third threshold, retaining the third rendering node at the current level depth and the third rendering nodes at the next level depth, thereby generating multiple fourth rendering nodes; and when the tile geometry error of the third rendering node at the current level depth is less than the third threshold, culling the third rendering node at the current level depth and the third rendering nodes at the next level depth, thereby generating multiple fourth rendering nodes.
[0086] Specifically, when the processor 200 completes the first culling stage and generates multiple third rendering nodes, the processor 200 further determines the size relationship between the tile geometry error of the third rendering node at the current level depth and the preset third threshold. For example, the processor 200 determines the size relationship between the tile geometry error of the third rendering node 5 at level depth 2 and the preset third threshold.
[0087] When the tile geometry error of the third rendering node at the current level depth is greater than the third threshold, retain the third rendering node at the current level depth and the third rendering nodes at the next level depth, thereby generating multiple fourth rendering nodes. For example, when the tile geometry error of the third rendering node 5 at level depth 2 is greater than the third threshold, retain the third rendering node 5 at level depth 2, and the third rendering nodes 3 and 4 at level depth 3.
[0088] When the tile geometry error of the third rendering node at the current level depth is less than the third threshold, the third rendering node at the current level depth and the third rendering node at the next level depth are culled, thereby generating a plurality of fourth rendering nodes. For example, when the tile geometry error of the third rendering node 5 at level depth 2 is less than the third threshold, the third rendering node 5 at level depth 2, the third rendering node 3 and the third rendering node 4 at level depth 3 are retained.
[0089] Thus, according to the first aspect of this embodiment, the technical effects of high accuracy of the culling result and reduction of the computational amount are achieved.
[0090] In addition, referring to Figure 1 As shown, according to the second aspect of this embodiment, a storage medium is provided. The storage medium includes a stored program, wherein the method described in any one of the above is executed by a processor when the program runs.
[0091] Thus, according to this embodiment, the technical effects of high accuracy of the culling result and reduction of the computational amount are achieved.
[0092] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0093] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in various embodiments of the present invention.
[0094] Embodiment 2
[0095] Figure 6 Fig. shows a three-dimensional object culling device 600 based on visual contribution according to this embodiment. The three-dimensional object culling device 600 based on visual contribution corresponds to the method according to Embodiment 1. Referring to Figure 6As shown in the figure, the three-dimensional object culling device 600 based on visual contribution degree includes: a rendering model tree generation module 610, configured to determine a product structure tree corresponding to a target three-dimensional object, and perform spatial partitioning on the product structure tree by using an octree algorithm to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; a node weight generation module 620, configured to automatically generate node weights corresponding to each of the first rendering nodes based on the hierarchical depths of the nodes in the product structure tree; a first culling module 630, configured to perform pre-culling on a first rendering node list and generate a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes, and the second rendering node list includes a plurality of second rendering nodes; a visual contribution degree calculation module 640, configured to calculate the visual contribution degrees corresponding to each of the second rendering nodes respectively according to the projection height corresponding to the target three-dimensional object of each of the second rendering nodes, the projection height threshold, the projection width corresponding to the target three-dimensional object of each of the second rendering nodes, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each of the second rendering nodes, and by using the node weights corresponding to each of the second rendering nodes; and a second culling module 650, configured to determine the magnitude relationship between the visual contribution degree corresponding to each of the second rendering nodes and a preset first threshold, and cull the corresponding second rendering node when the visual contribution degree is less than the first threshold, where the first threshold represents the visual contribution degree threshold.
[0096] Optionally, the pre-culling stage is divided into a first culling stage, a second culling stage, and a third culling stage. The first culling module 630 includes: a first culling sub-module, configured to perform culling on the first rendering node list in the first culling stage and generate a third rendering node list, where the first culling stage is used to indicate culling based on the display states of the first rendering nodes in the rendering model tree, and the third rendering node list includes a plurality of third rendering nodes; a second culling sub-module, configured to perform culling on the third rendering node list in the second culling stage and generate a fourth rendering node list, where the fourth rendering node list includes a plurality of fourth rendering nodes, and the second culling stage is used to indicate culling based on the tile geometry errors corresponding to the third rendering nodes with different hierarchical depths, and each of the third rendering nodes generates the tile geometry errors according to the rendering data corresponding to the target three-dimensional object; and a third culling sub-module, configured to perform culling on the fourth rendering node list in the third culling stage and generate a second rendering node list, where the third culling stage is used to indicate culling of a plurality of fourth rendering nodes based on the frustum culling method.
[0097] Optionally, the first culling sub-module includes: a display state culling module, configured to cull first rendering nodes with a non-display display state in the rendering model tree and retain first rendering nodes with a display display state in the rendering model tree, so as to generate a plurality of third rendering nodes.
[0098] Optionally, the second culling sub-module includes: a first determination module, configured to determine the magnitude relationship between the tile geometry error of the third rendering node at the current hierarchical depth and a preset second threshold, where the second threshold represents the tile geometry error threshold; a first tile geometry error culling module, configured to retain the third rendering node at the current hierarchical depth and cull the third rendering nodes at the next hierarchical depth when the tile geometry error of the third rendering node at the current hierarchical depth is less than the second threshold, so as to generate a plurality of fourth rendering nodes; or a second tile geometry error culling module, configured to cull the third rendering node at the current hierarchical depth when the tile geometry error of the third rendering node at the current hierarchical depth is greater than the second threshold.
[0099] Optionally, the second culling sub-module includes: a second determination module, configured to determine the magnitude relationship between the tile geometry error of the third rendering node at the current hierarchical depth and a preset third threshold, where the third threshold represents the tile geometry error threshold and is different from the second threshold; a third tile geometry error culling module, configured to retain the third rendering node at the current hierarchical depth and the third rendering nodes at the next hierarchical depth when the tile geometry error of the third rendering node at the current hierarchical depth is greater than the third threshold, so as to generate a plurality of fourth rendering nodes; and a first tile geometry error culling module, configured to cull the third rendering node at the current hierarchical depth and the third rendering nodes at the next hierarchical depth when the tile geometry error of the third rendering node at the current hierarchical depth is less than the third threshold, so as to generate a plurality of fourth rendering nodes.
[0100] Optionally, the visual contribution degree calculation module 640 includes: calculating the visual contribution degree corresponding to each second rendering node based on the following formula:
[0101]
[0102] where i = 1 to n. represents the visual contribution degree corresponding to the target three-dimensional object of the i th second rendering node, represents the projected area corresponding to the target three-dimensional object of the i th second rendering node, represents the projected height corresponding to the target three-dimensional object of the i th second rendering node, represents the projection height threshold corresponding to the target three-dimensional object, represents the projection width corresponding to the target three-dimensional object of the i th second rendering node, represents the projection width threshold corresponding to the target three-dimensional object, represents the node weight corresponding to the i th second rendering node.
[0103] Therefore, according to this embodiment, the technical effects of higher accuracy of the rejection result and reduced computational complexity are achieved.
[0104] Embodiment 3
[0105] Figure 7 shows a three-dimensional object rejection device 700 based on visual contribution according to this embodiment. The three-dimensional object rejection device 700 based on visual contribution corresponds to the method described in Embodiment 1. Refer to Figure 7 As shown, the three-dimensional object rejection device 700 based on visual contribution includes: a processor 710; and a memory 720, connected to the processor 710, for providing instructions for the processor 710 to perform the following processing steps: determining a product structure tree corresponding to the target three-dimensional object, and using an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be rejected, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; automatically generating node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree; pre-rejecting the first rendering node list and generating a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes and the second rendering node list includes a plurality of second rendering nodes; calculating the visual contribution corresponding to each second rendering node according to the projection height corresponding to the target three-dimensional object of each second rendering node, the projection height threshold, the projection width corresponding to the target three-dimensional object of each second rendering node, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each second rendering node, and using the node weight corresponding to each second rendering node; and determining the magnitude relationship between the visual contribution corresponding to each second rendering node and a preset first threshold, and rejecting the corresponding second rendering node when the visual contribution is less than the first threshold, where the first threshold represents the visual contribution threshold.
[0106] Optionally, the pre-culling stage is divided into a first culling stage, a second culling stage, and a third culling stage, and the operation of pre-culling the first rendering node list and generating a second rendering node list includes: in the first culling stage, culling the first rendering node list and generating a third rendering node list, where the first culling stage is used to indicate culling based on the display status of each first rendering node in the rendering model tree, and the third rendering node list includes multiple third rendering nodes; in the second culling stage, culling the third rendering node list and generating a fourth rendering node list, where the fourth rendering node list includes multiple fourth rendering nodes, and the second culling stage is used to indicate culling based on the tile geometry error corresponding to the third rendering nodes at different hierarchical depths, and each third rendering node generates a tile geometry error according to the rendering data corresponding to the target three-dimensional object; and in the third culling stage, culling the fourth rendering node list and generating a second rendering node list, where the third culling stage is used to indicate culling multiple fourth rendering nodes based on the frustum culling method.
[0107] Optionally, in the first culling stage, the operation of culling the first rendering node list and generating a third rendering node list includes: culling the first rendering nodes whose display status in the rendering model tree is not displayed, and retaining the first rendering nodes whose display status in the rendering model tree is displayed, so as to generate multiple third rendering nodes.
[0108] Optionally, in the second culling stage, the operation of culling the third rendering node list and generating a fourth rendering node list includes: judging the size relationship between the tile geometry error of the third rendering node at the current hierarchical depth and a preset second threshold, where the second threshold represents the tile geometry error threshold; in the case where the tile geometry error of the third rendering node at the current hierarchical depth is less than the second threshold, retaining the third rendering node at the current hierarchical depth and culling the third rendering nodes at the next hierarchical depth, so as to generate multiple fourth rendering nodes; or in the case where the tile geometry error of the third rendering node at the current hierarchical depth is greater than the second threshold, culling the third rendering node at the current hierarchical depth and retaining the third rendering nodes at the next hierarchical depth, so as to generate multiple fourth rendering nodes.
[0109] Optionally, in the second culling stage, the operation of culling the third rendering node list and generating a fourth rendering node list includes: determining the magnitude relationship between the tile geometry error of the third rendering node at the current level depth and a preset third threshold, where the third threshold represents the tile geometry error threshold, and the second threshold is different from the third threshold; in the case where the tile geometry error of the third rendering node at the current level depth is greater than the third threshold, retaining the third rendering node at the current level depth and the third rendering node at the next level depth, thereby generating a plurality of fourth rendering nodes; and in the case where the tile geometry error of the third rendering node at the current level depth is less than the third threshold, culling the third rendering node at the current level depth and the third rendering node at the next level depth, thereby generating a plurality of fourth rendering nodes.
[0110] Optionally, the operation of respectively calculating the visual contribution degree corresponding to each second rendering node according to the projection height, projection height threshold, projection width, projection width threshold corresponding to the target three-dimensional object of each second rendering node, and the projection area corresponding to the target three-dimensional object of each second rendering node, and using the node weight corresponding to each second rendering node, includes: calculating the visual contribution degree corresponding to each second rendering node based on the following formula:
[0111]
[0112] where i = 1 to n. represents the visual contribution degree corresponding to the target three-dimensional object of the i th second rendering node, represents the projection area corresponding to the target three-dimensional object of the i th second rendering node, represents the projection height corresponding to the target three-dimensional object of the i th second rendering node, represents the projection height threshold corresponding to the target three-dimensional object, represents the projection width corresponding to the target three-dimensional object of the i th second rendering node, represents the projection width threshold corresponding to the target three-dimensional object, represents the node weight corresponding to the i th second rendering node.
[0113] Thus, according to this embodiment, the technical effects of higher accuracy of the culling result and reduced computational complexity are achieved.
[0114] The above serial numbers of the embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0115] In the above embodiments of the present invention, the descriptions of the respective embodiments have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0116] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0117] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] In addition, the functional units in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0119] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. And the aforementioned storage medium includes: USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.
[0120] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A three-dimensional object culling method based on visual contribution degree, characterized in that Including: Determine a product structure tree corresponding to a target three-dimensional object, and use an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate the three-dimensional object to be removed, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; Automatically generate node weights corresponding to each first rendering node based on the hierarchical depths of the nodes in the product structure tree; Perform pre-removal on the first rendering node list and generate a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes, the second rendering node list includes a plurality of second rendering nodes, and the operation of performing pre-removal on the first rendering node list and generating the second rendering node list includes: Perform pre-removal on the first rendering node list according to the display status of each first rendering node in the rendering model tree, the tile geometry error corresponding to each first rendering node, and whether each first rendering node is within the rendering range, and generate the second rendering node list; Calculate the visual contribution degree corresponding to each second rendering node respectively according to the projection height, projection height threshold, projection width, projection width threshold, and projection area corresponding to the target three-dimensional object of each second rendering node, and use the node weight corresponding to each second rendering node; and Judge the size relationship between the visual contribution degree corresponding to each second rendering node and a preset first threshold, and in the case where the visual contribution degree is less than the first threshold, remove the corresponding second rendering node, where the first threshold represents the visual contribution degree threshold.
2. The method according to claim 1, wherein The pre-removal stage is divided into a first removal stage, a second removal stage, and a third removal stage, and the operation of performing pre-removal on the first rendering node list and generating the second rendering node list includes: In the first removal stage, perform removal on the first rendering node list and generate a third rendering node list, where the first removal stage is used to indicate removal based on the display status of each first rendering node in the rendering model tree, and the third rendering node list includes a plurality of third rendering nodes; In the second removal stage, perform removal on the third rendering node list and generate a fourth rendering node list, where the fourth rendering node list includes a plurality of fourth rendering nodes, the second removal stage is used to indicate removal based on the tile geometry error corresponding to the third rendering nodes with different hierarchical depths, and each third rendering node generates the tile geometry error according to the rendering data corresponding to the target three-dimensional object; and In the third removal stage, perform removal on the fourth rendering node list and generate the second rendering node list, where the third removal stage is used to indicate removal of the plurality of fourth rendering nodes based on the frustum culling method.
3. The method according to claim 2, wherein In the first culling stage, the operation of culling the first rendering node list and generating a third rendering node list includes: Culling first rendering nodes with a non-displayed state in the rendering model tree and retaining first rendering nodes with a displayed state in the rendering model tree, thereby generating a plurality of third rendering nodes.
4. The method according to claim 2, wherein In the second culling stage, the operation of culling the third rendering node list and generating a fourth rendering node list includes: Judging the magnitude relationship between the tile geometry error of the third rendering node at the current hierarchical depth and a preset second threshold, where the second threshold represents a tile geometry error threshold; When the tile geometry error of the third rendering node at the current hierarchical depth is less than the second threshold, retaining the third rendering node at the current hierarchical depth and culling the third rendering nodes at the next hierarchical depth, thereby generating the plurality of fourth rendering nodes; and When the tile geometry error of the third rendering node at the current hierarchical depth is greater than the second threshold, culling the third rendering node at the current hierarchical depth.
5. The method according to claim 4, wherein In the second culling stage, the operation of culling the third rendering node list and generating a fourth rendering node list includes: Judging the magnitude relationship between the tile geometry error of the third rendering node at the current hierarchical depth and a preset third threshold, where the third threshold represents a tile geometry error threshold and the second threshold is different from the third threshold; When the tile geometry error of the third rendering node at the current hierarchical depth is greater than the third threshold, retaining the third rendering node at the current hierarchical depth and the third rendering nodes at the next hierarchical depth, thereby generating the plurality of fourth rendering nodes; and When the tile geometry error of the third rendering node at the current hierarchical depth is less than the third threshold, culling the third rendering node at the current hierarchical depth and the third rendering nodes at the next hierarchical depth, thereby generating the plurality of fourth rendering nodes.
6. The method according to claim 1, characterized in that, The operation of respectively calculating the visual contribution degrees corresponding to the respective second rendering nodes according to the projection height, projection height threshold corresponding to the target three-dimensional object corresponding to each second rendering node, the projection width, projection width threshold corresponding to the target three-dimensional object corresponding to each second rendering node, and the projection area corresponding to the target three-dimensional object corresponding to each second rendering node, and using the node weights corresponding to the respective second rendering nodes includes: Calculating the visual contribution degrees corresponding to the respective second rendering nodes based on the following formula: ; where \(i = 1\sim n\), represents the visual contribution degree corresponding to the target three-dimensional object of the i th second rendering node, represents the projected area corresponding to the target three-dimensional object of the i th second rendering node, represents the projected height corresponding to the target three-dimensional object of the i th second rendering node, represents the projected height threshold corresponding to the target three-dimensional object, represents the projected width corresponding to the target three-dimensional object of the i th second rendering node, represents the projected width threshold corresponding to the target three-dimensional object, represents the node weight corresponding to the i th second rendering node.
7. A storage medium, characterized in that, The storage medium includes a stored program, wherein, when the program runs, the method according to any one of claims 1 to 6 is executed by a processor.
8. A three-dimensional object culling device based on visual contribution degree, characterized in that Including: A rendering model tree generation module, configured to determine a product structure tree corresponding to a target three-dimensional object, and perform spatial partitioning on the product structure tree by using an octree algorithm to generate a rendering model tree, where the target three-dimensional object is used to indicate a three-dimensional object to be culled, and the rendering model tree includes a plurality of first rendering nodes at different hierarchical depths; A node weight generation module, configured to automatically generate node weights corresponding to each first rendering node based on the hierarchical depth of each node in the product structure tree; A first culling module, configured to perform pre-culling on a first rendering node list and generate a second rendering node list, where the first rendering node list includes multiple first rendering nodes, the second rendering node list includes multiple second rendering nodes, and where the first culling module is further configured to perform the following operations: Perform pre-culling on the first rendering node list according to the display states of the respective first rendering nodes in the rendering model tree, the tile geometry errors corresponding to the respective first rendering nodes, and whether the respective first rendering nodes are within the rendering range, and generate the second rendering node list; A visual contribution degree calculation module, configured to calculate the visual contribution degrees corresponding to the respective second rendering nodes respectively according to the projection height, projection height threshold, projection width, projection width threshold, and projection area corresponding to the target three-dimensional object of each second rendering node, and by using the node weights corresponding to the respective second rendering nodes; And A second culling module, configured to determine the magnitude relationship between the visual contribution degrees corresponding to the respective second rendering nodes and a preset first threshold, and in the case where the visual contribution degree is less than the first threshold, cull the corresponding second rendering node, where the first threshold represents a visual contribution degree threshold.
9. The device according to claim 8, wherein The pre-culling stage is divided into a first culling stage, a second culling stage, and a third culling stage. The first culling module includes: A first culling sub-module, configured to perform culling on the first rendering node list in the first culling stage and generate a third rendering node list, where the first culling stage is used to indicate culling based on the display states of the respective first rendering nodes in the rendering model tree, and the third rendering node list includes multiple third rendering nodes; A second culling sub-module, configured to perform culling on the third rendering node list in the second culling stage and generate a fourth rendering node list, where the fourth rendering node list includes multiple fourth rendering nodes, the second culling stage is used to indicate culling based on the tile geometry errors corresponding to the third rendering nodes at different hierarchical depths, and each third rendering node generates the tile geometry error according to the rendering data corresponding to the target three-dimensional object; and A third culling sub-module, configured to perform culling on the fourth rendering node list in the third culling stage and generate the second rendering node list, where the third culling stage is used to indicate culling of the multiple fourth rendering nodes based on the frustum culling method.
10. A three-dimensional object culling device based on visual contribution degree, characterized in that, Including: A processor; And A memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: Determine a product structure tree corresponding to a target three-dimensional object, and use an octree algorithm to perform spatial partitioning on the product structure tree to generate a rendering model tree, where the target three-dimensional object is used to indicate a three-dimensional object to be removed, and the rendering model tree includes a plurality of first rendering nodes with different hierarchical depths; Automatically generate node weights corresponding to each of the first rendering nodes based on the hierarchical depths of the nodes in the product structure tree; Perform pre-removal on a first rendering node list and generate a second rendering node list, where the first rendering node list includes a plurality of first rendering nodes, the second rendering node list includes a plurality of second rendering nodes, and the operation of performing pre-removal on the first rendering node list and generating the second rendering node list includes: Perform pre-removal on the first rendering node list according to the display status of each first rendering node in the rendering model tree, the tile geometry error corresponding to each first rendering node, and whether each first rendering node is within the rendering range, and generate the second rendering node list; Calculate the visual contribution degrees corresponding to each of the second rendering nodes respectively according to the projection height corresponding to the target three-dimensional object of each second rendering node, the projection height threshold, the projection width corresponding to the target three-dimensional object of each second rendering node, the projection width threshold, and the projection area corresponding to the target three-dimensional object of each second rendering node, and use the node weights corresponding to each of the second rendering nodes; and Judge the magnitude relationship between the visual contribution degree corresponding to each of the second rendering nodes and a preset first threshold, and remove the corresponding second rendering node when the visual contribution degree is less than the first threshold, where the first threshold represents a visual contribution degree threshold.
Citation Information
Patent Citations
High-density three-dimensional scene rendering method and device, equipment and storage medium
CN116129022A
Three-dimensional data visualization rendering method and visualization rendering engine system
CN119379880A
Image rendering method, intelligent terminal and storage device
CN113256755A
Method for removing models in game scene and device thereof, equipment and storage medium
CN113769382A