Three-dimensional graphics rendering method and device based on graph theory
By representing the three-dimensional graphical scene as a graph theory model, and applying a minimum spanning tree or clustering algorithm to segment the scene, combining topology to optimize the rendering order and real-time update of the visibility graph, the problem of low rendering efficiency in traditional rendering methods is solved, and efficient and fast three-dimensional graph rendering is achieved.
Patent Information
- Application Number
- CN202510092359.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-01-21
AI Technical Summary
When traditional three-dimensional graphics rendering methods deal with complex scenes, the rendering efficiency is low and the calculation cost is high, resulting in poor user experience.
Using a graph theory-based method, the three-dimensional graph scene is represented as graph G(V, E), and simplifies and segments through the minimum spanning tree or clustering algorithm to form independent rendered subscenes, and obtain rendering priority based on the topological structure, and update the visibility map in real time to eliminate obstructed objects.
It significantly reduces the amount of rendering calculations, improves rendering speed, reduces the consumption of computing resources, provides a better user experience, and is suitable for rendering of complex scenes.
Smart Images

Figure CN119540430B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer graphics, and more specifically, to a three-dimensional graphics rendering method and device based on graph theory. Background Art
[0002] With the rapid development of computer technology, 3D graphics rendering technology has been widely used. In the fields of finite element simulation, virtual reality, film and television special effects and game development, the improvement of rendering quality and efficiency has become a research hotspot.
[0003] However, when dealing with complex scenes, especially in the rendering process of highly complex scenes, rendering efficiency often becomes a bottleneck for traditional rendering methods. Traditional rendering algorithms often face the problems of high computational cost and slow rendering speed when dealing with large amounts of geometric data, which in turn leads to poor user experience. Summary of the invention
[0004] In response to at least one defect or improvement need in the prior art, the present application provides a three-dimensional graphics rendering method and device based on graph theory, which are used to improve the rendering efficiency of three-dimensional graphics and reduce the consumption of computing resources.
[0005] To achieve the above objectives, in a first aspect, the present application provides a three-dimensional graphics rendering method based on graph theory, comprising:
[0006] The three-dimensional graphic scene is constructed as a graph G(V, E) by taking individual attribute elements of objects in the three-dimensional graphic scene as nodes and object relationship attribute elements as edges; wherein V represents a set of nodes and E represents a set of edges for connecting the above nodes;
[0007] The graph G(V, E) is simplified and segmented using a minimum spanning tree or clustering algorithm in graph theory to form a plurality of three-dimensional graphic sub-scenes that can be rendered independently;
[0008] Based on the topological structure of the three-dimensional graphics scene, obtaining the rendering priority of each three-dimensional graphics sub-scene;
[0009] The three-dimensional graphics sub-scenes are rendered in sequence based on the rendering priorities.
[0010] Furthermore, it also includes:
[0011] Building a visibility graph based on the graph G(V, E) and updating the visibility relationship between viewpoints and objects in real time;
[0012] The obscured objects are eliminated according to the visibility relationship, and only visible objects are rendered to reduce the amount of rendering calculations.
[0013] Further, the object individual attribute element includes one or more of the object in the three-dimensional graphic scene, the geometric features of the object, the texture features of the object, and the semantic information of the object;
[0014] The object relationship attribute elements include one or more of an adjacency relationship between objects in a three-dimensional graphic scene, an occlusion relationship between objects, and a similarity relationship between objects.
[0015] Furthermore, simplifying and segmenting the graph G(V, E) using the minimum spanning tree in graph theory includes:
[0016] In the edge set E, a weight is defined for each edge, which is set based on the distance or similarity characteristics between objects;
[0017] Based on the weight of each edge, construct a minimum spanning tree using Prim's algorithm or Kruskal's algorithm;
[0018] In the constructed minimum spanning tree, edges whose weights exceed a preset weight threshold are removed to divide the three-dimensional graphic sub-scenes; objects in each of the three-dimensional graphic sub-scenes are connected by edges whose weights do not exceed the preset weight threshold to form several relatively independent areas.
[0019] Furthermore, the graph G(V, E) is simplified and segmented using a clustering algorithm in graph theory, including:
[0020] Extracting the object individual attribute element corresponding to each node in the graph G(V, E);
[0021] According to the characteristics of the data, a suitable clustering algorithm is selected to cluster the nodes so that the similarity of nodes in the same group exceeds a preset similarity threshold, while the similarity of nodes in different groups does not exceed the preset similarity threshold; each group represents a three-dimensional graphic sub-scene.
[0022] Furthermore, the rendering priority is obtained in the following ways:
[0023] Get the Euclidean distance between the center point or center of gravity of each 3D graphics subscene and the viewpoint;
[0024] The 3D graphics sub-scene with a smaller Euclidean distance from the viewpoint is given a rendering priority with a larger viewpoint distance;
[0025] The 3D graphics sub-scenes with greater visual impact on the final image will be given greater rendering priority; the criteria for judging the impact include:
[0026] The more objects included, the greater the impact on the picture;
[0027] and / or dynamic objects have a greater impact on the picture than static objects;
[0028] Based on the viewpoint distance rendering priority, influence rendering priority and corresponding weight coefficients, the comprehensive rendering priority of each 3D graphics sub-scene is obtained, including the formula:
[0029] ;
[0030] in, priority distance Indicates the viewpoint distance rendering priority, ω 1 represents the corresponding weight coefficient; priority influence Indicates the rendering priority of the influence, ω 2 represents the corresponding weight coefficient; priority final Indicates the comprehensive rendering priority of 3D graphics subscenes.
[0031] Further, rendering the three-dimensional graphics sub-scenes in sequence based on the rendering priority includes:
[0032] Sort the comprehensive rendering priority of all 3D graphics sub-scenes by size;
[0033] Prioritize rendering of 3D graphics sub-scenes with higher overall rendering priority;
[0034] When the viewpoint moves or the scene changes, the comprehensive rendering priority is updated and reordered in real time to ensure that the rendering order always reflects the current view requirements.
[0035] Furthermore, constructing a visibility graph based on the graph G(V, E) and updating the visibility relationship between viewpoints and objects in real time includes:
[0036] The visibility graph is constructed by using nodes to represent objects or key points in a three-dimensional graphic scene or sub-scene and edges to represent visibility relationships between objects;
[0037] Get the position and direction of the current viewpoint, and determine the visibility relationship between objects based on the bounding box or bounding volume of the object using the visibility test method of ray casting or frustum culling;
[0038] The visibility relationship is dynamically updated in real time based on one or more updating methods among event-driven updating, incremental updating and hierarchical culling.
[0039] Furthermore, the culling of obscured objects according to the visibility relationship and rendering only visible objects to reduce the amount of rendering calculations includes:
[0040] Traversing the visibility graph, checking the in-degree and out-degree of each object in the visibility graph;
[0041] If an object does not have any visible incoming edges, the object is completely occluded and should be culled; if an object is not occluded by any object, the object is visible and allowed to be rendered;
[0042] During the rendering process, only visible objects are rendered to reduce the amount of rendering calculations.
[0043] In a second aspect, the present application provides an electronic device comprising at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit is enabled to perform the steps of any of the rendering methods described above.
[0044] In general, the above technical solutions conceived by the present application can achieve the following beneficial effects compared with the prior art:
[0045] (1) Based on graph theory, this application represents a three-dimensional graphics scene as a graph G(V, E). By simplifying and segmenting the graph G(V, E), the amount of computation required for a single rendering is reduced. At the same time, the rendering order is optimized in combination with the topological structure of the three-dimensional graphics scene, which significantly reduces unnecessary computation and improves the rendering speed. The optimized rendering process maximizes the hardware characteristics of the computer, reduces the use of computing resources, and reduces hardware requirements. In addition, the flexibility of the graph structure allows for dynamic adjustment of rendering strategies in complex scenes, which can quickly adapt to dynamically changing scenes and update rendering results in real time, thereby providing a better user experience. This rendering method can also be extended to various complex scenes and is suitable for different application areas.
[0046] (2) This application constructs a visibility graph based on the graph G(V, E), updates the visibility relationship between the viewpoint and the object in real time, and then removes the obscured objects based on the visibility relationship obtained in real time. During the entire rendering process, only visible objects are rendered, thereby further reducing the amount of rendering calculations and improving the rendering speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A core flow chart of a three-dimensional graphics rendering method based on graph theory provided in an embodiment of the present application;
[0049] Figure 2 A block diagram of an electronic device suitable for implementing the rendering method described above provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0051] The terms "including" or "having" and any variations thereof in the specification, claims or drawings of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0052] As described in the background technology section of the specification, when traditional rendering methods process complex scenes, especially in the rendering process of highly complex scenes, rendering efficiency often becomes a bottleneck. Traditional rendering algorithms often face the problems of high computing cost and slow rendering speed when processing large amounts of geometric data, which leads to poor user experience. In view of this, the present application provides a three-dimensional graphics rendering method and device based on graph theory, which optimizes the data structure and algorithm in the rendering process by constructing a graph theory model of the graphics scene, thereby effectively improving the rendering efficiency and reducing the consumption of computing resources.
[0053] refer to Figure 1 An embodiment of the present application provides a three-dimensional graphics rendering method based on graph theory, and the rendering method may mainly include the following steps.
[0054] Step 1: Using individual attribute elements of objects in the three-dimensional graphic scene as nodes and object relationship attribute elements as edges, the three-dimensional graphic scene is constructed into a graph G(V, E); wherein V represents a set of nodes and E represents a set of edges used to connect the above nodes.
[0055] In some embodiments, more specifically, objects, textures and other elements in a three-dimensional graphic scene are abstracted as nodes (vertices) in graph theory, and the relationships between objects (such as adjacency, occlusion, etc.) are used as edges to construct a graph structure, and the three-dimensional graphic scene is represented as a graph G(V, E), where V is a vertex set and E is an edge set. Each vertex represents a key point of a geometric body, and the edge represents the connection relationship between geometric bodies.
[0056] In the graph G(V,E), V as a key point can represent a geometric body (object) or a feature point of a geometric body (such as a boundary point, center of gravity, etc.). For example, in a room scene, vertices may correspond to objects such as walls, furniture, and windows.
[0057] Each vertex can not only represent an object, but also represent the following additional feature information:
[0058] ①Geometric features: including information such as the size, shape and position of the object.
[0059] ②Texture features: including the color and texture type of the object surface.
[0060] ③Semantic information: including the category of objects (such as "chair", "table") and their functions.
[0061] In the graph G(V,E), E represents the connection relationship between vertices. In a three-dimensional scene, these relationships can be varied, mainly including:
[0062] ① Adjacency relationship: Indicates the contact or proximity between objects. For example, the adjacency relationship between a table and a chair can be connected by an edge.
[0063] ② Occlusion relationship: used to indicate whether an object is occluded by another object. Occlusion relationship can be represented by directed edges, pointing to the occluded object.
[0064] ③Similarity relationship: When two objects are similar in shape or texture, a connection can be established.
[0065] Edges can also contain additional attributes, such as:
[0066] ① Weight: Indicates the strength or importance of the connection, and can be assigned based on the distance, similarity, etc. between objects.
[0067] ②Type: Indicates the type of edge, such as adjacency, occlusion, or similarity.
[0068] Step 2: Use the minimum spanning tree or clustering algorithm in graph theory to simplify and segment the graph G(V, E) to form several 3D graphics sub-scenes that can be rendered independently. Each 3D graphics sub-scene can be rendered independently, thereby reducing the computational overhead during rendering.
[0069] In some embodiments, more specifically, a minimum spanning tree (MST) is a subgraph connecting all vertices (nodes) in a graph with minimal edge weights and weights.
[0070] Construction of MST:
[0071] ① Define weights: In the edge set E, define a weight for each edge. The weight can be set based on the distance, similarity, or other features between objects. For example, nearby objects can have lower weights, while distant objects can have higher weights.
[0072] ② Construct MST: Use Prim's algorithm or Kruskal's algorithm to construct a minimum spanning tree. Finally, you get a tree structure that connects all vertices, where the total weight of the edges is the smallest.
[0073] Prim's algorithm: Starting from a starting vertex, gradually add the minimum edges connected to the current tree until all vertices are included.
[0074] Kruskal's algorithm: First sort all edges by weight, and then gradually select the smallest edge, ensuring that no loop is formed, until all vertices are connected.
[0075] Extraction of sub-scenes:
[0076] ① Decomposition of scenes: In the generated minimum spanning tree, different 3D graphics sub-scenes can be divided by removing some edges with larger weights. In this way, the objects in each 3D graphics sub-scene are connected by edges with smaller weights to form several relatively independent parts or regions.
[0077] ② Independent rendering: Each 3D graphics sub-scene can be rendered independently, thus reducing the computational overhead. In this way, the rendering engine only needs to process the 3D graphics sub-scene within the current field of view, thus improving rendering efficiency.
[0078] Clustering algorithms can be used to group vertices in the graph G(V, E) so that vertices in the same group are similar to each other, while vertices in different groups are relatively different. Clustering algorithms can be K-Means, spectral clustering, etc.
[0079] Clustering process:
[0080] ① Feature extraction: For each vertex in the graph G(V, E), extract its feature vector, including geometric features, texture features, etc.
[0081] ②Choose a clustering algorithm: Choose an appropriate clustering algorithm based on the characteristics of the data. For example, the K-Means algorithm is suitable for processing spherical clusters, while spectral clustering can handle more complex structures.
[0082] ③ Perform clustering: divide the vertex set V into several clusters (groups), each cluster represents a three-dimensional graphics sub-scene.
[0083] Management of 3D graphics subscenes:
[0084] ① Definition of 3D graphics sub-scene: Each clustering result forms an independent 3D graphics sub-scene, and a separate rendering object can be generated for each 3D graphics sub-scene.
[0085] ② Rendering optimization: When rendering, only the 3D graphics sub-scene related to the current perspective needs to be rendered, which can further reduce the consumption of computing resources.
[0086] Step 3: Based on the topological structure of the 3D graphics scene, obtain the comprehensive rendering priority of each 3D graphics sub-scene.
[0087] In some embodiments, more specifically, in a 3D graphics scene, the position of the viewpoint (or camera) is crucial to the calculation of the rendering priority. The rendering priority of a 3D graphics sub-scene may be evaluated in the following manner.
[0088] Distance calculation:
[0089] ① Euclidean distance: Calculate the distance between the center point or center of gravity of each 3D graphics sub-scene and the viewpoint. The formula is:
[0090] ;
[0091] in,( x scene , y scene , z scene ) represents the center coordinates of the 3D graphics sub-scene, ( x view , y view , z view ) represents the viewpoint coordinates.
[0092] ②Distance weight: 3D graphics sub-scenes that are closer can be given higher rendering priority. You can set a priority score based on the viewpoint distance:
[0093] ;
[0094] in is a small constant to prevent division by zero.
[0095] ① Impact assessment: Some 3D graphics sub-scenes may have a greater visual impact on the final image, such as containing major objects or key landscapes. An impact weight (such as importance score) can be defined for each 3D graphics sub-scene, and priority calculation can be performed in combination with the viewpoint distance.
[0096] ② 3D graphics sub-scene features: Calculate the features of the 3D graphics sub-scene, such as:
[0097] Number of objects: The more objects included, the greater the impact on the picture may be.
[0098] Object type: Dynamic objects may be more important than static objects.
[0099] Then, the viewpoint distance and influence are combined to calculate the comprehensive rendering priority of each 3D graphics sub-scene. The comprehensive rendering priority can be calculated using a weighted summation method:
[0100] ;
[0101] in, priority distance represents the priority score based on the viewpoint distance, ω 1 represents the corresponding weight coefficient. priority influence represents the priority score based on impact, ω 2 represents the corresponding weight coefficient. ω 1 and ω 2 can be adjusted according to specific applications to ensure that the influence of the two factors, the priority score based on viewpoint distance and the priority score based on influence, is appropriate and balanced. priority final Indicates the comprehensive rendering priority of 3D graphics subscenes.
[0102] Step 4: Render the 3D graphics sub-scenes in order based on the size of the comprehensive rendering priority.
[0103] In some embodiments, more specifically, the comprehensive rendering priorities of all three-dimensional graphics sub-scenes are sorted by size, and three-dimensional graphics sub-scenes with larger comprehensive rendering priorities are rendered first. When the three-dimensional graphics sub-scenes with larger comprehensive rendering priorities are rendered, the three-dimensional graphics sub-scenes with smaller comprehensive rendering priorities are rendered.
[0104] Preferably, when the viewpoint moves or the scene changes, the comprehensive rendering priority is updated and reordered in real time to ensure that the rendering order always reflects the current view requirements.
[0105] Based on graph theory, this application represents a three-dimensional graphics scene as a graph G(V, E). By simplifying and segmenting the graph G(V, E), the amount of computation for a single rendering is reduced; at the same time, the rendering order is optimized in combination with the topological structure of the three-dimensional graphics scene, which significantly reduces unnecessary computations and improves the rendering speed. The optimized rendering process maximizes the hardware characteristics of the computer, reduces the occupation of computing resources, and reduces the requirements for hardware. In addition, the flexibility of the graph structure allows the rendering strategy to be dynamically adjusted in complex scenes, which can quickly adapt to dynamically changing scenes and update the rendering results in real time, thereby providing a better user experience. This rendering method can also be extended to various complex scenes and is suitable for different application fields.
[0106] In order to further reduce the amount of rendering calculations and improve the rendering speed, preferably, in some embodiments, a three-dimensional graphics rendering method based on graph theory may also include the following steps.
[0107] Step 5: construct a visibility graph based on the graph G(V, E) and update the visibility relationship between the viewpoint and the object in real time. In some embodiments, more specifically, the following steps are included:
[0108] First, define the visibility graph. The visibility graph is a graph structure in which:
[0109] ① Node (vertex): represents an object or key point in the aforementioned scene or sub-scene.
[0110] ② Edge: represents the visibility relationship between objects. If object B can be directly seen from object A, there is an edge from A to B in the graph.
[0111] Secondly, calculate the visibility relationship, including:
[0112] ① Viewpoint position: Get the position and direction of the current viewpoint, usually provided by the camera model.
[0113] ② Object Boundary: Use the bounding box or bounding volume of an object to quickly determine the visibility between objects. A bounding box is a simple geometric body (such as a cube) that can surround an object and help make preliminary visibility judgments.
[0114] ③Visibility test:
[0115] Ray Casting: Send a ray from the viewpoint to each object and check if it intersects with other objects. If the ray intersects with other objects before reaching the target object, the target object is considered invisible.
[0116] Frustum Culling: Quickly cull objects that are not in view by checking if their bounding box is within the camera's view frustum.
[0117] Finally, the visibility graph is dynamically updated, that is, the aforementioned visibility relationship is updated. In a scene or sub-scene, objects may move and viewpoints may change, so the visibility graph needs to be updated in real time. The specific update methods include the following:
[0118] Event-driven updates: By listening to events in the scene (such as object movement, rotation, viewpoint change, etc.), the visibility map is updated when these events occur.
[0119] Incremental update: When the position or viewpoint of an object does not change much, use the incremental update method to update only the affected part instead of recalculating the entire visibility map. You can use the previous calculation results to quickly determine which objects' visibility needs to be recalculated.
[0120] Layered culling: objects are processed in layers according to their importance or distance. The visibility relationship of objects that are closer to the viewpoint and have greater impact is updated first.
[0121] Step 6: Eliminate occluded objects based on visibility relationships and only render visible objects to reduce rendering calculations.
[0122] In some embodiments, more specifically, once the visibility graph is constructed and updated in real time, the occluded objects can be culled based on the latest visibility relationship.
[0123] First, traverse the visibility graph and for each object, check its in-degree and out-degree in the visibility graph.
[0124] ① In-degree is zero: If an object does not have any visible in-edge, it means that the object is completely occluded and can be culled.
[0125] ② Out-degree is zero: If the object is not blocked by any object, the object is visible and rendering is allowed.
[0126] Secondly, during the rendering process, only visible objects are rendered, thus reducing the amount of calculation.
[0127] This application constructs a visibility graph based on the graph G(V, E), updates the visibility relationship between viewpoints and objects in real time, and then removes obscured objects based on the visibility relationship obtained by real-time updates. During the entire rendering process, only visible objects are rendered, which further reduces the amount of rendering calculations and improves the rendering speed.
[0128] Figure 2A block diagram of an electronic device suitable for implementing the rendering method described above according to an embodiment of the present application is schematically shown. Figure 2 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0129] like Figure 2 As shown, the electronic device 1000 described in this embodiment includes: a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. Processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), and the like. Processor 1001 may also include onboard memory for caching purposes. Processor 1001 may include a single processing unit or multiple processing units for performing different actions of the rendering method flow according to an embodiment of the present application.
[0130] In RAM 1003, various programs and data required for the operation of system 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other through bus 1004. Processor 1001 performs various operations of the rendering method flow according to the embodiment of the present application by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the rendering method flow according to the embodiment of the present application by executing the program stored in the one or more memories.
[0131] According to an embodiment of the present application, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the I / O interface 1005: an input part 1006 including a keyboard, a mouse, etc.; an output part 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage part 1008 including a hard disk, etc.; and a communication part 1009 including a network interface card such as a LAN card, a modem, etc. The communication part 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that the computer program read therefrom is installed into the storage part 1008 as needed.
[0132] According to the rendering method process of the embodiment of the present application, it can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the rendering method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present application are executed. According to an embodiment of the present application, the system, device, means, module and / or unit described above can be implemented by a computer program module.
[0133] The embodiments of the present application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the steps of the rendering method according to the embodiments of the present application can be implemented.
[0134] According to an embodiment of the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), or a portable computer disk. ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In an embodiment of the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present application, a computer-readable storage medium may include one or more memories other than the ROM 1002 and / or RAM 1003 described above.
[0135] It should be noted that the functional modules in the various embodiments of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product.
[0136] The flowchart and / or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flowchart and / or block diagram can represent a part of a module, program segment or code, and a part of the above-mentioned module, program segment or code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0137] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the technical features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope of the present application.
[0138] Although the present application has been shown and described with reference to specific exemplary embodiments of the present application, it should be understood by those skilled in the art that various changes in form and details may be made to the present application without departing from the spirit and scope of the present application as defined by the appended claims and their equivalents. Therefore, the scope of the present application should not be limited to the above-mentioned embodiments, but should be determined not only by the appended claims, but also by the equivalents of the appended claims.
Claims
1. A three-dimensional graphics rendering method based on graph theory, characterized in that: include: The three-dimensional graphic scene is constructed as a graph G(V, E) by taking individual attribute elements of objects in the three-dimensional graphic scene as nodes and object relationship attribute elements as edges; wherein V represents a set of nodes and E represents a set of edges for connecting the above nodes; The graph G(V, E) is simplified and segmented using a minimum spanning tree or clustering algorithm in graph theory to form a number of three-dimensional graphics sub-scenes that can be rendered independently, including: Extracting the object individual attribute element corresponding to each node in the graph G(V, E); Selecting a suitable clustering algorithm to cluster nodes according to the characteristics of the data, so that the similarity of nodes in the same group exceeds a preset similarity threshold, and the similarity of nodes in different groups does not exceed the preset similarity threshold; each group represents a three-dimensional graphic sub-scene; Based on the topological structure of the three-dimensional graphics scene, the rendering priority of each three-dimensional graphics sub-scene is obtained; the rendering priority is obtained in the following manner: Get the Euclidean distance between the center point or center of gravity of each 3D graphics subscene and the viewpoint; The 3D graphics sub-scene with a smaller Euclidean distance from the viewpoint is given a rendering priority with a larger viewpoint distance; The 3D graphics sub-scenes with greater visual impact on the final image will be given greater rendering priority; the criteria for judging the impact include: The more objects included, the greater the impact on the picture; and / or dynamic objects have a greater impact on the picture than static objects; Based on the viewpoint distance rendering priority, influence rendering priority and corresponding weight coefficients, the comprehensive rendering priority of each 3D graphics sub-scene is obtained, including the formula: priority final = ω 1 priority distance + ω 2 priority influence ; in, priority distance Indicates the viewpoint distance rendering priority, ω 1 represents the corresponding weight coefficient; priority influence Indicates the rendering priority of the influence, ω 2 represents the corresponding weight coefficient; priority final Indicates the comprehensive rendering priority of the 3D graphics sub-scene; Rendering the three-dimensional graphics sub-scenes in sequence based on the rendering priorities specifically includes: Sort the comprehensive rendering priority of all 3D graphics sub-scenes by size; Prioritize rendering of 3D graphics sub-scenes with higher overall rendering priority; When the viewpoint moves or the scene changes, the comprehensive rendering priority is updated and reordered in real time to ensure that the rendering order always reflects the current view requirements.
2. The rendering method according to claim 1, characterized in that: Also includes: Building a visibility graph based on the graph G(V, E) and updating the visibility relationship between viewpoints and objects in real time; The obscured objects are eliminated according to the visibility relationship, and only visible objects are rendered to reduce the amount of rendering calculations.
3. The rendering method according to claim 1, characterized in that: The object individual attribute elements include one or more of the object in the three-dimensional graphic scene, the geometric features of the object, the texture features of the object, and the semantic information of the object; The object relationship attribute elements include one or more of an adjacency relationship between objects in a three-dimensional graphic scene, an occlusion relationship between objects, and a similarity relationship between objects.
4. The rendering method according to claim 1, characterized in that: Using the minimum spanning tree in graph theory to simplify and split the graph G(V,E) includes: In the edge set E, a weight is defined for each edge, which is set based on the distance or similarity characteristics between objects; Based on the weight of each edge, construct a minimum spanning tree using Prim's algorithm or Kruskal's algorithm; In the constructed minimum spanning tree, edges whose weights exceed a preset weight threshold are removed to divide the three-dimensional graphic sub-scenes; objects in each of the three-dimensional graphic sub-scenes are connected by edges whose weights do not exceed the preset weight threshold to form several relatively independent areas.
5. The rendering method according to claim 2, characterized in that: The step of constructing a visibility graph based on the graph G(V, E) and updating the visibility relationship between viewpoints and objects in real time includes: The visibility graph is constructed by using nodes to represent objects or key points in a three-dimensional graphic scene or sub-scene and edges to represent visibility relationships between objects; Get the position and direction of the current viewpoint, and determine the visibility relationship between objects based on the bounding box or bounding volume of the object using the visibility test method of ray casting or frustum culling; The visibility relationship is dynamically updated in real time based on one or more updating methods among event-driven updating, incremental updating and hierarchical culling.
6. The rendering method according to claim 5, characterized in that: The step of eliminating the obstructed objects according to the visibility relationship and rendering only the visible objects to reduce the amount of rendering calculations includes: Traversing the visibility graph, checking the in-degree and out-degree of each object in the visibility graph; If an object does not have any visible incoming edges, the object is completely occluded and should be culled; if an object is not occluded by any object, the object is visible and allowed to be rendered; During the rendering process, only visible objects are rendered to reduce the amount of rendering calculations.
7. An electronic device, characterized in that: The invention comprises at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the computer program is executed by the processing unit, the processing unit is enabled to perform the steps of the rendering method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Real-time drawing-oriented large-scale scene organization and scheduling technology and simulation system
CN106446351A
Electric power high-capacity point cloud storage method and rendering method
CN115905586A
VR-based space scene display method and system, and storage medium
CN115984519A