Effective visible grid extraction and efficient rendering method for three-dimensional model
By assigning a unique color value to the triangle face and a camera perspective multihedral distribution technology, combined with the multi-grained metadata retention strategy, the problem of rendering performance bottleneck in super large-scale scenarios is solved, and the full loading of the three-dimensional model is achieved. Efficient rendering improves user experience and rendering speed.
Patent Information
- Application Number
- CN202411223753.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-20
AI Technical Summary
The existing three-dimensional tile technology has a rendering performance bottleneck in super large-scale three-dimensional scenarios, which cannot achieve full loading of models, resulting in slow rendering speed and inability to solve the OverDraw problem, especially in scenarios where hardware performance is limited.
Effective visible mesh extraction and efficient rendering methods are adopted to give a unique color value to the triangle face, combined with camera viewing angle multihedral distribution and adjacent triangle face traversal retention technology, a multi-faceted effective visible mesh model is generated, and a multi-grained metadata retention strategy is adopted. and binary format storage, optimize data volume and rendering process.
In a super large-scale three-dimensional scenario, the full loading of the model is achieved, with small data volume and fast loading speed, which significantly improves the rendering speed, improves the user experience, and reduces hardware requirements. It is suitable for scenarios with limited hardware performance.
Smart Images

Figure CN119169219A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graphics processing technology, and in particular to a method for effectively extracting visible grids and efficiently rendering three-dimensional models. Background Art
[0002] With the rapid development of Building Information Modeling (BIM) technology and the extensive application of CIM, the demand for processing and rendering ultra-large 3D model data is increasing, and the resulting 3D scene rendering performance bottleneck is becoming increasingly prominent.
[0003] In order to solve the problem of 3D scene rendering performance, the current mainstream approach is to adopt 3D tiling technology. 3D tiling technology divides the space where the model is located into multi-level octree blocks (Tile), and then divides the model into components according to the size of the model through relevant threshold calculations, distributes it to each block, and then renders it in units of blocks. Through geometric error technology, the smaller blocks are hidden by judging the camera distance to improve rendering performance. 3D tiling technology can significantly improve rendering performance under small data volumes, but there are still bottlenecks in ultra-large 3D scenes. In order to cope with performance issues, more smaller tiles can only be hidden, which will lead to the lack of models in perception and the inability to load the full amount of visible models. In addition, 3D tiling loading requires data parsing and rendering by tile, which also leads to slow rendering speed and cannot meet the needs of applications; in complex 3D scene rendering, 3D tiling technology cannot solve the problem of OverDraw, which is also a major reason affecting rendering performance. Therefore, the application effect of 3D tiling technology is poor in scenarios with limited hardware performance such as B / S (browser) and mobile terminals.
[0004] Therefore, it is necessary to provide an effective visible mesh extraction and efficient rendering method for three-dimensional models, which can realize full model loading in ultra-large three-dimensional scenes with small data volume and fast loading speed, thus improving user experience. Summary of the invention
[0005] The purpose of the present invention is to provide an effective visible mesh extraction and efficient rendering method for a three-dimensional model, which can realize full model loading in a super-large three-dimensional scene with a small data volume and fast loading speed to improve the user experience.
[0006] In order to solve the problems existing in the prior art, the present invention provides a method for effectively extracting visible meshes and efficiently rendering a three-dimensional model, comprising the following steps:
[0007] S1: Extract the effective visible mesh model of the 3D model as follows:
[0008] S11: inputting the original mesh model, where the original mesh model is organized with triangular faces as basic units;
[0009] S12: Expand vertex index reuse;
[0010] S13: Assign a unique color value to each triangle;
[0011] S14: Render the assigned mesh model and read the screen pixel color;
[0012] S15: retain the valid visible mesh model;
[0013] S2: Processing the effective visible grid model;
[0014] S21: photographing the three-dimensional model from different angles and positions using a camera to obtain a distribution diagram of regular polyhedrons from multiple camera viewing angles;
[0015] S22: Combined with the camera viewpoint polyhedron distribution method, the adjacent triangle face traversal retention technology is introduced to process the effective visible mesh model to form a multi-directional effective visible mesh model;
[0016] S3: Use a multi-granularity metadata retention strategy to store valid visible grid models and metadata;
[0017] S4: Load and render the valid visible mesh model.
[0018] Optionally, in the effective visible mesh extraction and efficient rendering method of the three-dimensional model, in S22, during the traversal process, it is determined whether to retain adjacent triangular faces based on a specific depth threshold; if the depth difference between the adjacent triangular faces and the currently traversed triangular faces is within the threshold range, the adjacent triangular faces are considered to belong to the same continuous surface as the currently traversed triangular faces and are retained as part of the effective visible mesh.
[0019] Optionally, in the effective visible mesh extraction and efficient rendering method of the three-dimensional model, the multi-granularity metadata retention strategy is as follows:
[0020] S31: Organizing metadata according to different granularities of data, the granularities include: component level and scene level, forming component level metadata and scene level metadata;
[0021] S32: Allocate a unique component ID to metadata at each component level, and store the visibility status of the component and various attribute information;
[0022] S33: assigning a unique scene ID to metadata at each scene level and storing various attribute information;
[0023] S34: creating a table for metadata, the table including multiple fields, the fields including a feature ID, a component ID, a scene ID, and various attribute information, the feature ID being used to search for metadata related to each triangle face;
[0024] S35: The table is stored in binary format.
[0025] Optionally, in the effective visible mesh extraction and efficient rendering method of the three-dimensional model, the attributes of the component-level metadata include component color, material, and visibility status; the attributes of the scene-level metadata include whether the scene is displayed and the background settings of the scene.
[0026] Optionally, the effective visible mesh extraction and efficient rendering method of the three-dimensional model further includes a method for optimizing the stored data:
[0027] Set the rules for merge drawing and merge and draw the materials that meet the rules;
[0028] Lower the resolution of your textures.
[0029] Optionally, in the method for extracting and efficiently rendering effective visible meshes of a three-dimensional model, the steps of loading and rendering the effective visible mesh model are as follows:
[0030] S41: downloading a binary format file, parsing the binary format file, and obtaining three-dimensional data;
[0031] S42: using a graphics engine to perform a rendering operation according to the three-dimensional data;
[0032] S43: Use the tabular information of metadata to support interactive operations at different granularity levels.
[0033] Compared with the prior art, the present invention has the following advantages:
[0034] (1) In terms of generating effective visible mesh models, the present invention adopts a visibility judgment technology based on occlusion culling. This technology first assigns a unique color value to each triangle in the original mesh model, then generates a color image through the fast rendering capability of the GPU, and then further analyzes the image to count the triangles corresponding to the visible color values, and retains these triangles as effective visible mesh model data.
[0035] (2) In order to overcome the limitations of the effective visible mesh model under a single viewing angle, the present invention combines the camera viewing angle polyhedron distribution method with the adjacent triangle face traversal retention technology to ensure that the effective visible mesh model is consistent with the original mesh model when observed from multiple angles, providing users with a smoother and more coherent three-dimensional experience.
[0036] (3) For the generated effective visible mesh model, the present invention proposes a multi-granularity metadata retention strategy. These metadata are organized at different granularities (such as component level and scene level) and contain a variety of information closely related to the triangle surface, such as component ID, component attributes, component visibility status, scene ID, scene attributes, etc. Through efficient data optimization and processing, these metadata are stored together with the effective visible mesh data in a file of a specific format for subsequent loading and rendering operations.
[0037] (4) In terms of loading and rendering of effective visible mesh models, the present invention achieves a seamless switching effect with the original mesh model by parsing metadata information. At the same time, these metadata table information also provides users with a wealth of interactive operation options, such as model coloring, visibility settings, etc., further enhancing the practicality and flexibility of the present invention.
[0038] In summary, the present invention can realize full model loading in ultra-large three-dimensional scenes, with small data volume and fast loading speed, thereby meeting the demand of viewing all models under specific perspectives of ultra-large model scenes in scenarios with limited hardware performance, reducing the hardware requirements for three-dimensional model rendering, and significantly improving the rendering speed and user experience under the same hardware conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 A flow chart of a method provided by an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of an effective visible grid provided by an embodiment of the present invention;
[0041] Figure 3 A flowchart of extracting a valid visible mesh model of a three-dimensional model provided by an embodiment of the present invention;
[0042] Figure 4 A schematic diagram of a grid model after rendering and assignment provided by an embodiment of the present invention;
[0043] Figure 5 A schematic diagram of the distribution of regular polyhedrons of camera viewing angles provided in an embodiment of the present invention;
[0044] Figure 6 A schematic diagram of traversing and retaining adjacent triangular faces provided by an embodiment of the present invention;
[0045] Figure 7 A schematic diagram of metadata organization of a valid visible grid provided by an embodiment of the present invention;
[0046] Figure 8 A schematic diagram of the association between a triangular face primitive and a metadata table provided in an embodiment of the present invention;
[0047] Fig. 9 A schematic diagram of using a characteristic ID to search for metadata related to each triangular face provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The specific implementation of the present invention will be described in more detail below in conjunction with the schematic diagram. The advantages and features of the present invention will become clearer based on the following description. It should be noted that the drawings are all in a very simplified form and are not in exact proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.
[0049] Hereinafter, if the method described herein includes a series of steps, the order in which the steps are presented herein is not necessarily the only order in which the steps may be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.
[0050] 3D tiling technology can significantly improve rendering performance with smaller data volumes, but there are still bottlenecks in ultra-large 3D scenes. In order to deal with performance issues, more smaller tiles can only be hidden, which will lead to the lack of perceptual models and the inability to fully load visible models. In addition, 3D tiling loading requires data parsing and rendering by tile, which also leads to slow rendering speed and cannot meet application requirements; in complex 3D scene rendering, 3D tiling technology cannot solve the problem of OverDraw, which is also a major reason affecting rendering performance. Therefore, the application effect of 3D tiling technology is poor in scenarios with limited hardware performance such as B / S (browser) and mobile terminals.
[0051] In order to solve the problems existing in the prior art, the present invention provides an effective visible mesh extraction and efficient rendering method for a three-dimensional model, such as Figure 1 As shown, the method comprises the following steps:
[0052] S1: Extracting the effective visible mesh model of the three-dimensional model. The core of the present invention is to retain only the visible triangular faces in the original mesh model as components of the effective visible mesh. The effective visible mesh is as follows: Figure 2 As shown;
[0053] Extraction method such as Figure 3 As shown, the method is as follows:
[0054] S11: inputting the original mesh model, where the original mesh model is organized with triangular faces as basic units, rather than parameterized or other forms of model data;
[0055] S12: Expand vertex index reuse: The original 3D mesh model usually uses "vertex index reuse technology" to reduce the amount of data storage, that is, multiple triangles may share the same vertex. However, in order to assign colors to each triangle, it is necessary to ensure that each triangle has an independent color identifier, so the vertex index needs to be expanded so that each triangle has independent vertex data.
[0056] S13: assigning a unique color value to each triangle face; after assigning the unique color value, in a subsequent rendering process, by observing the color information in the rendering result, it is possible to accurately identify which triangle faces are visible.
[0057] S14: Render the grid model after the value is assigned and read the screen pixel color; specifically, use the fast rendering capability of the GPU to render the grid model with a unique color value. Figure 4 As shown in the figure, when rendering, only visible triangles are rendered from a specific perspective. After rendering is completed, the pixel color information on the screen is read, and this color information corresponds to the color value of the visible triangle. Figure 4 , there are four triangles to be rendered, but the screen can only read two colors, which means that only two triangles can be seen from the current viewing angle. Therefore, the subset formed by these two triangles will be used as the new valid visible mesh set.
[0058] S15: Retain the effective visible mesh model; based on the read screen pixel color information, it is possible to determine which triangles are visible. Next, these visible triangles are extracted from the original mesh model to form a new mesh subset, namely the effective visible mesh model. This effective visible mesh model contains all triangles visible at a specific viewing angle, and has a relatively small amount of data and fast loading speed, making it very suitable for display and interaction on the B / S side.
[0059] Through step S1, the present invention realizes the process of extracting the effective visible mesh model from the original mesh model, which provides a basis for subsequent large-scale scene loading and rendering.
[0060] S2: In order to overcome the limitations of the effective visible mesh model under a single perspective, that is, the problem of missing mesh display that may occur under other perspectives, this patent proposes a method that combines camera perspective polyhedron distribution with adjacent triangle face traversal retention to process the effective visible mesh model. This method can significantly improve the integrity and accuracy of the model, reduce or eliminate the void problem caused by perspective limitations, and provide more reliable and efficient technical support for large-scale scene loading and rendering.
[0061] Specifically, the effective visible grid model is processed;
[0062] S21: Figure 5As shown, the three-dimensional model is photographed from different angles and positions using a camera to obtain a distribution diagram of multiple camera perspective regular polyhedrons, wherein the spatial distribution of the camera is arranged using the vertices of the regular polyhedron. The vertices of the regular polyhedron (such as a regular tetrahedron, a regular hexahedron, a regular octahedron, etc.) have the characteristic of uniform distribution, which can cover a larger spatial range, thereby capturing as many parts of the model as possible; when there are more camera perspectives, that is, the more vertices of the regular polyhedron used, the more complete the extracted shell is. Because multiple camera perspectives can cover a wider spatial range, reducing shooting blind spots.
[0063] S22: Combined with the camera viewpoint polyhedron distribution method, the adjacent triangle face traversal retention technology is introduced to process the effective visible mesh model to form a multi-directional effective visible mesh model to further reduce cracks and improve the integrity of the effective visible mesh model;
[0064] The technology first stores the triangle information of the original mesh model in the form of an adjacency list. The adjacency list can efficiently represent the connection relationship between triangles, that is, the association between each triangle and its adjacent triangles. Then, in the retained valid visible mesh, we traverse and visit each triangle and check whether its adjacent triangles are also retained.
[0065] Specifically, during the traversal process, a specific depth threshold is used to determine whether to retain adjacent triangular faces. If the depth difference between the adjacent triangular faces and the currently traversed triangular faces is within the threshold range, the adjacent triangular faces and the currently traversed triangular faces are considered to belong to the same continuous surface and are retained as part of the valid visible mesh. In this way, the present invention can gradually expand the range of the valid visible mesh while reducing cracks and missing.
[0066] In one embodiment, Figure 6 As shown, the camera can only generate valid visible meshes f1, f2, and f3, but the present invention can find f4, f5, f6, and f7 through the following table and the adjacent triangle face traversal method, and add them to the valid visible mesh set with a traversal depth of 3 layers. This can effectively solve the problem of incomplete valid visible meshes from the camera perspective (crack surface).
[0067] Table - Adjacent Depth Preserving Triangle Faces Example
[0068] Adjacency Depth Adjacency traversal of mesh triangles Valid visible mesh triangles 0 {} {f1,f2,f3} 1 {f4} {f1,f2,f3,f4} 2 {f5,f6} {f1,f2,f3,f4,f5,f6} 3 {f7} {f1,f2,f3,f4,f5,f6,f7}
[0069] S3: Use a multi-granularity metadata retention strategy to store valid visible grid models and metadata;
[0070] The specific, multi-granular metadata retention strategy is as follows:
[0071] S31: Organizing metadata according to different granularities of data, the granularities include: component level and scene level, forming component level metadata and scene level metadata;
[0072] S32: Figure 7 As shown, a unique component ID is assigned to the metadata at each component level, and the component visibility status and various attribute information are stored; the attributes of the component-level metadata include component color, material, and visibility status; these metadata are associated with the triangular surface data of the component so that they can be accurately applied in the subsequent rendering process.
[0073] S33: Figure 7 As shown, a unique scene ID is assigned to each scene-level metadata, and various attribute information is stored; the attributes of the scene-level metadata include whether the scene is displayed and the background setting of the scene. Through the scene-level metadata, the entire scene can be uniformly managed and controlled.
[0074] S34: creating a table for metadata, the table including multiple fields, the fields including a feature ID, a component ID, a scene ID, and various attribute information, the feature ID being used to search for metadata related to each triangle face;
[0075] Furthermore, in the field of graphics rendering, an ID value is usually assigned to a certain type of feature primitive, and each feature ID is associated with a unique color value, such as Figure 8 As shown, two types of feature IDs are assigned to the triangular surface primitives to represent component-level and scene-level features, and are associated with different metadata tables.
[0076] The following takes the picking operation of the component-level feature ID as an example to illustrate how to find metadata attributes through the feature ID (the scene-level feature ID search process is similar). Fig. 9 As shown: When we pick up on the screen, we use the corresponding color to render the primitive according to the feature ID assigned to the primitive in advance, and then read the pixel color value of the mouse click position on the screen. For example, if the fill color is 1, the corresponding feature ID value is 1. Then, through the metadata attribute table, we find the metadata attribute corresponding to the feature ID 1.
[0077] S35: The table is stored in binary format to improve storage efficiency and ensure high efficiency of data transmission and analysis.
[0078] Preferably, the method further includes optimizing the stored data:
[0079] (1) Setting the merge drawing rules, merging and drawing the materials that meet the rules to reduce the number of state switching during the rendering process, for example, merging and drawing similar materials;
[0080] (2) Reduce the texture resolution to reduce video memory usage.
[0081] S4: Load and render the valid visible mesh model. The steps are as follows:
[0082] S41: Download the binary file, parse the binary file to get the 3D data; first parse the metadata table information, which defines the properties of the components and scenes in detail, and their association with the triangles. Then, parse the 3D data of the valid visible mesh model, including vertex coordinates, normals, texture coordinates, etc.
[0083] S42: Based on the three-dimensional data, a graphics engine is used to perform rendering operations to accurately present the effective visible mesh model on the screen. Since the effective visible mesh model has a small amount of data, its rendering speed is significantly improved compared to the original mesh, thereby significantly improving the overall rendering efficiency.
[0084] S43: After rendering is completed, the metadata table information is used to support interactive operations at different granularity levels. Specifically, the metadata table at the component level is queried through the component ID, so that the triangles and metadata related to the component can be quickly located, thereby supporting common user interactive operations such as coloring, selection, and hiding. Similarly, the scene-level metadata table is queried through the scene ID, so that all components and triangles related to the entire scene can be processed to achieve global rendering control and operation. In addition, scene-level metadata can also be used to achieve a smooth transition switch with the original scene mesh, ensuring that there is no obvious visual jump or delay during the switching process.
[0085] The present invention provides an efficient and flexible data processing and scheduling method by retaining necessary metadata information and organizing the triangles in the effective visible mesh model at a variety of different granularities. This method not only greatly improves the efficiency and quality of rendering, but also provides users with a rich and smooth interactive experience. In three-dimensional graphics and virtual reality applications, the present invention shows a wide range of application prospects and important practical value.
[0086] The present invention can ensure that all visible models in the screen can be quickly and once loaded and accurately presented at any viewing angle, while achieving the advantages of small data volume and fast loading speed, thereby expanding the application scope of three-dimensional models on the B / S side (i.e., the browser side).
[0087] Compared with the prior art, the present invention has the following advantages:
[0088] (1) In terms of generating effective visible mesh models, the present invention adopts a visibility judgment technology based on occlusion culling. This technology first assigns a unique color value to each triangle in the original mesh model, then generates a color image through the fast rendering capability of the GPU, and then further analyzes the image to count the triangles corresponding to the visible color values, and retains these triangles as effective visible mesh model data.
[0089] (2) In order to overcome the limitations of the effective visible mesh model under a single viewing angle, the present invention combines the camera viewing angle polyhedron distribution method with the adjacent triangle face traversal retention technology to ensure that the effective visible mesh model is consistent with the original mesh model when observed from multiple angles, providing users with a smoother and more coherent three-dimensional experience.
[0090] (3) For the generated effective visible mesh model, the present invention proposes a multi-granularity metadata retention strategy. These metadata are organized at different granularities (such as component level and scene level) and contain a variety of information closely related to the triangle surface, such as component ID, component attributes, component visibility status, scene ID, scene attributes, etc. Through efficient data optimization and processing, these metadata are stored together with the effective visible mesh data in a file of a specific format for subsequent loading and rendering operations.
[0091] (4) In terms of loading and rendering of effective visible mesh models, the present invention achieves a seamless switching effect with the original mesh model by parsing metadata information. At the same time, these metadata table information also provides users with a wealth of interactive operation options, such as model coloring, visibility settings, etc., further enhancing the practicality and flexibility of the present invention.
[0092] In summary, the present invention can realize full model loading in ultra-large three-dimensional scenes, with small data volume and fast loading speed, thereby meeting the demand of viewing all models under specific perspectives of ultra-large model scenes in scenarios with limited hardware performance, reducing the hardware requirements for three-dimensional model rendering, and significantly improving the rendering speed and user experience under the same hardware conditions.
[0093] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims
1. A method for extracting effective visible meshes and rendering efficient three-dimensional models, characterized in that: The following steps are involved: S1: Extract the effective visible mesh model of the 3D model as follows: S11: inputting the original mesh model, where the original mesh model is organized with triangular faces as basic units; S12: Expand vertex index reuse; S13: Assign a unique color value to each triangle; S14: Render the assigned mesh model and read the screen pixel color; S15: retain the valid visible mesh model; S2: Processing the effective visible grid model; S21: photographing the three-dimensional model from different angles and positions using a camera to obtain a distribution diagram of regular polyhedrons from multiple camera viewing angles; S22: Combined with the camera viewpoint polyhedron distribution method, the adjacent triangle face traversal retention technology is introduced to process the effective visible mesh model to form a multi-directional effective visible mesh model; S3: Use a multi-granularity metadata retention strategy to store valid visible grid models and metadata; S4: Load and render the valid visible mesh model.
2. The effective visible mesh extraction and efficient rendering method of a three-dimensional model as claimed in claim 1, characterized in that: In S22, during the traversal process, whether to retain adjacent triangular faces is determined based on a specific depth threshold. If the depth difference between the adjacent triangular faces and the currently traversed triangular faces is within the threshold range, the adjacent triangular faces are considered to belong to the same continuous surface as the currently traversed triangular faces and are retained as part of the valid visible mesh.
3. The effective visible mesh extraction and efficient rendering method of a three-dimensional model as claimed in claim 1, characterized in that: The multi-granular metadata retention strategy is as follows: S31: Organizing metadata according to different granularities of data, the granularities include: component level and scene level, forming component level metadata and scene level metadata; S32: Allocate a unique component ID to metadata at each component level, and store the visibility status of the component and various attribute information; S33: assigning a unique scene ID to metadata at each scene level and storing various attribute information; S34: creating a table for metadata, the table including multiple fields, the fields including a feature ID, a component ID, a scene ID, and various attribute information, the feature ID being used to search for metadata related to each triangle face; S35: The table is stored in binary format.
4. The effective visible mesh extraction and efficient rendering method of a three-dimensional model as claimed in claim 3, characterized in that: The properties of component-level metadata include component color, material, and visibility status; the properties of scene-level metadata include whether the scene is displayed and the background settings of the scene.
5. The effective visible mesh extraction and efficient rendering method of a three-dimensional model as claimed in claim 3, characterized in that: It also includes methods for optimizing stored data: Set the rules for merge drawing and merge and draw the materials that meet the rules; Lower the resolution of your textures.
6. The effective visible mesh extraction and efficient rendering method of a three-dimensional model as claimed in claim 1, characterized in that: The steps to load and render a valid visible mesh model are as follows: S41: downloading a binary format file, parsing the binary format file, and obtaining three-dimensional data; S42: using a graphics engine to perform a rendering operation according to the three-dimensional data; S43: Use the tabular information of metadata to support interactive operations at different granularity levels.
