Object rendering method and device based on tree structure and related equipment
Through the tree-based object rendering method, combining texture map complexity and bounding box size information, and combining camera sight line for evaluation, the problem of imbalanced rendering quality of virtual objects in virtual scenes is solved, and more balanced and efficient rendering display is achieved .
Patent Information
- Application Number
- CN202411298522.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-20
AI Technical Summary
When rendering and displaying virtual objects in virtual scenes, the display quality is adjusted based on the visual range, resulting in unbalanced rendering quality, especially the quality of objects with far-range visual range is ignored, and the quality of objects with smaller visual range is overly highlighted and cannot be effectively improved. Render display quality.
The object rendering method based on tree structure is used to evaluate the texture map image complexity of the nodes, and the rendering display is determined. By obtaining the object node evaluation list in the virtual scene, the texture map complexity and bounding box size information of the target node are obtained, and combined with the The camera's line of sight is evaluated to determine whether to render and hide the node.
It improves the rendering and display quality of virtual scenes, avoids the quality of objects with far-range sight distances, and ensures that objects with more information carry a good display quality, improving the overall rendering effect.
Smart Images

Figure CN119169169A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a tree-structure-based object rendering method, apparatus, and related equipment. Background Art
[0002] Currently, when rendering and displaying a virtual object in a virtual scene, the display quality of the virtual object to be rendered is usually adjusted based on the viewing distance (ie, the distance between the virtual object and a camera).
[0003] However, the inventors have found in practice that directly determining the display quality of virtual objects (such as object X1 and object X2) based on viewing distance can easily lead to poor final image rendering quality. For example, in a virtual scene, when object X1 is far away from the camera (i.e., the viewing distance is large), when determining the display quality of object X1 based on viewing distance, the rendering display quality of object X1 will be neglected or even ignored due to the large viewing distance; conversely, when object X1 is close to the camera (i.e., the viewing distance is small), when determining the display quality of object X2 based on viewing distance, the rendering display quality of object X2 will be indiscriminately highlighted due to the small viewing distance. Based on this, how to improve the rendering display quality of virtual scenes is an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a tree-structured object rendering method, apparatus, and related equipment, which can perform node evaluation in combination with the image complexity of the node's texture map, thereby determining the rendering and display of a three-dimensional virtual object based on the node evaluation result, thereby improving the rendering and display quality of the virtual scene.
[0005] The present application provides a tree-structured object rendering method, characterized in that the method includes:
[0006] Obtaining an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object;
[0007] Obtaining the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map;
[0008] Determine target size information of the target node bounding box based on the target node bounding box to which the target node belongs;
[0009] Based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, a node evaluation is performed on the target node to obtain a node evaluation result of the target node;
[0010] If the node evaluation result indicates that the target node meets the rendering display conditions and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are hidden.
[0011] The present application embodiment provides a tree-structured object rendering device, characterized in that the device includes:
[0012] An evaluation list acquisition module is used to acquire an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object;
[0013] The complexity acquisition module is used to acquire the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map;
[0014] A size determination module, used for determining target size information of a target node bounding box based on a target node bounding box to which the target node belongs;
[0015] An evaluation result determination module is used to perform node evaluation on the target node based on target size information, a camera viewing distance between the target node and the target camera, and image complexity to obtain a node evaluation result of the target node;
[0016] The rendering and display module is used to render and display the target node and hide the child nodes of the target node when rendering and displaying the three-dimensional virtual object if the node evaluation result indicates that the target node meets the rendering and display conditions and the target node is located within the field of view corresponding to the target camera.
[0017] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.
[0018] In one aspect, the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the present application.
[0019] In an embodiment of the present application, it is possible to determine the target node in the target tree structure corresponding to the three-dimensional virtual object, and then obtain the image complexity of the target texture map of the target node, the size information of the node bounding box of the target node, and the camera viewing distance between the target node and the target camera, so as to perform node evaluation on the target node based on the image complexity, size information and camera viewing distance, and obtain the node evaluation result, and then when the node evaluation result of the target node indicates that the rendering display condition is met, when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are node hidden, that is, when the target node meets the rendering and display requirements, the three-dimensional virtual object can be directly rendered and displayed based on the target node. Based on this, the node evaluation can be performed in combination with the image complexity of the node texture map, so as to determine the rendering and display of the three-dimensional virtual object based on the node evaluation result, so as to avoid rudely reducing the display quality of the virtual object with a long viewing distance, and the virtual object with a large amount of information carried in the texture map can also have a good display quality, thereby improving the rendering and display quality of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1 It is a structural diagram of a data processing system provided in an embodiment of the present application;
[0022] Figure 2 It is a scene schematic diagram of a tree-structure-based object rendering method provided in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of a tree-structure-based object rendering method provided in an embodiment of the present application;
[0024] Figure 4 It is a schematic diagram of the effect of a quadtree structure provided by an embodiment of the present application;
[0025] Figure 5 It is a schematic diagram of the effect of a three-dimensional virtual object at different display quality levels provided by an embodiment of the present application;
[0026] Figure 6 is a comparative schematic diagram of a texture map provided in an embodiment of the present application;
[0027] Figure 7 This is a schematic diagram of a scene divided by a bounding box provided in an embodiment of the present application;
[0028] Figure 8 It is a schematic diagram of the effect of a viewing cone of a target camera provided in an embodiment of the present application;
[0029] Fig. 9 It is a flowchart of a rendering and display process provided by an embodiment of the present application;
[0030] Fig.10 It is a flowchart of a tree-structure-based object rendering method provided in an embodiment of the present application;
[0031] Fig.11 It is a flowchart of a rendering process provided by an embodiment of the present application;
[0032] Fig.12 is a flowchart of another rendering process provided by an embodiment of the present application;
[0033] Fig.13 It is a scene schematic diagram of a virtual scene rendering process provided by an embodiment of the present application;
[0034] Fig.14 is a structural diagram of a tree-structure-based object rendering device provided in an embodiment of the present application;
[0035] Fig.15 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] First, a brief introduction is given to the terms involved in the embodiments of the present application.
[0038] Virtual scene: A scene provided (or displayed) when an application is running on a terminal. The virtual scene refers to a scene created for virtual objects to carry out activities. A virtual scene can be a three-dimensional virtual scene. The virtual scene can be a simulation of the real world, a semi-simulation and semi-fictional scene, or a purely fictional scene. The virtual scene can include a variety of three-dimensional models. For example, the multiple three-dimensional models can be people, animals, castles, railings, stairs, walls, trees, aircraft, and oceans, etc. It can be understood that the virtual scene can also be called a virtual space, or a business space, which is not limited here.
[0039] Three-dimensional virtual object: refers to a virtual object instantiated by a three-dimensional model in a three-dimensional virtual scene. The virtual scene includes multiple virtual objects. Each virtual object has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene.
[0040] A quadtree structure may be a tree-like data structure, which may include nodes on multiple node division levels, and each node may have up to four child nodes, and is often used for analyzing spatial data (such as the model data of a three-dimensional virtual object in this application). The quadtree is suitable for data ranges of square, rectangular or other arbitrary shapes by dividing the data into four quadrants or regions.
[0041] LOD (Levels of Detail) is a technology used to optimize the rendering of 3D models. It can dynamically adjust the model's level of detail (also called display quality level) according to the object model's position and importance in the display environment to optimize rendering performance. For example, the display quality level of a 3D virtual object can be divided into three levels, such as the lowest level, the middle level, and the highest level. The model data corresponding to different levels have different degrees of refinement or detail. Generally, the display quality level of 3D virtual objects in a virtual scene can be dynamically adjusted, such as reducing the number of faces and detail of non-important objects in the virtual scene (i.e., using the model data of the lowest display quality level for rendering), thereby improving rendering efficiency while maintaining image quality.
[0042] See also Figure 1 , Figure 1 Schematic diagram of a data processing system provided in an embodiment of the present application. Figure 1 As shown, the data processing system may include terminal devices (such as device 11a, device 12a, device 13a) and server 100a. It can be understood that Figure 1 The number of terminal devices and servers in the embodiment is only for illustration, and any number of terminal devices and servers may be provided according to the implementation requirements. The terminal devices (such as the device 11a, the device 12a, and the device 13a) may communicate with the server through a network (i.e., a medium providing a communication link through a wired or wireless communication link or an optical fiber cable, etc.) to transmit data.
[0043] It is understandable that a client may be running on a terminal device (such as device 12a), and the client may be a program that provides local services to users (also called business objects, operation objects). Server 100a may be a server corresponding to the client, and a program for providing resources, service data and other services to the client may be running in the server 100a. It is understandable that the client running on the terminal device may also be called an application client, a business client, and the like. For example, the client running on the terminal device may be a client for displaying a virtual scene, such as a game client, a map navigation client, and the like, so that the user can view the screen of the virtual scene through the client. It is understandable that the server may be used to obtain a screen (i.e., an image frame) of a virtual scene based on rendering, and send the rendered image frame to the client for display.
[0044] It is understandable that the terminal device (such as device 11a) may include but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, smart speakers, smart home appliances, etc., and there is no limitation here. The server 100a may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, and there is no limitation here.
[0045] See also Figure 2 , Figure 2 Schematic diagram of a scene of a tree-structured object rendering method provided in an embodiment of the present application. Figure 2 As shown, an object node evaluation list 201a associated with the three-dimensional virtual object to be rendered in the virtual scene can be obtained, and the object node evaluation list may include nodes to be evaluated, for example, nodes J01, J02, J03, ..., J04, etc. It can be understood that the number of three-dimensional virtual objects in the virtual scene can be one or more, and the nodes in the object node evaluation list can be nodes in the target tree structure corresponding to all or part of the three-dimensional virtual objects, which is not limited here. It can be understood that a target tree structure can be composed of nodes on multiple node division levels obtained by node division of a three-dimensional virtual object.
[0046] It can be understood that the object node evaluation list may include a target node, and the target node may be any node in the object node evaluation list, and then the target node (such as Figure 2Further, the image complexity of the target texture map corresponding to the target node can be obtained (as shown in 202a in FIG. 1 ). Figure 2 203a in FIG), target size information of the target node bounding box of the target node (such as Figure 2 204a in FIG), the camera viewing distance between the target node and the target camera (as shown in FIG. Figure 2 205a in FIG. 2 ). The image complexity may be used to describe the amount of information contained in the texture map corresponding to the node, the target size information may be information used to describe the size of the target node bounding box, and the camera viewing distance may refer to the distance between the center position of the node bounding box and the position of the target camera. It should be understood that the purpose of performing node evaluation is to determine whether it is necessary to improve or reduce the display quality of the node object corresponding to the node, so as to select the display quality that is most suitable for the three-dimensional virtual object in the virtual scene. If too high a display quality is selected to display the three-dimensional virtual object, it will take more time to render the three-dimensional virtual object. If too low a display quality is selected to display the three-dimensional virtual object, the quality of the rendered virtual scene will be too poor. Therefore, the display quality that is most suitable for each three-dimensional virtual object can be selected based on the information of multiple dimensions of each virtual object, so as to improve the rendering display quality while ensuring the rendering efficiency. For example, for three-dimensional virtual objects that are easy to observe by observers (i.e., users who view the screen of the virtual scene, such as game users in the game scene) (such as three-dimensional virtual objects with high image complexity, small camera viewing distance or large size), the best display quality can be selected for display, while for three-dimensional virtual objects that are not easy to observe by observers (such as three-dimensional virtual objects with low image complexity, large camera viewing distance or small size), relatively low display quality can be selected for display.
[0047] Furthermore, the target node can be evaluated based on the target size information, camera viewing distance and image complexity to obtain the node evaluation result of the target node (such as Figure 2 206a in ). The node evaluation node can be used to indicate that the target node meets the rendering display condition, or can be used to indicate that the target node does not meet the rendering display condition. The rendering display condition can be a condition that needs to be met based on the corresponding node for rendering display timing. For example, the rendering display condition can be that the evaluation index of the target node is greater than a first value (such as 1), and the evaluation index can be a value used to evaluate whether the display quality of a node meets the current display quality requirement. The evaluation index can be a value determined based on target size information, camera viewing distance, and image complexity.
[0048] Furthermore, if the node evaluation result indicates that the target node meets the rendering display condition, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are hidden (such as Figure 2 207a in the figure). The field of view of the target camera may be a visible range of the target camera, and the field of view may be a spatial range indicated by a viewing cone corresponding to the target camera. It is understandable that if the node evaluation result indicates that the target node satisfies the rendering and display conditions, it means that the target node can meet the display quality requirements of the three-dimensional virtual object, and the three-dimensional virtual object can be directly rendered and displayed based on the target node, that is, the display quality corresponding to the target node can be maintained, and there is no need to improve or reduce the display quality of the target node. Based on this, when rendering and displaying the three-dimensional virtual object, the target node can be rendered and displayed (that is, the node object corresponding to the target node is rendered and displayed), and the child nodes of the target node can be hidden.
[0049] It is understandable that the embodiments of the present application can be applied to a variety of business scenarios, such as the rendering scene of the city three-dimensional model, that is, the three-dimensional virtual object can be the object corresponding to the city three-dimensional model, and the virtual object corresponding to the city three-dimensional model can be rendered and displayed based on the tree-structured object rendering method provided by the embodiments of the present application, so as to achieve in-depth analysis of the city layout, traffic flow and architectural design. For another example, the embodiments of the present application can also be applied to virtual reality scenes, and users can immerse themselves in the realistic virtual environment generated by the embodiments of the present application through the device, and experience virtual reality scenes, such as experiencing remote travel or historical scene reproduction, etc. In addition, the embodiments of the present application can also be applied to game scenes, and the virtual objects in the game are rendered by the embodiments of the present application to obtain the game screen, thereby providing players with a richer and more dynamic virtual world and enhancing the immersion and interactivity of the game.
[0050] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0051] It is understandable that the above cloud server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The above terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, smart speakers, smart home appliances, etc.
[0052] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0053] For further information, see Figure 3 , Figure 3 1 is a flowchart of a tree-structured object rendering method provided by an embodiment of the present application. The method can be executed by the above-mentioned terminal device or server, for example, the terminal device can be the above-mentioned device 11a, and the server can be the above-mentioned server 100a. The method can at least include the following steps S101-S105.
[0054] S101, obtaining an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object.
[0055] It is understandable that the three-dimensional virtual object can be an object to be rendered in a virtual scene. The three-dimensional virtual object can be associated with a corresponding target tree structure. The target tree structure can be a tree structure composed of nodes for node division of the three-dimensional virtual object, or a tree structure composed of nodes corresponding to the node model data obtained by dividing the model data corresponding to the three-dimensional virtual object. The target tree structure can include nodes on multiple node division levels, and the node division level can refer to the level at which the node is located in the tree structure. For example, the node division level of the root node is the root level, the node division level of the child node of the root node is the first level, the node on the first level is the first level node, the node division level corresponding to the child node of the first level node is the second level, and the node on the second level is the second level node, and so on, each node can have a corresponding node division level. It is understandable that the target tree structure can be a quadtree structure, an octree structure, etc., which is not limited here. For example, in a quadtree structure, each node may include at most 4 child nodes, for example, a root node may include at most 4 first-level nodes, and each first-level node may include at most 4 second-level nodes. In an octree structure, each node may include at most 8 child nodes, for example, a root node may include at most 8 first-level nodes, and each first-level node may include at most 8 second-level nodes.
[0056] It should be understood that when dividing the three-dimensional virtual object into nodes, the model data of the three-dimensional virtual object at each display quality level can be divided into model data to obtain the node model data of the nodes on the node division level corresponding to each display quality level, and then the nodes on each node division level can be determined based on the node model data of the nodes on each node division level, and each node is associated with corresponding node model data. For example, the node model data of each node can be added to the corresponding empty node (i.e., the node without node attribute data added) to obtain the node with the node model data added, thereby determining the target tree structure based on the node with the node model data added.
[0057] It should be understood that the same three-dimensional virtual object may have different model data at different display quality levels, and thus the display quality of the object rendered based on the model data at different display quality levels is different. For example, the lower the display quality level, the fewer the number of facets in the model data of the three-dimensional virtual object at the corresponding display quality level, the worse the texture quality of the texture map, and the worse the display quality of the three-dimensional virtual object rendered and displayed based on the corresponding model data. Conversely, the higher the display quality level, the more the number of facets in the model data of the three-dimensional virtual object at the corresponding display quality level, the better the texture quality of the texture map, and the better the display quality of the three-dimensional virtual object rendered and displayed based on the corresponding model data.
[0058] It can be understood that a node division level in the target tree structure can correspond to a display quality level. For example, the lowest display quality level in the display quality levels of the three-dimensional virtual object can correspond to the node division level corresponding to the root node in the target tree structure, and the second lowest display quality level in the display quality levels of the three-dimensional virtual object can correspond to the node division level corresponding to the child node (i.e., the first-level node) of the root node in the target tree structure. By analogy, the three-dimensional virtual object can be node-divided based on each display quality level to obtain the nodes on the node division level corresponding to each display quality level, thereby constructing the target tree structure based on the nodes obtained by the division.
[0059] Among them, model data division is performed on the model data of the three-dimensional virtual object at each display quality level to obtain node model data of the nodes on the node division level corresponding to each display quality level, which can include: obtaining the object to be divided determined based on the model data at the target display quality level (i.e., any one of the multiple display quality levels), and then establishing a node coordinate system for the object to be divided, and then dividing the object to be divided into multiple sub-objects based on the quadrants of the node coordinate system, that is, the part of the object to be divided located in each quadrant can be determined as a sub-object. Then, based on the divided sub-objects, the sub-nodes of the node corresponding to the object to be divided are determined. That is, model data division can be performed based on the model data on the display quality level (i.e., the next display quality level of the target display quality level) corresponding to each sub-object, and the model data corresponding to each sub-object (such as the facets, vertices, textures, etc. corresponding to each sub-object) is determined. Then, based on the model data corresponding to each sub-object, the node model data of the node corresponding to each sub-object is determined. That is, the node model data of each node on the node division level corresponding to the target display quality level is obtained, and then the corresponding node is determined based on the node model data of each node. The model data corresponding to a sub-object is used to determine the node model data of a node.
[0060] The object to be divided can be the three-dimensional virtual object, or it can be a sub-object obtained by dividing the three-dimensional virtual object, which is not limited here. The node coordinate system can be a coordinate system created for the object to be divided, and the origin of the node coordinate system can be the center position of the object to be divided. Each coordinate axis (such as the x-axis, y-axis, and z-axis) can be determined according to actual needs. For example, the coordinate axis can be parallel to the scene coordinate system of the virtual scene, or it can be determined according to the geometric shape of the three-dimensional virtual object, which is not limited here. It can be understood that each quadrant of the node coordinate system can be a quadrant obtained by dividing based on the quadrant division coordinate axis, and the quadrant division coordinate axis can refer to the coordinate axis used to divide the quadrant. For example, when the tree structure is a quadtree structure, the node coordinate system can be divided into 4 quadrants, then two quadrant division coordinate axes can be determined from the coordinate axis of the node coordinate system, and then four quadrants can be determined based on the two quadrant division coordinate axes. For example, the two quadrant division coordinate axes can be the x-axis and the y-axis, or the x-axis and the z-axis, or the y-axis and the z-axis, which are not limited here. For example, when the tree structure is an octree structure, the node coordinate system can be divided into 8 quadrants, and the three coordinate axes of the node coordinate system can be determined as quadrant division coordinate axes, and then the 8 quadrants can be determined based on the three quadrant division coordinate axes.
[0061] For example, when the target tree structure is a quadtree structure, the three-dimensional virtual object can be determined as the object to be divided, and then four quadrants can be determined for the node coordinate system of the three-dimensional virtual object, and then a sub-node can be determined based on the sub-objects of the three-dimensional virtual object in each quadrant to obtain a first-level node. It is also possible to determine the node model data of the node corresponding to each sub-object based on the model data corresponding to each sub-object, and then determine the corresponding node (i.e., the first-level node) based on the node model data of each node; further, the sub-object corresponding to each first-level node can be determined as the object to be divided, and then the object of each first-level node can be divided into four sub-objects for the four quadrants of the node coordinate system of each first-level node, so that a node can be determined based on each sub-object, and so on, nodes on multiple node division levels can be obtained, and then the target tree structure can be constructed.
[0062] For example, see Figure 4 , Figure 4 Schematic diagram of the effect of a quadtree structure provided by an embodiment of the present application. Figure 4The quadtree structure shown may include three node division levels, specifically, the root level, the first level, and the second level. The root level includes only one root node a1, and then four first-level nodes (i.e., nodes on the first level) can be divided under the root node a1, for example, nodes b1, b2, b3, and b4 can be included. Further, each first-level node can be divided to obtain four second-level nodes (i.e., nodes on the second level), for example, nodes c1-c4 can be included under node b1, nodes c5-c8 can be included under node b2, nodes c9-c12 can be included under node b3, and nodes c13-c16 can be included under node b4.
[0063] It should be understood that before the data of the virtual scene is loaded for the first time, a target tree structure can be constructed for each three-dimensional virtual object in the virtual scene, so that when the picture (i.e., image frame) in the virtual scene is subsequently rendered and displayed, node evaluation can be performed based on the constructed target tree structure, and the three-dimensional virtual object can be displayed based on the node evaluation result obtained by the node evaluation. Therefore, the model data corresponding to the most suitable display quality level for the three-dimensional virtual object can be determined based on the node evaluation result, and the three-dimensional virtual object can be rendered and displayed based on the model data corresponding to the determined most suitable display quality level, thereby ensuring the rendering efficiency of the three-dimensional virtual object while improving the display quality of the three-dimensional virtual object.
[0064] Specifically, an embodiment of the present application may also include: obtaining the root node of the target tree structure to be created corresponding to the three-dimensional virtual object and a node source information list of the root node; the node source information list includes the node source information of each node of the target tree structure to be created; the node source information of each node of the target tree structure includes the corresponding node division level; further, determining the root node as the inserted node, and determining the target node source information to be added to the target tree structure from the node source information list; further, when the node division level of the target node source information is the next node division level of the inserted node, obtaining the to-be-processed node under the inserted node; the to-be-processed node is a node among the child nodes of the inserted node to which the node source information is not added; further, obtaining the quadrant information corresponding to the target node source information, determining the target to-be-processed node to which the target node source information is to be added from the to-be-processed nodes of the inserted node based on the quadrant information, and adding the target node source information to the target to-be-processed node; further, determining the target tree structure corresponding to the three-dimensional virtual object based on the target to-be-processed node to which the target node source information is to be added.
[0065] The root node refers to the starting point of the tree structure, and all other nodes start from the root node. It should be understood that the root node is unique in a tree structure. It can be understood that the root node can be added with node source information of the node corresponding to the entire three-dimensional virtual object.
[0066] Among them, the node source information list includes the node source information of each node of the target tree structure to be created. The node source information may include the node attribute data of each node, for example, the node attribute data may include the node division level corresponding to the node, the name of the node, the quadrant information corresponding to the node, the string format information of the node division level corresponding to the node, etc. Among them, the name of the node may be the name of the node in the target tree structure used to uniquely identify the three-dimensional virtual object. The quadrant information can be used to indicate the information of the quadrant in which the node is located in the node coordinate system of the object corresponding to its parent node. For example, in a quadtree structure, the quadrant information of a node may be the information of the quadrant in the four quadrants of the node coordinate system corresponding to its parent node, such as the four quadrants may be the lower left corner LL (quadrant 3), the lower right corner LR (quadrant 4), the upper left corner UL (quadrant 2), and the upper right corner UR (quadrant 1) of the node coordinate system, and the quadrant information of different quadrants is represented by integers 0, 1, 2, and 3 respectively. The string format information may refer to information representing the node depth level of the node in a string format. It should be understood that the node division level of the node obtained directly based on the file name of the model data corresponding to the node may be represented in a string format, and then the obtained node division level string format information may be converted into a node division level in integer form, so that the node division level in integer form may be used as the node division level in the above-mentioned node attribute data. For example, the node division level in string format may be converted into a node division level in integer form through the int.Parse() function (a data format conversion function).
[0067] The inserted node may refer to a node for adding node source information to its child nodes, for example, the root node may be used as the inserted node. The target node source information may be the node source information to be added to the target tree structure, and the target node source information may be the node source information of any node that has not been added to the target tree structure.
[0068] It is understandable that if the node division level of the target node source information is the next node division level of the inserted node, it means that the target node source information can be the node source information corresponding to the child node of the inserted node. Therefore, any child node of the inserted node to which the node source information is not added can be determined as a node to be processed. It is understandable that in the embodiment of the present application, a node source insertion function that adds the node source information to the target tree structure can be called to implement adding the target node source to the node in the target tree structure, that is, inserting the target node source into the target tree structure.
[0069] It can be understood that the node to be processed is a node in the child node of the inserted node that has not been added with the node source information. For example, when the target tree structure is a quadtree structure, the child node of the inserted node may include 4 child nodes, namely, node b1, node b2, node b3, and node b4. If the 4 child nodes have not been added with the node source information, then the 4 nodes are all used as the nodes to be processed. If only node b1 and node b2 among the 4 child nodes have not been added with the node source information, then the nodes b1 and node b2 are used as the nodes to be processed.
[0070] It should be understood that when a node (such as a root node) is used as an inserted node for the first time (i.e., when the node source information is added to the target tree structure for the first time), an empty child node can be created under the inserted node (such as when the target tree structure is a quadtree structure, 4 empty child nodes can be created), which is equivalent to initializing an empty node to which the node source information is to be added, and then the empty child node created under the inserted node can be used as a node to be processed under the inserted node, and the empty child node can be a node to which the node source information is not added. Optionally, before adding the node source information to the target tree structure, the hierarchy can be divided based on the maximum node of each node, and an initial tree structure to which the node source information is not added can be created, in which each node except the root node in the initial tree structure has no node source information added, and then each node source information is added to the initial tree structure to obtain the target tree structure.
[0071] It is understandable that the introduction of the quadrant information can refer to the above-mentioned related description, which will not be repeated here. The target to-be-processed node can be the to-be-processed node to which the target node source information is to be added. It is understandable that in the target tree structure, each child node under a node (such as a root node) can correspond to a quadrant, so that the target to-be-processed node to which the target node source information is to be added can be determined from the to-be-processed node of the inserted node based on the quadrant information. For example, when the target tree structure is a quadtree structure, the to-be-processed node inserted under the node can include 4 child nodes, namely, node b1, node b2, node b3, and node b4, wherein node b1, node b2, node b3, and node b4 correspond to quadrant 1, quadrant 2, quadrant 3, and quadrant 4, respectively. If the quadrant information corresponding to the target node source information is quadrant 1, the node b1 in the to-be-processed node can be used as the target to-be-processed node.
[0072] It should be understood that, further, the target node source information can be added to the target node to be processed, and then the target tree structure corresponding to the three-dimensional virtual object is determined based on the target node to be processed to which the target node source information is added. It should be understood that after each node source in the node source list is used as the target node source information, each node source information can be added to the corresponding target node to be processed, so that the node to which each node source information is added can determine the target tree structure.
[0073] Optionally, an embodiment of the present application may further include the following steps: when the node division level of the target node source information is not the next node division level of the inserted node, obtain the first-level node created under the root node, determine the first-level node to which the target node source belongs from the first-level nodes, and determine the first-level node to which the target node belongs as the updated inserted node; the first-level node is a node on the next node division level of the root node; further, when the node division level of the target node source information is the next node division level of the updated inserted node, obtain the node to be processed under the updated inserted node; the child node to be processed is a node among the child nodes of the inserted node to which the node source information is not added; further, determine the target node to be processed to which the target node source information is to be added from the updated nodes to be processed of the inserted node based on the quadrant information; further, add the target node source information to the target node to be processed, and determine the target tree structure corresponding to the three-dimensional virtual object based on the target node to be processed with the target node source information added.
[0074] Among them, if the node division level of the target node source information is not the next node division level of the inserted node, it means that the target node source information is not the node source information corresponding to the child node of the inserted node, so that the child node of the current inserted node (i.e., the first-level node under the root node) can be used as the new inserted node (i.e., the updated inserted node), so as to determine whether the node division level of the target node source information is the next node division level of the new inserted node. If so, the above steps of obtaining the to-be-processed node under the inserted node, obtaining the quadrant information corresponding to the target node source information, determining the target to-be-processed node to which the target node source information is to be added from the to-be-processed nodes of the inserted node based on the quadrant information, and adding the target node source information to the target to-be-processed node can be repeated. If not, the child node (i.e., the second-level node) of the current inserted node (i.e., the first-level node) is used as the new inserted node, and so on, until the node division level of the target node source information is the next node division level of the inserted node.
[0075] It can be understood that in the embodiment of the present application, a node source insertion function that adds node source information to the target tree structure can be called to insert the target node source information into the corresponding child node under the inserted node (i.e., the determined target node to be processed), and the parameter of the node source insertion function can be the inserted node and the target node source information. Based on this, when the node division level of the target node source information is not the next node division level of the inserted node, the inserted node can be updated, thereby iteratively calling the node source insertion function, so as to add the target node source information to the corresponding child node under the inserted node.
[0076] It is understandable that, in order to determine the first-level node to which the target node source belongs from the first-level node, the quadrant information to which the target node source belongs on the node division level where the first-level node is located can be determined by the level quadrant acquisition function, and then based on the quadrant information to which the target node source belongs on the node division level where the first-level node is located, the first-level node to which the target node source belongs can be determined. It should be understood that the level quadrant acquisition function can be used to obtain the quadrant information of a node on a specified node division level (such as the first level), for example, the parameter of the level quadrant acquisition function can be the name corresponding to the specified node division level (such as the first level) and the node source information. It is understandable that if the node division level passed in is greater than the node division level corresponding to the node source information, the quadrant information on the node division level passed in cannot be obtained, that is, the level quadrant acquisition function can only be used for the quadrant information of the node in its upper layer, and for the lower layer of the node, it is meaningless to obtain its quadrant information.
[0077] It should be understood that when the node division level of the target node source information is the next node division level of the updated inserted node, the processing method of adding the target node source information to the child node under the updated inserted node can refer to the above-mentioned description of adding the target node source information to the child node under the inserted node, and will not be repeated here.
[0078] Specifically, the node source information of each node of the target tree structure includes corresponding model data information; then the embodiment of the present application may also include the following steps: obtaining model data of the three-dimensional virtual object at multiple display quality levels, performing model data division on the model data at each display quality level, and obtaining node model data corresponding to the nodes at the node division level corresponding to each display quality level; one display quality level corresponds to one node division level; further, based on the model data information of the node model data corresponding to each node and the node division level of each node, determining the node source information of each node in the target tree structure to be created; the node model data corresponding to a node is used to determine the node source information of a node.
[0079] It should be understood that, based on the above description, the introduction of the display quality level can refer to the above related description, which will not be repeated here.
[0080] It should be understood that the model data may refer to the geometric structure data corresponding to the three-dimensional virtual object. The model data is stored in the model file. The model data may at least include the geometric data of the model of the three-dimensional virtual object (such as the vertex coordinates, normal vectors, patch information, etc. of the model), texture mapping data (including the texture coordinates, texture maps, etc. of the model), which are not limited here.
[0081] It is understandable that the model data at different display quality levels may have different degrees of model refinement. For example, the higher the display quality level, the more facets there are in the corresponding model data. Conversely, the lower the display quality level, the fewer facets there are in the corresponding model data.
[0082] For example, see Figure 5 , Figure 5 Schematic diagram of the effect of a three-dimensional virtual object at different display quality levels provided by an embodiment of the present application. Figure 5 As shown, a 3D virtual object can be associated with model data at the 3D display quality level, such as Figure 5 The three-dimensional virtual object shown in 501a is a three-dimensional virtual object corresponding to the display quality level K3, and the display quality level K3 is the lowest display quality level. Figure 5The three-dimensional virtual object shown in 502a is a three-dimensional virtual object corresponding to the display quality level K2, and the display quality level K2 is the second lowest display quality level. Figure 5 The three-dimensional virtual object shown in 503a is a three-dimensional virtual object corresponding to the display quality level K1, which is the highest display quality level. It can be seen that the number of facets in the three-dimensional virtual object 503a is greater than the number of facets in the three-dimensional virtual object 502a, and greater than the number of facets in the three-dimensional virtual object 501a, that is, the display quality level K1 is higher than the display quality level K2, and higher than the display quality level K3.
[0083] It can be understood that the node model data can be the model data corresponding to a node. Model data division can be used to indicate the model data corresponding to each node obtained based on the complete model data division on the corresponding display quality level. It can be understood that one display quality level corresponds to one node division level. For example, the node division level corresponding to the root node corresponds to the highest display quality level, the node division level corresponding to the first-level node corresponds to the second-highest display quality level, and so on, which will not be elaborated here. It should be understood that based on the nodes on each node division level, the model data on each display quality level is divided into model data, which can include determining the objects corresponding to each node according to the objects corresponding to each node on the node division level, and determining the model data within the objects corresponding to each node as the node model data corresponding to each node.
[0084] The model data information may refer to the storage path of the model file corresponding to the model data. Based on the model data information, the source information of each node may be determined, and the node model data corresponding to a node is used to determine the node source information of a node. Then, when the node is subsequently rendered, the corresponding node model data may be obtained based on the model data information in the node source information corresponding to the node, so as to render and display the target node based on the obtained node model data, so as to render and display the three-dimensional virtual object.
[0085] Among them, the object node evaluation list can be a list composed of nodes to be evaluated. It can be understood that the number of three-dimensional virtual objects in the virtual scene can be one or more, and the object node evaluation list can be nodes in the target tree structure of all or part of the three-dimensional virtual objects in the virtual scene. For example, the object node evaluation list can only include the nodes of the three-dimensional virtual objects within the field of view of the target camera. That is to say, before determining the object node evaluation list, the cone culling process can be performed based on the field of view of the target camera to obtain the nodes displayed in the field of view of the current image frame, and then the object node evaluation list is determined based on the nodes displayed in the field of view of the current image frame. In this way, only the nodes of the three-dimensional virtual objects within the field of view of the target camera can be evaluated, thereby reducing the amount of data processing for node evaluation.
[0086] In one embodiment, obtaining an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene may include the following steps: when a parameter update of a camera parameter of a target camera is detected, obtaining an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene.
[0087] The target camera may refer to a virtual camera that captures images in a virtual scene. The camera parameters are parameters used by the target camera when capturing images. The camera parameters may include internal parameters of the target camera, which may include information such as the focal length of the camera, and external parameters of the target camera in the virtual scene. The external parameters of the camera may include the position of the target camera in the virtual scene, that is, the three-dimensional coordinates of the target camera in the virtual scene. The external parameters may also include the pitch angle, azimuth angle, and roll angle of the target camera, which are used to control the orientation and viewing angle of the target camera.
[0088] It is understandable that when a picture of a virtual scene can be rendered and displayed, image frames at multiple moments can be rendered, and each image frame can display a three-dimensional virtual object within the field of view of the target camera. When rendering the image frame at the current moment (i.e., the target image frame), the camera parameters of the target camera at the current moment can be obtained, and it is detected whether the camera parameters of the target camera have been updated, and then when the camera parameters of the target camera have been updated, the object node evaluation list for node evaluation is obtained. This is because in the virtual scene, the display of the picture at the current moment will only be changed when the camera parameters of the target camera change (such as position and viewing angle changes). Therefore, when the camera parameters of the target camera are updated, the nodes of the three-dimensional virtual object to be rendered are evaluated, and then there is no need to perform node evaluation when rendering each frame, which helps to reduce the amount of calculation in the rendering process and improve the efficiency of object rendering.
[0089] It can be understood that detecting whether there is any parameter update of the camera parameters of the target camera can be obtained by comparing the camera parameters at the current moment with the camera parameters at the moment corresponding to the previous image frame. If the camera parameters at the current moment are the same as the camera parameters at the moment corresponding to the previous image frame, it is determined that there is no parameter update of the camera parameters of the target camera. Conversely, if the camera parameters at the current moment are different from the camera parameters at the moment corresponding to the previous image frame, it is determined that there is a parameter update of the camera parameters of the target camera.
[0090] Optionally, in some scenes, the camera parameters of the target camera (such as the position and viewing angle of the camera, etc.) are adjusted through a control operation, and the control operation can be an operation to control the target camera, such as being controlled by an interactive device (such as a mouse, keyboard, display screen, handle, etc.). Therefore, it can be determined whether the camera parameters of the target camera have been updated by determining whether the control operation is detected. If the control operation is detected, it is determined that the camera parameters of the target camera have been updated. Conversely, if the control operation is not detected, it is determined that the camera parameters of the target camera have not been updated. For example, the method for updating the model data of the three-dimensional virtual object through node evaluation can be written after the method for detecting the control operation, so that after detecting that the control operation controls the target camera to change the current picture, the model data of the three-dimensional virtual object can be evaluated through the node, so that there is no need to call the method for processing the model data of the three-dimensional virtual object through node evaluation when rendering each image frame, thereby saving a certain amount of computer performance and improving the rendering efficiency of the virtual scene.
[0091] S102, obtaining the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map.
[0092] The target texture map may be a texture map corresponding to the target node, and the texture map may be obtained from the node model data corresponding to the target node.
[0093] It is understandable that the image complexity can be used to describe the amount of information contained in the texture map. The higher the image complexity of the texture map, the greater the amount of information contained in the texture map, and the easier it is for people to pay attention to the part corresponding to the texture map. Therefore, it is necessary to display it with better display quality to avoid the user seeing the area with a large amount of information in the picture with low display quality, thereby improving the final rendering quality of the virtual scene.
[0094] It is understandable that in the embodiment of the present application, the image complexity of the texture map can be determined based on the image information entropy, which can be used to describe the amount of information contained in an image and can also reflect the complexity of the image texture content. The information entropy of the image can be used to reflect the randomness and complexity of the texture map of the image. For the nodes of the three-dimensional virtual object, the greater the randomness and complexity of the image texture of the texture map, the greater the terrain changes in the area of the node. Therefore, the information entropy of the texture map can reflect the amount of ground object information contained in the node to a certain extent. It can be understood that in the embodiments of the present application, the image information entropy can adopt the one-dimensional information entropy of the image, which can represent the amount of information contained in the distribution and aggregation characteristics of the grayscale in the image. This is because the texture map contains UV information (UV coordinate information) in addition to the texture information, so that each pixel in the texture map can be accurately drawn to the corresponding position of the three-dimensional virtual object according to the UV texture coordinate information. When the texture map is opened with an image viewing application, due to the relationship between the UV coordinates, the adjacent pixels in the texture map are not necessarily adjacent to the model geometry. Therefore, the two-dimensional information entropy that can reflect the spatial distribution of grayscale is not suitable for calculating the complexity of the texture map of the three-dimensional virtual object. Therefore, the one-dimensional information entropy is used to determine the image complexity of the texture map.
[0095] Specifically, obtaining the image complexity of a target texture map corresponding to a target node may include the following steps: obtaining the target texture map corresponding to the target node, graying the target texture map, and obtaining a grayscale texture image of the target texture map; further, determining a target pixel whose grayscale value is a target grayscale value from the grayscale texture image, and culling the target pixel in the grayscale texture image; further, counting pixels of each grayscale value in the grayscale texture image after culling the target pixel, obtaining a grayscale value ratio corresponding to each grayscale value, and determining the image information entropy of the target texture map based on the grayscale value ratio of each grayscale value; further, performing a weighted conversion process on the image information entropy to obtain the image complexity of the target texture map.
[0096] Among them, the target texture map may refer to the texture map of the target node. Based on the above description, it can be known that the node model data corresponding to the target node may include the texture map of the target node. Grayscale processing may be a method of converting the pixel values of each pixel in the target texture map into grayscale values. The grayscale texture image may be an image obtained by grayscale processing the target texture map. Among them, the grayscale value refers to the value obtained by grayscale processing the pixel value, and the grayscale value ranges from 0 to 255, representing 256 grayscale levels from black to white. For example, the target texture map may be a three-channel image with three color channels of red, green and blue, and the values of the target texture map on the three color channels may be converted into a grayscale value with a value range of 0 to 255.
[0097] The target grayscale value may be a grayscale value of 0, and the target pixel may be a pixel whose grayscale value is the target grayscale value, that is, a black pixel. This is because, in most virtual scenes, pure black pixels basically do not exist, so black pixels can be removed from the grayscale texture image, thereby calculating the information entropy based on the grayscale values of other pixels except black pixels.
[0098] The gray value ratio may be the ratio of pixels corresponding to each gray value in the gray texture image after the target pixel is removed to all pixels.
[0099] The method for determining the image information entropy of the target texture map based on the grayscale value ratio of each grayscale value can be calculated by the following formula (1).
[0100] S=-∑p i ×log2p i Formula (1)
[0101] Among them, S is the image information entropy, p i is the grayscale value ratio of the grayscale value i.
[0102] It can be understood that weighted conversion processing of image information entropy can be used to indicate the conversion of image information entropy to obtain a value more suitable for node evaluation as image complexity. This is because after calculating the information entropy of texture maps of a large number of nodes, it is found that the image information entropy of each texture map is mainly scattered between the target range (such as 4 to 7). In order to control the results of node evaluation to be concentrated in the range of 0.5 to 1, the image complexity can be obtained by weighted conversion processing of the image information entropy of the texture map.
[0103] The method of weighted conversion processing of image information entropy can be calculated by the following formula (2):
[0104] P=(S-1) / 6 Formula (2)
[0105] Among them, P is the image complexity and S is the image complexity.
[0106] It should be understood that for an observer of a virtual scene (i.e., a user who views the screen of the virtual scene, such as a game user), the information that the observer wants to obtain from the virtual scene is more about the spatial distribution of objects, the appearance and shape of buildings, etc., while common terrains such as grasslands, wastelands, lakes, etc. are not of high interest. Therefore, the rendering of objects of common terrain using model data with higher display quality is a rendering and drawing overhead that has little effect. Reducing the drawing of this part of the model can improve the computing speed and optimize the scene roaming experience without affecting the overall spatial scene three-dimensional model perception. It should be understood that common natural terrain generally does not have obvious color distribution changes in the same area, while artificial buildings or the junctions between different terrains are often accompanied by strong texture changes. Therefore, the texture map of the node can be used to determine whether the node belongs to the node that the observer wants to focus on. If the color change of the texture map is large and the image complexity is high, it means that the node can provide more information to the observer and should be displayed in the overall virtual scene. On the contrary, the display quality of the node with low image complexity of the texture map should be lower than the former (i.e., the display quality of the node with high image complexity of the texture map).
[0107] For example, see Figure 6 , Figure 6 is a comparative schematic diagram of a texture map provided in an embodiment of the present application. Figure 6 As shown, 601a shows a node object corresponding to a node b11 on the first node division level in a target tree structure of a virtual lake (i.e., a three-dimensional virtual object), and 602a shows a node object corresponding to a node b21 on the first node division level in a target tree structure of a virtual building (i.e., a three-dimensional virtual object). Then, the texture map (such as Figure 6 603a in FIG), the texture map in the node model data of the node b21 in the virtual building (as shown in FIG. Figure 6 Further, the texture map (such as Figure 6 603a in FIG. 6) to perform complexity calculation to obtain a texture map (such as Figure 6 The image complexity t1 (as shown in 603a in FIG. Figure 6 605a in FIG. 1 ), and the texture map (such as Figure 6 604a in FIG. 6 ) to perform complexity calculation to obtain a texture map (such as Figure 6 The image complexity t2 (as shown in 604a in FIG. Figure 6 As shown in 606a in FIG. 1 , it can be seen that Figure 6 The color variation of the texture map shown in 603a is less than that shown in Figure 6 The color change of the texture map shown in 604a in FIG. 6 , therefore, the image complexity t1 is less than the image complexity t2.
[0108] It can be understood that in an embodiment of the present application, in order to improve the efficiency of rendering and displaying the virtual scene, the image complexity of the texture map of the node of each three-dimensional virtual object can be pre-calculated, and the determined image complexity of each node can be stored. When it is necessary to perform node evaluation on each node in the object node evaluation list, the node evaluation can be performed by directly obtaining the pre-calculated image complexity.
[0109] It should be understood that, based on the above description, when constructing the target tree structure, each node can be inserted into the quadtree based on the node source information list corresponding to the tree structure. Therefore, the texture map of each node in the target tree structure can be read one by one according to this node source information list, and the information entropy of the texture map of each node can be calculated, so as to determine the image complexity of each texture map based on the information entropy. Then, the image complexity of each node is added to the attribute data of the node source information of the node with the same name through the node source information list for subsequent node evaluation. Since the file name of the texture map is the file name of the node model data plus the suffix "_0", the corresponding texture map can be opened according to the node name in the node source information list. After reading the texture map, the image complexity of the texture map of each node can be determined based on the above-mentioned processing process, and finally the node name corresponding to the texture map and the corresponding image complexity are used to generate a table (such as a complexity table) for recording the image complexity of each node, such as a table file in a .csv format. Then, when the node evaluation is performed later, the complexity table can be read, and the image complexity of the texture map of the node to be evaluated can be obtained. Optionally, after determining the complexity table, the image complexity of each node can be used as the attribute data of the node source information of the corresponding node, and the image complexity can be entered into the corresponding node through the name (i.e., identifier) of each node in the node source information list of the target tree structure. After the image complexity of all nodes is added to the corresponding node, the attribute data can be used as a weighting factor to calculate the final node evaluation result during the node evaluation.
[0110] S103 . Determine target size information of the target node bounding box based on the target node bounding box to which the target node belongs.
[0111] The target node bounding box may be a node bounding box corresponding to the target node. The node bounding box may be a three-dimensional bounding volume that can completely contain the corresponding node, that is, a three-dimensional bounding volume that can surround the node object corresponding to the corresponding node. The node object may refer to an object rendered by the node model data corresponding to a node, and the node object of the root node is a three-dimensional virtual object rendered based on the model data with the lowest display quality level. The shape of the node bounding box may be a cube, a cuboid, etc. that surrounds the target node, which is not limited here.
[0112] Specifically, the target tree structure includes a target tree structure, and the nodes in the target tree structure include a first node and a second node; the second node is a child node of the first node; then, an embodiment of the present application may also include: obtaining a first node bounding box of the first node; the first node bounding box is associated with a node coordinate system corresponding to the first node; the node coordinate system is an origin at the center position of the first node bounding box; further, multiple quadrants are determined in the node coordinate system corresponding to the first node, and the first node bounding box is divided into bounding boxes based on the multiple quadrants to obtain sub-bounding boxes corresponding to each quadrant; the sub-bounding box corresponding to each quadrant includes a second node; further, based on the second node in the sub-bounding box corresponding to each quadrant, the second node bounding box of the second node is determined.
[0113] Among them, the first node can be a node on any node division level other than the lowest node division level. For example, in a target tree structure including three node division levels (i.e., root level, first level, and second level), the first node can be any node among the root node and the first level node. The second node can be a child node of the first node. For example, when the first node is a root node, the first node can be any first level node. When the first node is any first level node, the second node can be any second node under any first level node. It should be understood that the node division level of the second node is the next node division level of the node division level of the first node.
[0114] The first node bounding box can be the node bounding box corresponding to the first node. When the first node is a root node, the first node bounding box can be directly based on the bounding box of the node object corresponding to the root node of the three-dimensional virtual object. When the first node is not a root node, the first node bounding box is obtained by dividing the bounding box based on the bounding box of the parent node of the first node. The first node bounding box is associated with the node coordinate system of the first node. For the introduction of the node coordinate system, please refer to the above-mentioned related description, which will not be repeated here. It should be understood that the origin of the node coordinate system can be the center position of the first node bounding box, that is, the position of the node center corresponding to the first node, and the coordinate axes of the node coordinate system are parallel to the edges corresponding to the first node bounding box.
[0115] The sub-bounding box refers to the bounding box obtained by dividing the first node bounding box. The first node bounding box is divided into sub-bounding boxes according to the coordinate axes used to determine the multiple quadrants.
[0116] It should be understood that the sub-bounding box corresponding to each quadrant includes the second node. The second node bounding box can be the bounding box corresponding to the second node. It can be understood that the second node bounding box of the second node can be determined based on the second node in the sub-bounding box corresponding to each quadrant. The sub-bounding box corresponding to each quadrant can be directly determined as the node bounding box of the second node (i.e., the bounding box of the node object corresponding to the second node), or it can be determined based on the minimum enclosing space of the second node in the sub-bounding box corresponding to each quadrant. It is not limited here and can be determined according to actual needs. It can be understood that the minimum enclosing space of the second node can be determined based on the width of the second node on each coordinate axis of the node coordinate system corresponding to the first node. For example, the width of the second node on the x-axis is x1, the width on the y-axis is y1, and the width on the z-axis is z1. Then the minimum enclosing space of the second node can be a cuboid with side lengths of x1, y1, and z1, respectively.
[0117] It is understandable that when determining the second node bounding box of the second node based on the minimum bounding space of the second node in the sub-bounding box corresponding to each quadrant, if the size of the minimum bounding space of the second node is consistent with the size of the sub-bounding box of the second node, the sub-bounding box of the second node can be directly determined as the node bounding box of the second node; if the size of the minimum bounding space of the second node is inconsistent with the size of the sub-bounding box of the second node, the node bounding box of the second node can be determined based on the minimum bounding space of the second node. It is understandable that when the size of the minimum bounding space of the second node is inconsistent with the size of the sub-bounding box of the second node, the size of the minimum bounding box space of the second node is smaller than the size of the sub-bounding box of the second node.
[0118] It should be understood that in an embodiment of the present application, when the target node is a root node, the bounding box of the target node can be the node bounding box corresponding to the root node of the above-mentioned three-dimensional virtual object. When the target node is not a root node, the node bounding box of the target node can be determined by referring to the above-mentioned method of determining the second node.
[0119] For example, see Figure 7 , Figure 7: This is a schematic diagram of a scene divided by a bounding box provided in an embodiment of the present application. The node bounding box of the root node of the three-dimensional virtual object 702a (i.e., the object bounding box of the three-dimensional virtual object) is bounding box 701a, and then the bounding box 701a can be associated with a corresponding node coordinate system, the origin of the node coordinate system is the center position of the bounding box 701a, and it can be divided into four quadrants (quadrant 1, quadrant 2, quadrant 3, and quadrant 4) based on the x-axis and y-axis of the node coordinate system (i.e., the quadrant division coordinate axes are the x-axis and the y-axis). Furthermore, the node within the bounding box 701a can be determined as the first node, then the bounding box 701a is the first node bounding box, and the child node of the node within the bounding box 701a (i.e., the first-level node) is the second node. The bounding box 701a can be divided into bounding boxes based on the quadrants of the node coordinate system associated with the bounding box 701a (i.e., step S71) to obtain the sub-bounding boxes corresponding to each quadrant in the node coordinate system corresponding to the bounding box 701a, and then the bounding boxes of the first-level nodes corresponding to each quadrant under the root node can be determined based on the sub-bounding boxes corresponding to each quadrant (i.e., the first-level node is the second node, and the bounding box of the first-level node is the second node bounding box). For example, in the node coordinate system corresponding to the bounding box 701a, the sub-bounding box corresponding to quadrant 3 can be as follows Figure 7 As shown in 703a in FIG. 1 , the bounding box of the first-level node corresponding to quadrant 3 in the node coordinate system of the root node is the bounding box 703a.
[0120] Furthermore, the first node can be updated through the nodes within the bounding box 703a to obtain a new first node. The bounding box 703a is then the new first node bounding box, and the child nodes (i.e., the second-level nodes) of the nodes within the bounding box 703a are determined as new second nodes. The node coordinate system associated with the bounding box 703a can then be determined. The origin of the node coordinate system is the center position of the bounding box 703a, which can be divided into four quadrants (quadrant 1, quadrant 2, quadrant 3, and quadrant 4) based on the x-axis and y-axis of the node coordinate system (i.e., the quadrant division coordinate axes are the x-axis and the y-axis). Furthermore, based on the quadrants corresponding to the node coordinate system of bounding box 703a, bounding box 703a can be divided into bounding boxes (i.e., step S72) to obtain sub-bounding boxes corresponding to each quadrant in the node coordinate system corresponding to bounding box 703a, and then the bounding boxes of the second-level nodes corresponding to each quadrant under the first-level node can be determined based on the sub-bounding boxes corresponding to each quadrant (i.e., the second-level node is the second node, and the bounding box of the second-level node is the second node bounding box). For example, in the node coordinate system corresponding to bounding box 703a, the sub-bounding box corresponding to quadrant 4 can be as follows: Figure 7 As shown in 704a in the figure, in the node coordinate system of the nodes within the bounding box 703a, the bounding box of the second-level node corresponding to quadrant 4 is the bounding box 704a.
[0121] It is understandable that the target size information may be information for describing the size of the target node bounding box. It is understandable that the target size information may be the length of the side of the target coordinate axis of the node coordinate system parallel to the target node bounding box, and the target coordinate axis may be a coordinate axis of the node coordinate system, for example, the target coordinate axis may be the x-axis.
[0122] S104: Based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, perform node evaluation on the target node to obtain a node evaluation result of the target node.
[0123] The camera viewing distance may refer to the distance between the node bounding box and the position of the target camera, such as the distance between the center position of the node bounding box and the position of the target camera.
[0124] Among them, the node evaluation result can be the result obtained by performing node evaluation on the target node. The node evaluation result can be used to indicate whether the target node meets the rendering display conditions, and can also indicate whether the target node meets the fuzzy display conditions. It can be understood that in the embodiment of the present application, the node evaluation of the image complexity of the fusion texture map can intelligently identify and prioritize the areas of high user attention in the rendering scene, ensuring the rendering quality on key visual elements. In addition, the embodiment of the present application simplifies the interaction process between the user and the virtual scene, provides a more intuitive and natural picture, and displays virtual objects that are easily noticed by the user with better display quality, thereby enhancing the user's immersion and satisfaction.
[0125] It can be understood that based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, performing node evaluation on the target node to obtain the node evaluation result of the target node can include the following steps: based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, determining an evaluation index; further, determining the node evaluation result based on the evaluation index.
[0126] The evaluation index may be a value used to evaluate whether the display quality of a node meets the current display quality requirement. For example, the evaluation index may be determined based on the following formula (3):
[0127]
[0128] Among them, f is the evaluation index, d is the target size information, P is the image complexity, and C is a constant for controlling the evaluation index. The larger C is, the higher the display quality required for the current scene to be rendered. Therefore, the size of C can be adjusted according to requirements to control the improvement or reduction of the overall display quality of the virtual scene, which can specifically be determined according to the computing performance of the computer device.
[0129] It should be understood that if the evaluation index of the target node is less than the first value (such as 1), it means that the target node does not meet the current picture display quality requirements (i.e., does not meet the rendering display conditions). Therefore, the display quality of the target node can be improved, that is, the three-dimensional virtual object can be rendered and displayed based on more refined model data (i.e., model data at a higher display quality level), that is, the three-dimensional virtual object can be displayed based on the node corresponding to the child node of the current node at the node division level. On the contrary, if the evaluation index of the target node is greater than or equal to the first value (such as 1), it means that the target node meets the current picture display quality requirements (i.e., meets the rendering display conditions). Therefore, it is not necessary to improve the display quality of the target node, that is, the display of the node at the current node division level can be maintained. Optionally, if the evaluation index of the target node is greater than the first value (such as 1) and greater than the second value (such as 2), it means that the target node not only meets the current picture display quality requirements but also is higher than the current picture display quality requirements (i.e., meets the fuzzy display conditions). Therefore, the display quality of the target node can be reduced, that is, the three-dimensional virtual object can be rendered and displayed based on coarser model data (i.e., model data at a lower display quality level), that is, the three-dimensional virtual object can be displayed based on the node corresponding to the parent node of the current node at the node division level.
[0130] For example, the processing process of node evaluation can be described with reference to the following code:
[0131] bool isNeedToSplit(Q_TileNode node, int C)
[0132] { Vector3 camPos = Camera.main.transform.position; / / Get the position of the target camera float dis = Vector3.Distance(node.bound.center, camPos); / / The distance from the node bounding box to the position of the target camera, i.e., the camera viewing distance
[0133] if (dis / node.bound.size.x / <C) / / Node evaluation formula
[0134] { return true;} / / Need to improve the display quality
[0135] else
[0136] {return false}; / / No need to improve the display quality
[0137] Among them, in dis / node.bound.size.x / <C, dis refers to the camera viewing distance, node.bound.size.x refers to the size information of the node bounding box, and C is the constant for the above control evaluation index. After transformation, the formula for evaluating this node is That is, the evaluation index f < 1.
[0138] S105. If the node evaluation result indicates that the target node meets the rendering display condition and the target node is within the viewing range corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, render and display the target node and hide the child nodes of the target node.
[0139] It can be understood that the rendering display condition can be the condition that needs to be met for the rendering display timing based on the corresponding node. For example, the rendering display condition can be that the evaluation index of the target node is greater than or equal to a first value (such as 1).
[0140] It should be understood that the viewing range of the target camera can be the visible range of the target camera, and this viewing range can be the spatial range indicated by the frustum corresponding to the target camera. The frustum of the target camera can be the visible spatial range of the target camera. It can be understood that if each node in the above object node evaluation list is determined based on the first display node list located within the viewing range determined by the viewing range, then when determining the node evaluation result, it can be directly determined that the target node is within the viewing range corresponding to the target camera. If each node in the above object node evaluation list is a node at a certain level of division of a node among all three-dimensional virtual objects, then when determining the node evaluation result, it is also possible to determine whether the target node is within the viewing range corresponding to the target camera, so that when the target node is not within the viewing range corresponding to the target camera, the target node can be directly hidden.
[0141] For example, please refer to Figure 8 , Figure 8 which is a schematic diagram of the effect of the frustum of a target camera provided by an embodiment of the present application. As Figure 8 shown, the frustum corresponding to the target camera 801a can be referred to as the frustum 802a shown in Figure 8 . The frustum can include 6 planes, and the viewing range of the target camera can be the spatial range indicated by the frustum 802a.
[0142] Specifically, node source information is added to the target node, and the node source information of the target node includes model data information of the node model data of the target node; then, if the node evaluation result indicates that the target node meets the rendering and display conditions, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are hidden, which may include the following steps: if the node evaluation result indicates that the target node meets the rendering and display conditions, and the target node is located within the field of view corresponding to the target camera, then the target node is added to the to-be-displayed node stack associated with the virtual scene, and the child nodes of the target node are added to the first hidden node list associated with the virtual scene; the first hidden node list may be a hidden node list determined based on the field of view of the target camera; further, when rendering and displaying the three-dimensional virtual object, the target node is popped from the to-be-displayed node stack, the model data information in the node source information of the target node is obtained, the node model data of the target node is obtained, and the target node is rendered and displayed based on the node model data of the target node.
[0143] It is understandable that the node stack to be displayed can be a stack structure for storing nodes to be rendered and displayed that are determined based on the node evaluation results. It is understandable that the stack structure has a first-in-first-out feature, that is, the node that first enters the node stack to be displayed is popped out first, and the popped nodes are rendered and displayed, so that after determining the nodes to be rendered and displayed corresponding to each three-dimensional virtual object of the virtual scene, the determined nodes can be added to the stack to be displayed, so that the nodes in the node stack to be displayed can be popped out in sequence according to the order in which the nodes are stacked, so as to render and display each node to be displayed in sequence.
[0144] It is understandable that the first hidden node list can be a hidden node list determined based on the field of view of the target camera. The determination method of the first hidden node list and the first display node list can refer to the above-mentioned related description, which will not be repeated here. It should be understood that since the target node is located within the field of view of the target camera, the display node list associated with the virtual scene can include the target node.
[0145] It should be understood that, based on the above description, the node source information of each node in the target tree structure may include model data information of the node model data (such as the model file path of the node model data). It should be understood that the node model data of the target node can be obtained based on the model data information of the target node, so that the node model data of the target node can be loaded, and then the target node can be rendered and displayed based on the loaded node model data, that is, a three-dimensional virtual object can be displayed based on the rendered and displayed target node. It can be understood that in the embodiment of the present application, the model file corresponding to the model data corresponding to a three-dimensional virtual object is stored based on the node division structure of the target tree structure. For example, the root node corresponds to a folder, in which a model file for recording the node model data of the root node can be stored. Under the folder corresponding to the root node, it can also include folders corresponding to each first-level node, and then the model file for recording the node model data of each first-level node is stored under the folder corresponding to each first-level node; further, under the folder corresponding to each first-level node, it can also include folders corresponding to each second-level node under the corresponding first-level node, and then the model file for recording the node model data of each second-level node is stored under the folder corresponding to each second-level node. Further, the model data information of the target node can be the file path of the model file of the node model data of the target node.
[0146] Optionally, rendering and displaying the target node based on the node model data of the target node may include the following steps: after instantiating the three-dimensional virtual object in the virtual scene, obtaining a target display node list associated with the virtual scene; the target display node list includes the target node; performing a node loading test on the target node to obtain a node display test result of the target node; if the node display test result is used to indicate that the target node loading failed, adding the target node in the target display node list to a temporary processing list, reloading the node model data of the target node, and rendering and displaying the target node based on the reloaded node model data.
[0147] It should be understood that instantiation can be a process of generating an object based on model data, and instantiating a three-dimensional virtual object in a virtual scene can be to generate a node object based on the node model data of the node corresponding to the three-dimensional virtual object, thereby determining the three-dimensional virtual object based on the node object.
[0148] It should be understood that the target display node list can be a list of nodes for rendering and display in the virtual scene, that is, each node in the object node list is evaluated, and the final display node list is determined based on the node evaluation result. It is understood that in the embodiment of the present application, the final hidden node list can also be determined based on the node evaluation result, and the final hidden node list can be called the target hidden node list.
[0149] Among them, node display detection can be used to detect whether the node is loaded successfully. It can be understood that the three-dimensional virtual object in the virtual scene can use gameObject as the base class, and when the model data of the three-dimensional virtual object is loaded, and the three-dimensional virtual object is instantiated into the virtual scene based on the loaded model data, the three-dimensional virtual object is used as a subclass of the node object corresponding to the node in the target display node list, and then the target node can be judged by judging whether the subclass of the node object of the target node is empty. Whether the target node is loaded successfully or not. Specifically, all nodes in the target display list can be traversed. If the number of subclasses of the node object corresponding to each node is 0, it means that the node fails to load, and then the nodes that failed to load in the target display node list are added to the temporary processing list tempDic. Then, the node model data of each node (such as the target node) in the temporary processing list can be reloaded, so as to render and display the target node based on the node model data of the reloaded target node. It is understandable that after traversing the target display node list, the nodes added to the temporary processing list that have loading problems can be processed. Specifically, the information of the nodes in the temporary processing list can be saved to the nodes in the corresponding target tree structure, and the node object corresponding to the node can be destroyed from the memory. Finally, the node model data is reloaded through the recorded node information, and the corresponding node object is instantiated in the virtual scene based on the node model data, so as to determine the three-dimensional virtual object based on the node object of each node, and then render the picture of the virtual scene (i.e., image frame).
[0150] For example, see Fig. 9 , Fig. 9 is a flow chart of a rendering display process provided by an embodiment of the present application. First, the camera parameters of the target camera can be determined ( Fig. 9 As shown in S901a in FIG. 1 , the camera parameters can be introduced in the above-mentioned related description, which will not be described here. Then, the frustum culling process is performed based on the field of view of the target camera ( Fig. 9 As shown in S902a in the figure), that is, the above-mentioned determination of the nodes within the field of view of the target camera. Then, node evaluation is performed, and the displayed nodes are determined based on the node evaluation results ( Fig. 9As shown in S903a in the figure, it can be understood that the node evaluation here may include the above-mentioned acquisition of the object node evaluation list, and then the node evaluation is performed on each node in the object node evaluation list through the processing process of the above-mentioned steps S102-S104, and the node evaluation results of each node in the object node evaluation list are obtained, so as to hide and close the nodes based on the node evaluation results of each node, that is, to obtain the target display node list and the target hidden node list. Further, the nodes in the display node list (that is, the target display node list) can be subjected to node loading detection ( Fig. 9 As shown in S904a in the figure, the method for performing node loading detection can refer to the above-mentioned related description, which will not be repeated here. When it is detected that a node in the target display node fails to load, the node can be reloaded, so as to render based on the newly loaded node. Further, the output image frame can be rendered ( Fig. 9 As shown in S905a in the figure), the rendering and outputting of the image frame here can be based on the instantiation of the corresponding three-dimensional virtual object based on the model data of each node loaded, so as to render and output the image frame based on each three-dimensional virtual object to display the image frame. In the embodiment of the present application, the drawing of model nodes that are less concerned by the observer can be reduced, and the drawing of some model nodes can be reduced to optimize the rendering rate of the overall spatial scene. In addition, the present application can use the calculation of image complexity as preliminary preparation work, and after the calculation is completed, the image complexity of each node model is recorded in the quadtree node class, and the image complexity is directly called to participate in the node evaluation during the virtual roaming process, thereby improving the efficiency of node evaluation.
[0151] For further information, see Fig.10 , Fig.10 1 is a flowchart of a tree-structured object rendering method provided by an embodiment of the present application. The method can be executed by the above-mentioned terminal device or server, for example, the terminal device can be the above-mentioned device 11a, and the server can be the above-mentioned server 100a. The method can at least include the following steps S201-S206.
[0152] S201, obtaining an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object.
[0153] It should be understood that in an embodiment of the present application, before determining the object node evaluation list, the visible three-dimensional virtual objects can be determined based on the field of view of the target camera (i.e., a frustum culling process can be performed), and then only the nodes of the three-dimensional virtual objects within the field of view of the target camera can be evaluated. In this way, node evaluation is not performed on the nodes of the three-dimensional virtual objects that are invisible to the target camera, thereby reducing the amount of data processing and improving rendering efficiency.
[0154] Specifically, there are multiple three-dimensional virtual objects in the virtual scene; each three-dimensional virtual object corresponds to a target tree structure; the method also includes: in the virtual scene, determining the field of view indicated by the viewing cone corresponding to the target camera; further, based on the positional relationship between the field of view and the object bounding box of each three-dimensional virtual object, performing node detection on each three-dimensional virtual object to obtain a node detection result for each three-dimensional virtual object; the node detection result is used to indicate that the three-dimensional virtual object is within the field of view, or, to indicate that the three-dimensional virtual object is not within the field of view; further, based on the node detection result of each three-dimensional virtual object, determining a first hidden node list and a first display node list associated with the virtual scene; further, determining an object node evaluation list based on the nodes in the first display node list.
[0155] It should be understood that the positional relationship between the field of view and the object bounding box of each three-dimensional virtual object may include that the object bounding box is completely within the field of view, the object bounding box is partially within the field of view, and the object bounding box is outside the field of view.
[0156] It should be understood that performing node detection on each 3D virtual object may be detecting whether each 3D virtual object is within the field of view, and the node detection result may be the result obtained by performing node detection on the 3D virtual object. It should be understood that the node detection result is used to indicate that the 3D virtual object is within the field of view, or to indicate that the 3D virtual object is not within the field of view.
[0157] It is understandable that the node detection result is used to indicate that the three-dimensional virtual object is within the field of view, which may include that the three-dimensional virtual object is entirely within the field of view, or that the three-dimensional virtual object is partially within the field of view. It should be understood that if the object bounding box is entirely within the field of view, the node detection result is used to indicate that the three-dimensional virtual object is entirely within the field of view, that is, it is used to indicate that the three-dimensional virtual object is within the field of view; if the object bounding box is partially within the field of view, the node detection result is used to indicate that the three-dimensional virtual object is partially within the field of view, that is, it is used to indicate that the three-dimensional virtual object is within the field of view. It should be understood that if the object bounding box is not within the field of view, the node detection result is used to indicate that the three-dimensional virtual object is not within the field of view (that is, the three-dimensional virtual object is outside the field of view).
[0158] It should be understood that the first hidden node list may be a list of hidden nodes determined based on the field of view, and the first display node list may be a list of nodes to be rendered and displayed determined based on the field of view. Further, the object node evaluation list may be determined based on the nodes in the first display node list, thereby only performing node evaluation on the nodes of the three-dimensional virtual objects within the field of view, thereby reducing the amount of data calculation and improving rendering efficiency.
[0159] Specifically, the object node evaluation list is the object node evaluation list determined when rendering and displaying the target image frame; then, based on the node detection results of each three-dimensional virtual object, the first hidden node list and the first display node list associated with the virtual scene are determined, including: obtaining the second display node list and the second hidden node list determined when rendering the previous image frame of the target image frame; further, based on the node detection results of each three-dimensional virtual object, the second display node list and the second hidden node list are updated to obtain the first hidden node list and the first display node list associated with the virtual scene.
[0160] The target image frame may be the image frame currently to be rendered and displayed. The second display node list may be the display node list when rendering and displaying the previous image frame of the target image frame, and the second hidden node list may be the hidden node list when rendering and displaying the previous image frame of the target image frame.
[0161] It should be understood that after updating the second display node list based on the node detection results of each three-dimensional virtual object, the first display node list can be obtained, and after updating the second hidden node list based on the node detection results of each three-dimensional virtual object, the first hidden node list can be obtained.
[0162] Specifically, the target three-dimensional virtual object is included in the multiple three-dimensional virtual objects in the virtual scene; then, based on the node detection results of each three-dimensional virtual object, the second display node list and the second hidden node list are updated to obtain the first hidden node list and the first display node list associated with the virtual scene, including: if the second display node list includes the target display node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is located outside the field of view, then the target display node is added to the waiting hidden node list; further, based on the target display node in the waiting hidden node list, the second hidden node list is updated to obtain the first hidden node list; further, the target display node is removed from the second display node list to obtain the first display node list.
[0163] The target 3D virtual object may be any 3D virtual object among a plurality of 3D virtual objects in the virtual scene. It should be understood that the target display node may be a node corresponding to the target 3D virtual object included in the second display node list, for example, the target display node may be a root node, or a first-level node, etc., which is not limited here.
[0164] It can be understood that the second display node list includes the target display node, and the node detection result of the target three-dimensional virtual object is used to indicate that the three-dimensional virtual object is outside the field of view, which means that when the target image frame is displayed, the target three-dimensional virtual object is no longer in the field of view, and the target display node can be added to the waiting hidden node list; further, the second hidden node list is updated based on the target display node in the waiting hidden node list to obtain the first hidden node list, and then the target display node is removed from the second display node list to obtain the first display node list.
[0165] It should be understood that if the second display node list includes the target display node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is within the field of view, the target display node will be maintained in the second display node list to obtain the first display node list, and the second hidden node list will be determined as the first hidden node list.
[0166] Specifically, the target three-dimensional virtual object is included in the multiple three-dimensional virtual objects in the virtual scene; then, based on the node detection results of each three-dimensional virtual object, the second display node list and the second hidden node list are updated to obtain the first hidden node list and the first display node list associated with the virtual scene, including: if the second display node list does not include any node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is within the field of view, then the node detection result of the target three-dimensional virtual object is added to the second display node list to obtain the first display node list associated with the virtual scene; further, the root node of the target three-dimensional virtual object is removed from the second hidden node list to obtain the first hidden node list associated with the virtual scene.
[0167] It should be understood that the second display node list does not include any node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is within the field of view, which means that when the target image frame is displayed, the target three-dimensional virtual object has just entered the field of view. The node detection result of the target three-dimensional virtual object can be added to the second display node list to obtain the first display node list associated with the virtual scene; further, the root node of the target three-dimensional virtual object is removed from the second hidden node list to obtain the first hidden node list associated with the virtual scene.
[0168] It should be understood that if the second display node list does not include any node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is outside the field of view, the second display node list is used as the first display node list, and the second hidden node list is determined as the first hidden node list.
[0169] It can be understood that in the embodiment of the present application, each process of rendering and displaying the virtual scene first traverses the three-dimensional model files (i.e., files for storing model data) of all three-dimensional virtual objects, and determines the structural position information of each node in the quadtree through the naming rules of the tree structure. Secondly, this information is recorded and constructed into a tree structure class (such as a quadtree class) to facilitate determining the hierarchical relationship between each node, that is, determining the node division level at which each node is located. Finally, each node can be loaded, displayed or hidden according to the real-time orientation relationship between the target camera and the node. Specifically, the rendering process of the virtual scene can be specifically processed based on the resource loading component and the real-time update component, and can specifically include: ① model data input, that is, inputting the model data of all three-dimensional virtual objects in the virtual scene. ② resource loading is performed through the resource loading component, that is, reading the area information of the virtual scene, traversing all model data, and constructing the target tree structure corresponding to each three-dimensional virtual object in the virtual scene. ③ real-time update display of the virtual scene is performed through the real-time update component, that is, the virtual scene can be initialized, and then the cone culling is performed in real time to display or hide the nodes of the three-dimensional virtual object, and the display quality of the three-dimensional virtual object is adjusted based on the node evaluation result. ④ Render the virtual scene and output the picture of the virtual scene (i.e., image frame).
[0170] In an embodiment of the present application, in order to record the relevant information of each node in the tree structure of a three-dimensional virtual object, the instantiation of the node in the virtual scene, and the real-time scheduling according to the target camera, the embodiment of the present application defines the following classes. Here, taking the target tree structure as a quadtree structure (also referred to as a quadtree) as an example, the following classes can be defined: quadtree forest class, region class, quadtree class, quadtree node class, quadtree node source class, and node game object class.
[0171] Among them, ① the quadtree forest class (Forest) mainly records all the quadtree information of the virtual scene in a region. It is a summary of all the information of the spatial scene model, including a quadtree list and a region class. The quadtree forest class is a collection of quadtrees corresponding to each three-dimensional virtual object in the virtual scene. Constructing the forest class is equivalent to organizing the relationship between the model data of all three-dimensional virtual objects in the quadtree. Only after completing the construction of the quadtree forest class can the dynamic scheduling of the nodes of each quadtree be realized.
[0172] ②The area class mainly records the coordinate information of the area where the entire virtual scene is located. Its information comes from metadata, mainly including: ①lat latitude and lng longitude, which are converted through SRS (spatial reference system) in metadata; ②name area name, that is, the area ID in metadata; ③filePath file path of model data (that is, model data information), the folder of model data at the same level of the file path where the metadata is located; ④depth quadtree level (that is, the number of node division levels included in the quadtree structure), which is the same as the quadtree depth in metadata.
[0173] ③ In addition to recording the information of the quadtree, the quadtree class (Q_TileTree) also has four functions and a quadrant enumeration. For example, the quadrant enumerations are the lower left corner LL, the lower right corner LR, the upper left corner UL, and the upper right corner UR, which are replaced by integers 0, 1, 2, and 3 respectively. The quadrant of a node represents the position of the node in the four quadrants of the node coordinate system of the upper node. The quadtree class contains the following information: ①root the root node of the quadtree, ②GName the quadtree name, ③depth the quadtree depth (i.e. the quadtree level), and ④lodList the node source list of the root node. The functions of the quadtree class are: ①Create a level of quadtree structure, passing the root node, the node division level of the quadtree (i.e. the depth), and the node source list of the root node (i.e. the node source information list). ②The function to insert a node into the quadtree (i.e. the node source insertion function mentioned above), passing the node source and the inserted node as parameters. ③ The function of initializing the bounding box of the node, passing the parameter as the node of the bounding box to be determined in the quadtree structure. ④ The function of sorting the node source of the root node, passing the parameter as the node source list of the root node, can be sorted from high to low according to the node division level.
[0174] ④ The quadtree node class (Q_TileNode) mainly records the information of nodes in the quadtree structure in units of single nodes, and is also the main reference object in node evaluation calculations. The attributes of the quadtree node class are: ①bound the bounding box of the node, ②child the list of child nodes, ③index the quadrant position of the node in the node coordinate system of its parent node, ④name the name of the node, ⑤filePath the file path of the node model data (i.e. model data information), ⑥depth the depth of the node (i.e. node division level).
[0175] ⑤The quadtree node source class (Q_TileNodeSource) is mainly used to insert nodes into the quadtree structure when creating a quadtree. It requires the name, depth (i.e., node division level), quadrant information, etc. of the node, i.e., a class used to record the above node source information. The attributes contained in this quadtree node source class are: ①index node quadrant information, ②name node name, ③depth node node division level, ④indexStr node node division level string format information. Based on the above description, it can be seen that when obtaining the node division level of a node through the file name, the level information obtained is in string format, so it is necessary to first receive it in string format and then convert it into an integer node division level through the int.Parse() function. The quadtree node source class also includes a function: a function for obtaining the quadrant of a node at a given node division level (i.e., the above-mentioned level quadrant acquisition function), and the parameter passed is the node division level to be queried. It can be understood that, based on the above description, if the passed-in node division level is greater than the node division level corresponding to the node source information, the quadrant information on the passed-in node division level cannot be obtained, that is, the level quadrant acquisition function can only be used for the quadrant information of the node in its upper layer, and it is meaningless to obtain the quadrant information of the node in the lower layer.
[0176] ⑥Point game object class (Go_QTNode): In the virtual scene, 3D virtual objects are instantiated with GameObject as the basic class. These objects can obtain new properties or class information through the AddComponent method (a method of adding components). After the model data of a single node of a 3D virtual object is instantiated in the scene, the node game object class can be added to facilitate the management and loading of the instantiated object. The properties of the node game object class include: ①node quadtree structure node, ②AssetLoaderOptions loading settings, ③fbxPath model data file path (i.e. model data information)...etc.
[0177] It should be understood that for the terrain area that is loaded for the first time in the virtual scene, the resource loading program first needs to traverse the model data of all three-dimensional virtual objects through the relevant information in the metadata, and establish a quadtree structure based on the above-mentioned quadtree class, and establish a quadtree forest structure based on the quadtree forest class. After the quadtree forest structure is established, the information of the quadtree forest structure is serialized into an XML configuration file. The next time you want to open the area to display the virtual scene, you can directly deserialize the XML configuration file to generate the quadtree forest class of the area, so that after the information in an area is loaded for the first time, the quadtree forest class in the same area can be efficiently loaded later, thereby improving the efficiency of data loading.
[0178] Among them, the main information contained in the metadata should include SRS (Spatial Reference System) information, QDepth (node division level of the quadtree, i.e. depth), and areaID (area identification, i.e. ID). Among them, SRS is used as the spatial positioning of the area, which can be understood as coordinate information that can be represented by longitude and latitude. SRS contains the name of the spatial reference system and specific coordinates, such as longitude is longitude 1-longitude 2, and latitude is latitude 1-latitude 2. It should be understood that the metadata records the basic information of the virtual scene in the entire area, which is the key to the subsequent construction of the quadtree, the location of the target camera, and the instantiation of objects in the virtual scene. After selecting and reading the metadata, the information of the current area provided in the metadata is recorded in the area class area: SRS information is converted to latitude lat and longitude lng in the area class; QDepth information is the node division level of the depth quadtree in the area class; areaID is the name information; and the path of the metadata is changed to the path of the folder of the model data at the same level as the attribute value of the file path of the model data in the area class.
[0179] It is understandable that the configuration information of the quadtree forest structure can be initialized through the region class. There is no relationship between the model files of the model data of the three-dimensional virtual object. In order to determine the relationship between the model data corresponding to each node division level, it is first necessary to record the information of the three-dimensional virtual object into a quadtree node source class, and insert the node source information into the quadtree structure to record the node relationship of the model data of each three-dimensional virtual object in the quadtree structure. Finally, all quadtree structures are combined into a quadtree forest structure, which can complete the information summary of the model data of all three-dimensional virtual objects in the entire virtual scene.
[0180] It can be understood that after the metadata is recorded in the area class, all Tile blocks in the folder of the model data are read through the file path filePath attribute of the area class. The Tile block here is equivalent to a node of a quadtree structure. The following operations are performed on each node: ① Set the node division level of the node, which is the same as the depth attribute of the area class; ② Set the name of the quadtree, that is, the name of the folder of the model data; ③ Traverse all the FBX format model data files (i.e., three-dimensional model files) of the three-dimensional virtual objects in the folder corresponding to the quadtree; ④ For each three-dimensional model file, obtain the name, display quality level, and quadrant corresponding to the model data through the file name, and record this information in the node source information list. In the node source information list, the node source information of the parent node in the node source information list can always be ranked before the node source information of the child node through the above-mentioned function of sorting the node source of the root node. Therefore, the method of inserting nodes into the quadtree structure one by one (i.e., the above-mentioned node source insertion function) can be used to complete the construction of the quadtree structure.
[0181] It should be understood that after traversing the folders of model data corresponding to all quadtrees and completing the entry of node source information, the construction of the quadtree class begins. First, the function for creating a quadtree structure can be called, and the parameters of the function are the root node and the node source information list containing all nodes in the entire quadtree structure. Then call the function (i.e. the above-mentioned node source insertion function) to insert the nodes in the node source list (i.e. the node source information list) into the quadtree one by one. How to insert the nodes in the node source information list into the nodes in the quadtree structure can be referred to the above-mentioned related description, which will not be repeated here. Its essence is to use a node as a child node of another node to complete the insertion of the node.
[0182] It is understandable that the model data of a 3D virtual object can be loaded by writing code and instantiated into a scene, or the game object in the virtual scene can be hidden or displayed. When loading the model data, you only need to know the file path of the model data. You can use multithreading to load the model data of multiple 3D virtual objects in parallel, thereby improving the efficiency of loading the model data and thus improving the efficiency of rendering and displaying the virtual scene.
[0183] It can be understood that after the information of the quadtree forest structure in the area is initialized, the longitude and latitude of the area are sent as a message through the event dispatcher, and the receiver is the control script mounted by the target camera. The control script places the target camera directly above the entire three-dimensional area to facilitate observation of the entire virtual scene. In addition to the longitude and latitude information, the event dispatcher will also send a message that the construction of the quadtree forest is completed and use the forest class as a parameter. The receiver is the real-time update component MapManager script program. This message is used to start the real-time update component, so that the virtual scene can be initialized and the model data of the initial three-dimensional virtual object can be loaded.
[0184] It is understandable that after receiving the message that the construction of the quadtree forest is completed, the real-time update component starts to initialize the scene and load the fuzzy data of the lowest display quality, that is, the fuzzy model. The file path of the model data of the root node of each quadtree is obtained by combining the name of each tree structure in the quadtree forest structure with the name of the root node of the tree structure, and the model data of the root node of each tree in FBX format is loaded through the determined file path.
[0185] After the fuzzy model is loaded and instantiated into the scene, a node game object class component can be added, and the root node of the quadtree can be used as the node information of the node game object class. The bounding box of the fuzzy model is obtained by reading the bounding box (MeshRenderer.bound) method of the mesh renderer component, and the node bounding box attributes of the root node of the quadtree structure are assigned. After obtaining the node bounding box information of the root node, the function used to initialize the bounding box in the quadtree node class is called, and the bounding box is assigned to the child nodes of the four corresponding quadrants based on the quadrants of the node coordinate system. The bounding box of each child node is recursively calculated until there are no child nodes, thereby completing the initialization of the bounding box of each node in all node division levels in the entire quadtree structure.
[0186] Then, a fuzzy model node list allBlurModels can be established based on each root node to record the root nodes of all quadtree structures, and a node game object class list (i.e., display node list) showDic can be used to record all displayed nodes in the current virtual scene. It can be understood that, at the time of initialization, the fuzzy model node list is a list consisting of the root nodes of all three-dimensional virtual objects in the virtual scene, and the real node list is empty.
[0187] Furthermore, when rendering and displaying the virtual scene for the first time, the display node list and the hidden node list can be determined from the fuzzy model node list based on the field of view of the target camera, and then the object node evaluation list can be determined based on the display node list. When rendering and displaying the virtual scene subsequently, the display node list when rendering the previous image frame can be updated based on the field of view of the target camera to obtain a new display node list and a new hidden node list. Therefore, each time an image frame is rendered, the frustum is culled based on the field of view of the target camera, and the display quality of each displayed three-dimensional virtual object is determined through node evaluation, thereby improving the rendering display quality while ensuring rendering efficiency.
[0188] S202, obtaining the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map;
[0189] S203, determining target size information of the target node bounding box based on the target node bounding box to which the target node belongs;
[0190] S204, performing node evaluation on the target node based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, to obtain a node evaluation result of the target node;
[0191] S205: If the node evaluation result indicates that the target node does not meet the rendering display condition, the node division level of the child nodes of the target node is obtained.
[0192] It should be understood that based on the above description, if the node evaluation result indicates that the target node does not meet the rendering and display conditions, it is necessary to improve the display quality of the three-dimensional virtual object, such as rendering and displaying the three-dimensional virtual object based on the node model data corresponding to the child nodes of the target node, thereby obtaining a three-dimensional virtual object with better display quality.
[0193] The node division level of the child node of the target node is obtained by adding one to the node division level of the target node to obtain the node division level of the child node of the target node.
[0194] S206. If the node division level of the child node of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, then in the object node evaluation list, the target node is updated through the child node of the target node to obtain an updated target node.
[0195] It should be understood that the maximum division level of the target tree structure can be the maximum node division node of the target tree structure. Figure 4In the target tree structure shown, the maximum division level may be the second level.
[0196] It can be understood that in the object node evaluation list, the target node is updated through the child nodes of the target node to obtain an updated target node. The target node can be removed from the object node evaluation list, and the child nodes of the target node can be added to the object node evaluation list to obtain an updated object node evaluation list, and then any node in the updated object node evaluation list can be used as the target node.
[0197] Optionally, an embodiment of the present application also includes: if the node division level of the child node of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the child node of the target node is rendered and displayed, and the target node is hidden.
[0198] Among them, it can be understood that if the node division level of the child node of the target node is the maximum division level of the target tree structure, it means that the child node of the target node is already a node on the node division level corresponding to the highest display quality, which means that the display quality cannot be improved based on the child node of the target node. Therefore, the child node of the target node can no longer be evaluated, and the child node of the target node can be directly displayed. It should be understood that if the node division level of the child node of the target node is the maximum division level of the target tree structure, and the target node is located in the field of view corresponding to the target camera, the child node of the target node can be added to the first display node list, and the target node can be removed from the first display node list to obtain an updated first display node list, and the target node can be added to the first hidden node list to obtain an updated first hidden node list.
[0199] For example, see Fig.11 , Fig.11It is a schematic flow diagram of a rendering process provided by an embodiment of the present application. First, an object node evaluation list (step S1101a) can be obtained, wherein the acquisition method of the object node evaluation list can refer to the above-mentioned related description, and will not be repeated here. Further, a node evaluation is performed on the target node, and the node evaluation result of the target node is obtained (step S1102a), and then the node evaluation result of the target node is determined to meet the rendering display condition (step S1103a). If the rendering display condition is met, when the target node is located within the field of view corresponding to the target camera, when rendering and displaying a three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are node-hidden (step S1104a). If the rendering display condition is not met, the node division level of the child nodes of the target node is obtained (step S1105a), and then the node division level of the child nodes of the target node is determined to be the maximum division level of the target tree structure (step S1106a). If the node division level of the child node of the target node is the maximum division level of the target tree structure, then when the target node is within the field of view corresponding to the target camera, when rendering and displaying the three-dimensional virtual object, the child node of the target node is rendered and displayed, and the target node is hidden (step S1108a); if the node division level of the child node of the target node is not the maximum division level of the target tree structure, then when the target node is within the field of view corresponding to the target camera, in the object node evaluation list, the target node is updated through the child node of the target node to obtain an updated target node (step S1107a). The specific processing process can refer to the above-mentioned related description and will not be repeated here.
[0200] Optionally, an embodiment of the present application also includes: if the node evaluation result indicates that the target node satisfies the rendering display condition and the fuzzy display condition, and the node evaluation results corresponding to the nodes having the same parent node as the target node all indicate that the nodes satisfy the fuzzy display condition, then when rendering and displaying the three-dimensional virtual object, the parent node of the target node is rendered and displayed, and the target node and the nodes having the same parent node as the target node are hidden.
[0201] It should be understood that the fuzzy display condition can be a condition for reducing the display quality of the three-dimensional virtual model. For example, based on the above description, it can be known that the fuzzy display condition can be that the evaluation index is greater than the second value (such as 2). It should be understood that if the node evaluation result of a node indicates that it satisfies the fuzzy display condition, then the node must satisfy the rendering display condition, that is, a node is considered to meet the fuzzy display condition only when it satisfies the rendering display condition, that is, it is considered whether the display quality of the node needs to be reduced, or the display quality of the node needs to be maintained. For example, the rendering display condition can be that the evaluation index is greater than the first value (such as 1), and the fuzzy display condition is that the evaluation index is greater than the second value (such as 2), and the second value is greater than the first value.
[0202] It should be understood that if the node evaluation results corresponding to the nodes with the same parent node as the target node all indicate that the nodes meet the fuzzy display condition, it means that the nodes with the same parent node as the target node can reduce the display quality, and then when rendering and displaying the three-dimensional virtual object, the parent node of the target node can be rendered and displayed, and the target node and the nodes with the same parent node as the target node can be hidden. The node model data corresponding to its parent node is the model data of the lower display quality level, so the parent node of the target node is rendered and displayed, that is, the display quality of the target node and the nodes with the same parent node is reduced.
[0203] It should be understood that if the node evaluation result indicates that the target node satisfies the fuzzy display condition, and the node evaluation results corresponding to the nodes having the same parent node as the target node all indicate that the nodes satisfy the fuzzy display condition, then the parent node of the target node can be added to the first display node list, and the target node can be removed from the first display node list to obtain an updated first display node list, and the target node can be added to the first hidden node list to obtain an updated first hidden node list.
[0204] For example, see Fig.12 , Fig.12It is a flowchart of another rendering process provided by an embodiment of the present application. First, an object node evaluation list can be obtained (step S1201a), and then, a node evaluation is performed on the target node to obtain a node evaluation result of the target node (step S1202a), and then, it is determined whether the node evaluation result of the target node meets the fuzzy display condition (step S1203a). It should be understood that. If the fuzzy display condition is not met, it is determined whether the node evaluation result of the target node meets the rendering display condition (step S1207a). If the rendering display condition is met, when the target node is within the field of view corresponding to the target camera, when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are node hidden (step S1208a). If the rendering display condition is not met, the above-mentioned can be executed. Fig.11 The relevant descriptions of steps S1103-S1108 in are not repeated here.
[0205] If the fuzzy display condition is met, the node evaluation result corresponding to the node with the same parent node as the target node is obtained (step S1204a), and it is determined whether the node evaluation result corresponding to the node with the same parent node as the target node meets the fuzzy display condition (step S1205a). If the node evaluation result corresponding to the node with the same parent node as the target node does not meet the fuzzy display condition, when the target node is located within the field of view corresponding to the target camera, when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are node-hidden (step S1208a); if the node evaluation result corresponding to the node with the same parent node as the target node meets the fuzzy display condition, when rendering and displaying the three-dimensional virtual object, the parent node of the target node is rendered and displayed, and the target node and the node with the same parent node as the target node are node-hidden (step S1206a). Therefore, based on the node evaluation results, it can be determined whether the display quality of each node needs to be reduced. Therefore, after the camera parameters are changed, the nodes that are not easy to attract attention can be displayed with lower display quality, so that there is no need to maintain a high display quality at all times for a certain three-dimensional virtual object, thereby reducing the amount of data processing and improving rendering efficiency.
[0206] Optionally, here we will use the rendering of a complete virtual scene as an example, see Fig.13 , Fig.13 Schematic diagram of a virtual scene rendering process provided by an embodiment of the present application. Fig.13As shown, the rendering of the virtual scene is mainly completed through two major processing processes, namely, the processing process of the resource loading component 1311a that obtains the model data information of the three-dimensional virtual object and generates a quadtree structure, and the processing process of the real-time update component 1312a that continuously updates and loads the three-dimensional virtual object during the operation of the virtual scene. The processing process of the resource loading component 1311a can refer to the above-mentioned related description. The real-time update component 1312a can call the update function (Update function) once in each frame of the virtual scene operation to realize the dynamic loading, replacement and hiding of the model in the virtual scene. Among them, before the rendering of the virtual scene, the model data can be input first (step S1301a), that is, the model data of all three-dimensional virtual objects in the virtual scene are input. In addition, the area information of the virtual scene can be read by the resource loading component 1311a, all model data can be traversed (step S1302a), and then the target tree structure corresponding to each three-dimensional virtual object in the virtual scene can be constructed (step S1303a). In addition, the texture map of each node can be read (step S1304a), the grayscale texture image can be determined based on the texture map, and the information entropy of the texture map can be determined based on the grayscale texture image (step S1305a), and the image complexity can be obtained by weighted conversion based on the information entropy (step S1306a). Further, the real-time update component 1312a can be called to initialize the virtual scene (step S1307a), and then the cone culling process can be performed in real time to display or hide the nodes of the three-dimensional virtual object, and the node evaluation can be performed and the display quality of the three-dimensional virtual object can be adjusted based on the node evaluation result (step S1308a), so as to facilitate the real-time update display of the virtual scene and render the output image frame (step S1309a). Among them, the processing process of the resource loading component and the real-time update component can refer to the above-mentioned related description, which will not be repeated here. It is understandable that when performing node evaluation, node evaluation can be performed based on the calculated image complexity, camera viewing distance, and size information of the node bounding box, so that in the real-time update module, the display node is updated based on the node evaluation result, thereby adjusting the display quality of the three-dimensional virtual object. In the embodiment of the present application, the drawing of model nodes that are less concerned by the observer can be reduced, and the drawing of some model nodes can be reduced to optimize the rendering rate of the overall spatial scene. In addition, the present application can use the calculation of image complexity as preliminary preparation work, and after the calculation is completed, the image complexity of each node model is recorded in the quadtree node class, and the image complexity is directly called to participate in the node evaluation during the virtual roaming process, thereby improving the efficiency of node evaluation.
[0207] See also Fig.14 , Fig.14 Schematic diagram of a tree-structured object rendering device provided by an embodiment of the present application. Fig.14As shown, the tree-structure-based object rendering device 1 may be a computer program (including program code) running on a computer device (e.g., the server 100a described above), for example, the tree-structure-based object rendering device 1 is an application software; it can be understood that the tree-structure-based object rendering device 1 may be used to execute the corresponding steps of the tree-structure-based object rendering method provided in the embodiment of the present application. Fig.14 As shown, the tree-structure-based object rendering device 1 may include: an evaluation list acquisition module 11, a complexity acquisition module 12, a size determination module 13, an evaluation result determination module 14, and a rendering display module 15;
[0208] An evaluation list acquisition module 11 is used to acquire an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object;
[0209] The complexity acquisition module 12 is used to acquire the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map;
[0210] A size determination module 13, configured to determine target size information of a target node bounding box based on a target node bounding box to which the target node belongs;
[0211] The evaluation result determination module 14 is further used to perform node evaluation on the target node based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity to obtain a node evaluation result of the target node;
[0212] The rendering and display module 15 is used to render and display the target node and hide the child nodes of the target node when rendering and displaying the three-dimensional virtual object if the node evaluation result indicates that the target node meets the rendering and display conditions and the target node is located within the field of view corresponding to the target camera.
[0213] The complexity acquisition module 12 is specifically used for:
[0214] Obtain a target texture map corresponding to the target node, perform grayscale processing on the target texture map, and obtain a grayscale texture image of the target texture map;
[0215] Determine a target pixel whose grayscale value is a target grayscale value from the grayscale texture image, and perform a culling process on the target pixel in the grayscale texture image;
[0216] Counting the pixels of each grayscale value in the grayscale texture image after removing the target pixel, obtaining the grayscale value ratio corresponding to each grayscale value, and determining the image information entropy of the target texture map based on the grayscale value ratio of each grayscale value;
[0217] The image information entropy is weightedly transformed to obtain the image complexity of the target texture map.
[0218] Wherein, the tree structure-based object rendering device 1 further includes: a tree structure determination module 16;
[0219] The tree structure determination module 16 is specifically used for:
[0220] Acquire the root node of the target tree structure to be created corresponding to the three-dimensional virtual object and a node source information list of the root node; the node source information list includes the node source information of each node of the target tree structure to be created; the node source information of each node of the target tree structure includes the corresponding node division level;
[0221] The root node is determined as the inserted node, and the target node source information to be added to the target tree structure is determined from the node source information list;
[0222] When the node division level of the target node source information is the next node division level of the inserted node, obtaining the node to be processed under the inserted node; the node to be processed is a node in the child node of the inserted node to which the node source information is not added;
[0223] Acquire the quadrant information corresponding to the target node source information, determine the target node to be processed to which the target node source information is to be added from the nodes to be processed of the inserted node based on the quadrant information, and add the target node source information to the target node to be processed;
[0224] The target tree structure corresponding to the three-dimensional virtual object is determined based on the target to-be-processed node to which the target node source information is added.
[0225] The tree structure determination module 16 is further used for:
[0226] When the node division level of the target node source information is not the next node division level of the inserted node, obtain the first-level node created under the root node, determine the first-level node to which the target node source belongs from the first-level nodes, and determine the first-level node to which the target node belongs as the updated inserted node; the first-level node is a node on the next node division level of the root node;
[0227] When the node division level of the target node source information is the next node division level of the updated inserted node, the node to be processed under the updated inserted node is obtained; the child node to be processed is a node in the child node of the inserted node to which the node source information is not added;
[0228] Determine, based on the quadrant information, from the updated nodes to be processed to which the target node source information is to be added;
[0229] The target node source information is added to the target to-be-processed node, and the target tree structure corresponding to the three-dimensional virtual object is determined based on the target to-be-processed node to which the target node source information is added.
[0230] Wherein, the node source information of each node of the target tree structure includes corresponding model data information;
[0231] The tree structure determination module 16 is further used for:
[0232] Acquire model data of the three-dimensional virtual object at multiple display quality levels, divide the model data at each display quality level, and obtain node model data corresponding to nodes at the node division level corresponding to each display quality level; one display quality level corresponds to one node division level;
[0233] Based on the model data information of the node model data corresponding to each node and the node division level of each node, the node source information of each node in the target tree structure to be created is determined; the node model data corresponding to a node is used to determine the node source information of a node.
[0234] The rendering and display module 15 is also used for:
[0235] If the node evaluation result indicates that the target node does not meet the rendering display condition, then the node division level of the child node of the target node is obtained;
[0236] If the node division level of the child node of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, then in the object node evaluation list, the target node is updated through the child node of the target node to obtain an updated target node.
[0237] The rendering and display module 15 is also used for:
[0238] If the node division level of the child nodes of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, when rendering and displaying the three-dimensional virtual object, the child nodes of the target node are rendered and displayed, and the target node is hidden.
[0239] The rendering and display module 15 is also used for:
[0240] If the node evaluation result indicates that the target node meets the rendering display condition and the fuzzy display condition, and the target node is located within the field of view corresponding to the target camera, then obtain the node evaluation result corresponding to the node having the same parent node as the target node;
[0241] If the node evaluation results corresponding to the nodes having the same parent node as the target node all indicate that the nodes meet the fuzzy display conditions, then when rendering and displaying the three-dimensional virtual object, the parent node of the target node is rendered and displayed, and the target node and the nodes having the same parent node as the target node are hidden.
[0242] There are multiple three-dimensional virtual objects in the virtual scene; each three-dimensional virtual object corresponds to a target tree structure;
[0243] The evaluation list acquisition module 11 is specifically used for:
[0244] In a virtual scene, determine the field of view indicated by the viewing cone corresponding to the target camera;
[0245] Based on the positional relationship between the field of view and the object bounding box of each three-dimensional virtual object, node detection is performed on each three-dimensional virtual object to obtain a node detection result of each three-dimensional virtual object; the node detection result is used to indicate that the three-dimensional virtual object is within the field of view, or is used to indicate that the three-dimensional virtual object is not within the field of view;
[0246] Determine a first hidden node list and a first displayed node list associated with the virtual scene based on the node detection results of each three-dimensional virtual object;
[0247] A target node evaluation list is determined based on the nodes in the first display node list.
[0248] The object node evaluation list is an object node evaluation list determined when rendering and displaying the target image frame;
[0249] The evaluation list acquisition module 11 is specifically used for:
[0250] Acquire a second display node list and a second hidden node list determined when rendering an image frame preceding a display target image frame;
[0251] Based on the node detection results of each three-dimensional virtual object, the second display node list and the second hidden node list are updated to obtain the first hidden node list and the first display node list associated with the virtual scene.
[0252] Wherein, the multiple three-dimensional virtual objects in the virtual scene include a target three-dimensional virtual object;
[0253] The evaluation list acquisition module 11 is specifically used for:
[0254] If the second display node list includes a target display node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is outside the field of view, then the target display node is added to the waiting hidden node list;
[0255] The second hidden node list is updated based on the target display node in the waiting hidden node list to obtain a first hidden node list;
[0256] The target display node is removed from the second display node list to obtain a first display node list.
[0257] Wherein, the multiple three-dimensional virtual objects in the virtual scene include a target three-dimensional virtual object;
[0258] The evaluation list acquisition module 11 is specifically used for:
[0259] If the second display node list does not include any node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is within the field of view, then the node detection result of the target three-dimensional virtual object is added to the second display node list to obtain a first display node list associated with the virtual scene;
[0260] The root node of the target three-dimensional virtual object is removed from the second hidden node list to obtain a first hidden node list associated with the virtual scene.
[0261] Wherein, the target tree structure includes a target tree structure, and the nodes in the target tree structure include a first node and a second node; the second node is a child node of the first node;
[0262] Wherein, the tree structure-based object rendering device 1 further includes: a bounding box determination module 17;
[0263] The bounding box determination module 17 is specifically used for:
[0264] Obtain a first node bounding box of a first node; the first node bounding box is associated with a node coordinate system corresponding to the first node; the node coordinate system has an origin at the center of the first node bounding box;
[0265] Determine a plurality of quadrants in the node coordinate system corresponding to the first node, divide the bounding box of the first node based on the plurality of quadrants to obtain a sub-bounding box corresponding to each quadrant; the sub-bounding box corresponding to each quadrant includes the second node;
[0266] Based on the second node in the sub-bounding box corresponding to each quadrant, a second node bounding box of the second node is determined.
[0267] Wherein, node source information is added to the target node, and the node source information of the target node includes model data information of the node model data of the target node;
[0268] The rendering and display module 15 is specifically used for:
[0269] If the node evaluation result indicates that the target node meets the rendering display condition, and the target node is within the field of view corresponding to the target camera, the target node is added to the to-be-displayed node stack associated with the virtual scene, and the child nodes of the target node are added to the first hidden node list associated with the virtual scene; the first hidden node list may be a hidden node list determined based on the field of view of the target camera;
[0270] When rendering and displaying a three-dimensional virtual object, the target node is popped from the to-be-displayed node stack, the model data information in the node source information of the target node is obtained, the node model data of the target node is obtained, and the target node is rendered and displayed based on the node model data of the target node.
[0271] The rendering and display module 15 is specifically used for:
[0272] After instantiating the three-dimensional virtual object in the virtual scene, obtaining a target display node list associated with the virtual scene; the target display node list includes the target node;
[0273] Perform node loading detection on the target node to obtain the node display detection result of the target node;
[0274] If the node display detection result indicates that the target node fails to load, the target node in the target display node list is added to the temporary processing list, the node model data of the target node is reloaded, and the target node is rendered and displayed based on the reloaded node model data.
[0275] The evaluation list acquisition module 11 is specifically used for:
[0276] When it is detected that the camera parameters of the target camera have been updated, an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene is obtained.
[0277] See also Fig.15 , Fig.15 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.15As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig.15 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0278] In such Fig.15 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to execute the description of the object rendering method based on the tree structure in any of the corresponding embodiments above, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.
[0279] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the tree-structured object rendering device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, it can execute the description of the tree-structured object rendering method in the previous embodiment, so it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0280] The computer-readable storage medium may be the tree-structured object rendering device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0281] In addition, it should be noted here that: the embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided by any of the corresponding embodiments in the foregoing text. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer program product or computer program embodiment involved in this application, please refer to the description of the method embodiment of this application.
[0282] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0283] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.
[0284] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0285] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A tree-structured object rendering method, characterized in that: The method comprises: Obtaining an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object; Acquire the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map; Determining target size information of the target node bounding box based on the target node bounding box to which the target node belongs; Based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity, performing node evaluation on the target node to obtain a node evaluation result of the target node; If the node evaluation result indicates that the target node meets the rendering and display conditions, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are hidden.
2. The method according to claim 1, characterized in that The obtaining the image complexity of the target texture map corresponding to the target node includes: Acquire a target texture map corresponding to the target node, perform grayscale processing on the target texture map, and obtain a grayscale texture image of the target texture map; Determine a target pixel whose grayscale value is a target grayscale value from the grayscale texture image, and perform a culling process on the target pixel in the grayscale texture image; Counting pixels of each grayscale value in the grayscale texture image after removing the target pixel, obtaining the grayscale value ratio corresponding to each grayscale value, and determining the image information entropy of the target texture map based on the grayscale value ratio of each grayscale value; The image information entropy is weightedly converted to obtain the image complexity of the target texture map.
3. The method according to claim 1, characterized in that The method further comprises: Acquire a root node of a target tree structure to be created corresponding to the three-dimensional virtual object and a node source information list of the root node; the node source information list includes node source information of each node of the target tree structure to be created; the node source information of each node of the target tree structure includes a corresponding node division level; Determine the root node as the inserted node, and determine the target node source information to be added to the target tree structure from the node source information list; When the node division level of the target node source information is the next node division level of the inserted node, obtaining the node to be processed under the inserted node; the node to be processed is a node in the child node of the inserted node to which the node source information is not added; Acquire the quadrant information corresponding to the target node source information, determine the target node to be processed to which the target node source information is to be added from the nodes to be processed of the inserted node based on the quadrant information, and add the target node source information to the target node to be processed; The target tree structure corresponding to the three-dimensional virtual object is determined based on the target to-be-processed node to which the target node source information is added.
4. The method according to claim 3, characterized in that The method further comprises: When the node division level of the target node source information is not the next node division level of the inserted node, obtain the first-level node created under the root node, determine the first-level node to which the target node source belongs from the first-level nodes, and determine the first-level node to which the target node belongs as the updated inserted node; the first-level node is a node on the next node division level of the root node; When the node division level of the target node source information is the next node division level of the updated inserted node, obtaining the node to be processed under the updated inserted node; the child node to be processed is a node in the child node of the inserted node to which the node source information is not added; Determine, based on the quadrant information, a target node to be processed to which the target node source information is to be added from the updated nodes to be processed of the inserted node; The target node source information is added to the target to-be-processed node, and a target tree structure corresponding to the three-dimensional virtual object is determined based on the target to-be-processed node to which the target node source information is added.
5. The method according to claim 3, characterized in that: The node source information of each node of the target tree structure includes corresponding model data information; the method further includes: Acquire model data of the three-dimensional virtual object at multiple display quality levels, divide the model data at each display quality level, and obtain node model data corresponding to nodes at a node division level corresponding to each display quality level; one display quality level corresponds to one node division level; Based on the model data information of the node model data corresponding to each node and the node division level of each node, the node source information of each node in the target tree structure to be created is determined; the node model data corresponding to a node is used to determine the node source information of a node.
6. The method according to claim 1, characterized in that The method further comprises: If the node evaluation result indicates that the target node does not meet the rendering display condition, obtaining the node division level of the child node of the target node; If the node division level of the child node of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, then in the object node evaluation list, the target node is updated through the child node of the target node to obtain an updated target node.
7. The method according to claim 1, characterized in that The method further comprises: If the node division level of the child nodes of the target node is the maximum division level of the target tree structure, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the child nodes of the target node are rendered and displayed, and the target node is hidden.
8. The method according to claim 1, further comprising: If the node evaluation result indicates that the target node satisfies the rendering display condition and the fuzzy display condition, and the target node is located within the field of view corresponding to the target camera, then obtaining a node evaluation result corresponding to a node having the same parent node as the target node; If the node evaluation results corresponding to the nodes having the same parent node as the target node all indicate that the nodes meet the fuzzy display conditions, then when rendering and displaying the three-dimensional virtual object, the parent node of the target node is rendered and displayed, and the target node and the nodes having the same parent node as the target node are hidden.
9. The method according to claim 1, characterized in that: There are multiple three-dimensional virtual objects in the virtual scene; each three-dimensional virtual object corresponds to a target tree structure; The step of obtaining an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene includes: In the virtual scene, determining a field of view indicated by a viewing cone corresponding to the target camera; Based on the positional relationship between the field of view and the object bounding box of each three-dimensional virtual object, performing node detection on each three-dimensional virtual object to obtain a node detection result of each three-dimensional virtual object; the node detection result is used to indicate that the three-dimensional virtual object is within the field of view, or is used to indicate that the three-dimensional virtual object is not within the field of view; Based on the node detection results of each three-dimensional virtual object, determine a first hidden node list and a first displayed node list associated with the virtual scene; The object node evaluation list is determined based on the nodes in the first display node list.
10. The method according to claim 9, characterized in that The object node evaluation list is an object node evaluation list determined when rendering and displaying a target image frame; The determining, based on the node detection results of each three-dimensional virtual object, a first hidden node list and a first displayed node list associated with the virtual scene comprises: Acquire a second display node list and a second hidden node list determined when rendering and displaying an image frame preceding the target image frame; Based on the node detection results of each three-dimensional virtual object, the second display node list and the second hidden node list are updated to obtain a first hidden node list and a first display node list associated with the virtual scene.
11. The method according to claim 9, characterized in that The multiple three-dimensional virtual objects in the virtual scene include a target three-dimensional virtual object; The updating of the second display node list and the second hidden node list based on the node detection results of each three-dimensional virtual object to obtain the first hidden node list and the first display node list associated with the virtual scene includes: If the second display node list includes a target display node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is outside the field of view, then adding the target display node to the waiting hidden node list; The second hidden node list is updated based on the target display node in the waiting hidden node list to obtain the first hidden node list; The target display node is removed from the second display node list to obtain the first display node list.
12. The method according to claim 9, characterized in that The multiple three-dimensional virtual objects in the virtual scene include a target three-dimensional virtual object; The updating of the second display node list and the second hidden node list based on the node detection results of each three-dimensional virtual object to obtain the first hidden node list and the first display node list associated with the virtual scene includes: If the second display node list does not include any node in the target tree structure corresponding to the target three-dimensional virtual object, and the node detection result of the target three-dimensional virtual object is used to indicate that the target three-dimensional virtual object is located within the field of view, then the node detection result of the target three-dimensional virtual object is added to the second display node list to obtain a first display node list associated with the virtual scene; The root node of the target three-dimensional virtual object is removed from the second hidden node list to obtain a first hidden node list associated with the virtual scene.
13. The method according to claim 1, characterized in that The target tree structure includes a target tree structure, and the nodes in the target tree structure include a first node and a second node; The second node is a child node of the first node; The method further comprises: Acquire a first node bounding box of the first node; the first node bounding box is associated with a node coordinate system corresponding to the first node; the node coordinate system has an origin at the center position of the first node bounding box; Determine a plurality of quadrants in the node coordinate system corresponding to the first node, and divide the first node bounding box into bounding boxes based on the plurality of quadrants to obtain sub-bounding boxes corresponding to each quadrant; the sub-bounding boxes corresponding to each quadrant include the second node; Based on the second node in the sub-bounding box corresponding to each quadrant, a second node bounding box of the second node is determined.
14. The method according to claim 1, characterized in that Node source information is added to the target node, and the node source information of the target node includes model data information of node model data of the target node; If the node evaluation result indicates that the target node meets the rendering and display conditions, and the target node is located within the field of view corresponding to the target camera, then when rendering and displaying the three-dimensional virtual object, the target node is rendered and displayed, and the child nodes of the target node are hidden, including: If the node evaluation result indicates that the target node meets the rendering display condition, and the target node is located within the field of view corresponding to the target camera, the target node is added to the to-be-displayed node stack associated with the virtual scene, and the child nodes of the target node are added to the first hidden node list associated with the virtual scene; the first hidden node list may be a hidden node list determined based on the field of view of the target camera; When rendering and displaying the three-dimensional virtual object, the target node is popped from the to-be-displayed node stack, the model data information in the node source information of the target node is obtained, the node model data of the target node is obtained, and the target node is rendered and displayed based on the node model data of the target node.
15. The method according to claim 1, characterized in that The rendering and displaying of the target node based on the node model data of the target node includes: After instantiating the three-dimensional virtual object in the virtual scene, obtaining a target display node list associated with the virtual scene; the target display node list includes the target node; Performing a node loading test on the target node to obtain a node display test result of the target node; If the node display detection result indicates that the target node fails to load, the target node in the target display node list is added to a temporary processing list, the node model data of the target node is reloaded, and the target node is rendered and displayed based on the reloaded node model data.
16. The method according to claim 1, characterized in that The step of obtaining an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene includes: When it is detected that the camera parameters of the target camera have been updated, an object node evaluation list associated with the three-dimensional virtual object to be rendered in the virtual scene is obtained.
17. A tree-structured object rendering device, characterized in that: The device comprises: An evaluation list acquisition module is used to acquire an object node evaluation list associated with a three-dimensional virtual object to be rendered in a virtual scene; the object node evaluation list includes a target node to be evaluated; the target node is a node in a target tree structure corresponding to the three-dimensional virtual object; A complexity acquisition module, used to acquire the image complexity of the target texture map corresponding to the target node; the image complexity of the target texture map is determined based on the image information entropy of the target texture map; A size determination module, used for determining target size information of the target node bounding box based on the target node bounding box to which the target node belongs; The evaluation result determination module is further used to perform node evaluation on the target node based on the target size information, the camera viewing distance between the target node and the target camera, and the image complexity to obtain a node evaluation result of the target node; A rendering and display module is used to render and display the target node and hide the child nodes of the target node when rendering and displaying the three-dimensional virtual object if the node evaluation result indicates that the target node meets the rendering and display conditions and the target node is located within the field of view corresponding to the target camera.
18. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 16.
20. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the method according to any one of claims 1 to 16 when executed by a processor.
Citation Information
Cited By
Data visualization method and system based on digital model
CN120807744A
Tree-structure-based object rendering method and apparatus, and electronic device, computer-readable storage medium and computer program product
WO2026056557A1
