Method for improving display frame rate after unit primitive is converted into gltf format
By traversing and merging unit primitives in the dgn model in BIM technology, the problem of low rendering efficiency after converting the 3D information model to gltf format is solved, and the frame rate is improved and the rendering efficiency is optimized.
Patent Information
- Application Number
- CN202410680733.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-30
AI Technical Summary
In BIM technology, after the unit primitives of the three-dimensional information model are converted into the gltf format, the rendering and display efficiency of the three-dimensional graphics is low, the frame rate is not high, and the browsing of the three-dimensional scene is not smooth.
By traversing the unit type primitives in the dgn building information model, using a recursive algorithm to find and triangulate the sub-elements, merging the geometric information to form a merged comprehensive element, and outputting it in gltf format, simplifying the file content and reducing primitives Number of draws.
Significantly improve the frame rate of 3D graphics loading and display, optimize the structure of gltf format, and improve the rendering efficiency of 3D information model.
Smart Images

Figure CN118570413A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer graphics and building information modeling, and in particular to a method for improving the display frame rate after unit graphics elements are converted into a glTF format. Background Art
[0002] With the application of BIM technology, a large number of 3D information models need to be shared using web technology. When loading and displaying 3D information models on the browser side, it is necessary to take into account the structure, retrieval timing and rendering efficiency of the 3D model in order to accurately and efficiently realize 3D applications.
[0003] The current main way to publish 3D models is to use gltf and 3dtiles formats for information model publishing. Since the information model needs to meet the requirements of the corresponding entity decomposition structure, the number of primitives is generally large, among which the proportion of unit-type primitives is large. Multiple layers of sub-elements are nested inside the unit, resulting in a complex graphic structure. Therefore, the efficiency of 3D graphics rendering and display is low, the frame rate is generally not high, and the browsing of 3D scenes is not smooth. Summary of the invention
[0004] The object of the present invention is to provide a method for improving the display frame rate after a unit graphic element is converted into a gltf format, so as to solve the problems raised in the above-mentioned background technology.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] The method for improving the display frame rate after the unit graphics element is converted into the gltf format comprises the following steps:
[0007] (1) First, traverse the elements in the dgn building information model and obtain the element C of the unit type. In dgn, the type of unit C is SHARED_CELL_ELM;
[0008] (2) Through a recursive algorithm, each sub-element Ei in the cell C is searched and triangulated to obtain geometric information and store it in the geometric information set G. After the recursion is completed, the tile extraction of sub-elements at all levels of the cell C is realized;
[0009] (3) Stitching each sub-element graphics in the geometric information set G, compiling a triangle surface merging function, merging the geometric information of each sub-element in the geometric information set G, and forming a new integrated element NE after merging;
[0010] (4) After the processing is completed, the new information is output in gltf format;
[0011] (5) Load and render on the web side.
[0012] Further technology of the present invention:
[0013] Preferably, the geometric information in step (2) includes vertex coordinates, normal vectors, UV coordinates and indexes of each part.
[0014] Preferably, the merging process of step (3) includes merging of coordinate arrays and updating of their indexes, merging of normal vector arrays and updating of their indexes, and merging of texture UV coordinates and updating of their indexes.
[0015] Preferably, the specific process of step (3) is:
[0016] Loop through the geometric information of each sub-element and execute respectively:
[0017] Append the vertex coordinate array in the sub-element geometry information to the vertex coordinate array of the new element NE;
[0018] Append the normal vector array in the sub-element geometry information to the normal vector array of the new element NE;
[0019] Append the UV array in the sub-element geometry information to the UV array of the new element NE;
[0020] After increasing the vertex index array in the sub-element geometry information by the current vertex length value of NE, append it to the vertex index array of the new element NE;
[0021] The normal vector index array in the sub-element geometry information is increased by the length value of the current normal vector of NE, and then appended to the normal vector index array of the new element NE;
[0022] Add the UV index array in the sub-element geometry information to the UV index array of the new element NE after increasing the length of the NE's current UV coordinates.
[0023] After the loop is finished, the stitching of each sub-element is completed to form the vertex coordinate array, normal vector array, UV coordinate array, vertex index array, normal vector index array and UV index array of the final new element NE.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] The present invention optimizes the structure when exporting unit type primitives in the original BIM model, adjusts the node structure in gltf and its corresponding mesh and priority, simplifies the file content, reduces the number of primitive drawing times, and optimizes the structure after exporting gltf from the three-dimensional information model by this method, and significantly improves the frame rate of loading and displaying three-dimensional graphics. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is the technical roadmap of the present invention;
[0027] Figure 2 It is a structural diagram of the unit and its sub-elements of the present invention;
[0028] Figure 3 It is a schematic diagram of the geometric information set G of the present invention;
[0029] Figure 4 This is a unit structure diagram after the elements of the present invention are stitched together. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work based on the embodiments of the present invention shall fall within the scope of protection of the present invention.
[0031] See also Figure 1-4 The present invention provides an embodiment: a method for improving the display frame rate after the unit graphics element is converted into gl tf format. The method and tool are developed using the MDL language. The specific method is as follows: Figure 1 .
[0032] (1) First, traverse the elements in the DGN building information model and obtain the element C of the unit type. In DGN, the type of unit C is SHARED_CELL_ELM.
[0033] (2) Figure 2 , through the recursive algorithm, find each sub-element Ei in the unit C, and triangulate it to obtain the geometric information (vertex coordinates, normal vectors, UV coordinates and indexes of each part) and store it in the geometric information set G, such as Figure 3 After the recursion is completed, the sub-elements of each level of cell C are flattened and extracted.
[0034] (3) Stitching the sub-element graphics in the geometric information set G. Compile a triangle surface merging function to merge the geometric information of each sub-element in the geometric information set G to form a new integrated element NE after merging, such as Figure 4 The merging process includes the merging of coordinate arrays and their index updates, the merging of normal vector arrays and their index updates, and the merging of texture UV coordinates and their index updates.
[0035] The specific process is: loop through the geometric information of each sub-element and execute respectively:
[0036] Append the vertex coordinate array in the sub-element geometry information to the vertex coordinate array of the new element NE;
[0037] Append the normal vector array in the sub-element geometry information to the normal vector array of the new element NE;
[0038] Append the UV array in the sub-element geometry information to the UV array of the new element NE;
[0039] After increasing the vertex index array in the sub-element geometry information by the current vertex length value of NE, append it to the vertex index array of the new element NE;
[0040] The normal vector index array in the sub-element geometry information is increased by the length value of the current normal vector of NE, and then appended to the normal vector index array of the new element NE;
[0041] After increasing the UV index array in the sub-element geometry information by the length value of the current UV coordinate of NE, append it to the UV index array of the new element NE.
[0042] After the loop is finished, the stitching of each sub-element is completed to form the vertex coordinate array, normal vector array, UV coordinate array, vertex index array, normal vector index array and UV index array of the final new element NE.
[0043] (4) After the processing is completed, the new information is output in gltf format.
[0044] (5) Load and render on the web side.
[0045] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for improving the display frame rate after the unit primitive is converted to gltf format. It is characterized in that The following steps are involved: (1) First, traverse the elements in the dgn building information model and obtain the element C of the unit type. In dgn, the type of unit C is SHARED_CELL_ELM; (2) Through a recursive algorithm, each sub-element Ei in the cell C is searched and triangulated to obtain geometric information and store it in the geometric information set G. After the recursion is completed, the tile extraction of sub-elements at all levels of the cell C is realized; (3) Stitching each sub-element graphics in the geometric information set G, compiling a triangle surface merging function, merging the geometric information of each sub-element in the geometric information set G, and forming a new integrated element NE after merging; (4) After the processing is completed, the new information is output in gltf format; (5) Load and render on the web side.
2. According to the method for improving the display frame rate after the unit primitive is converted into the gltf format as described in claim 1, It is characterized in that Step (2) The geometric information includes vertex coordinates, normal vectors, UV coordinates and the index of each part.
3. According to the method for improving the display frame rate after the unit primitive is converted into the gltf format as described in claim 2, It is characterized in that The merging process of step (3) includes merging of coordinate arrays and updating of their indexes, merging of normal vector arrays and updating of their indexes, and merging of texture UV coordinates and updating of their indexes.
4. The method for improving the display frame rate after the unit primitive is converted into the gltf format according to claim 3, It is characterized in that The specific process of step (3) is as follows: Loop through the geometric information of each sub-element and execute respectively: Append the vertex coordinate array in the sub-element geometry information to the vertex coordinate array of the new element NE; Append the normal vector array in the sub-element geometry information to the normal vector array of the new element NE; Append the UV array in the sub-element geometry information to the UV array of the new element NE; After increasing the vertex index array in the sub-element geometry information by the current vertex length value of NE, append it to the vertex index array of the new element NE; The normal vector index array in the sub-element geometry information is increased by the length value of the current normal vector of NE, and then appended to the normal vector index array of the new element NE; Add the UV index array in the sub-element geometry information to the UV index array of the new element NE after increasing the length of the NE's current UV coordinates. After the loop is finished, the stitching of each sub-element is completed to form the vertex coordinate array, normal vector array, UV coordinate array, vertex index array, normal vector index array and UV index array of the final new element NE.
