Three-dimensional model layered rendering method and system based on sight distance dynamic loading
Through the hierarchical rendering method of 3D model based on dynamic loading based on line-of-sight, the problems of high preprocessing costs, inconsistent switching and redundant calculation of far-view angles are solved, and an efficient and smooth three-dimensional model browsing experience is achieved.
Patent Information
- Application Number
- CN202510478034.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-16
- Publication Date
- 2025-07-25
AI Technical Summary
The prior art has problems such as high preprocessing costs, incoherent switching and redundant long-view calculations in real-time rendering of super-large three-dimensional models, resulting in high hardware requirements, large storage space usage and poor user experience.
The three-dimensional model hierarchical rendering method based on dynamic loading of sight is adopted. By setting the first and second loading thresholds, the visual distance is calculated in real time, and the complete geometric details of the three-dimensional model are loaded dynamically according to the visual distance changes, simplifying contour lines or gradual gradual manifestations are achieved, combining transparency mixing and geometric deformation interpolation technology to achieve smooth switching.
The rendering efficiency and browsing efficiency of super-large three-dimensional models are improved under the same hardware, reducing computing load and memory footprint, eliminating lag in LOD switching, and optimizing the user experience.
Smart Images

Figure BDA0005361898690000051
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D model design and rendering, and particularly to a 3D model hierarchical rendering method and system based on dynamic loading according to viewing distance. Background Art
[0002] Currently, in the fields of BIM (Building Information Modeling), game engines, industrial design, etc., the real-time rendering of super-large 3D models faces performance bottlenecks. Traditional methods rely on the multi-level detail (LOD) technology, but there are the following technical problems:
[0003] 1. High preprocessing cost: When the system bears super-large 3D models, it has high requirements for hardware conditions. At the same time, it is necessary to pre-generate multiple levels of details for each model, occupying a large amount of storage space and being difficult to adjust dynamically; 2. Incoherent switching: LOD is prone to visual jumps and lags during level switching, affecting the user experience; 3. Redundant calculation for far viewing angles: Even at long viewing distances, high-precision details are still rendered, occupying a large amount of video memory and wasting computing resources. Therefore, it is necessary to provide a 3D model hierarchical rendering method and system based on dynamic loading according to viewing distance, which can solve the above technical problems. Summary of the Invention
[0004] The purpose of the present invention is to provide a 3D model hierarchical rendering method and system based on dynamic loading according to viewing distance, which can solve the above technical problems.
[0005] The present invention is implemented as follows:
[0006] A 3D model hierarchical rendering method based on dynamic loading according to viewing distance includes the following steps:
[0007] Step 1: Import the 3D model into the model viewer;
[0008] Step 2: Set the first loading threshold R - Δ and the second loading threshold R + Δ;
[0009] Step 3: Real-time calculate the viewing distance between the camera of the model viewer and the 3D model;
[0010] Step 4: The model viewer dynamically loads the 3D model according to the change of the viewing distance.
[0011] In the above-mentioned Step 3, the viewing distance is the shortest distance from the camera lens in the model viewer to the surface of the 3D model calculated in real time based on the space segmentation algorithm.
[0012] In step 4, when the viewing distance is less than the first loading threshold R - Δ, the model viewer loads the complete geometric details of the 3D model; when the viewing distance is greater than the second loading threshold R + Δ, the model viewer only loads the simplified contour lines of the 3D model; when the viewing distance is between the first loading threshold R - Δ and the second loading threshold R + Δ, the model viewer gradually fades in and out to load the 3D model.
[0013] In step 4, when the model viewer only loads the contours of the 3D model, it includes the following sub-steps:
[0014] Step 4.1: Identify the contour edges of the 3D model;
[0015] Step 4.2: Convert the contour edges into a closed polygon chain composed of key vertices;
[0016] Step 4.3: Generate the simplified contour lines of the 3D model in real time according to the closed polygon chain;
[0017] Step 4.4: The model viewer loads the simplified contour lines of the 3D model.
[0018] In step 4.2, the topological structure of the 3D model is retained in the closed polygon chain.
[0019] When the model viewer gradually fades in and out to load the 3D model, the smooth switching between the complete geometric details and the simplified contour lines of the 3D model is achieved through transparency blending and geometric deformation interpolation techniques.
[0020] The 3D model hierarchical rendering system adopting the above-mentioned 3D model hierarchical rendering method based on dynamic loading according to viewing distance provides a viewing distance detection module, and the viewing distance detection module is used to calculate the viewing distance between the camera of the model viewer and the 3D model in real time;
[0021] Provide a dynamic loading module, and the dynamic loading module is equipped with dynamic loading decision logic to enable the model viewer to dynamically load the 3D model based on the viewing distance through the dynamic loading module;
[0022] Provide a contour generation module, and the contour generation module is equipped with a contour lightweight algorithm, which is used to extract the contour edges of the 3D model and generate simplified contour lines after converting the contour edges into a closed polygon chain.
[0023] The contour generation module further includes a gradual transition module, and the gradual transition module is used to smoothly switch between the complete geometric details and the simplified contour lines of the 3D model.
[0024] The viewing distance detection module and the contour generation module are driven in parallel by the GPU resource scheduler to display different loaded contents according to different viewing distances, so as to achieve the dynamic loading effect based on the viewing distance.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] 1. According to the real-time distance, i.e., the viewing distance, between the camera lens and the surface of the 3D model, the present invention automatically switches between the loading of high-precision complete geometric details and the loading of lightweight simplified contour lines, and realizes a smooth switch between the complete geometric details and the simplified contour lines through a progressive fade-in and fade-out transition. It can achieve efficient and smooth browsing of the 3D model. Through a lightweight and viewing-distance dynamically adaptive rendering scheme, while ensuring the visual effect, it reduces the computational load and avoids waste of computing resources, especially suitable for browsing super-large 3D models.
[0027] 2. Under the same hardware, the present invention improves the scale bearing capacity of super-large 3D models by 5-8 times, improves the rendering efficiency and browsing efficiency of super-large 3D models, reduces the memory occupancy, and reduces the video memory occupancy by more than 90% in the long-distance mode. It can eliminate the problems of LOD switching jitter and incoherence, and optimize the user experience. Specific Embodiments
[0028] Step 1: Import the 3D model into the model viewer.
[0029] Preferably, the model viewer can be an industrial CAD model viewer or a large game engine in the prior art. Correspondingly, the 3D model can be a super-large 3D model such as a BIM model, a mechanical model, or a game scene.
[0030] Step 2: Set the first loading threshold R-Δ and the second loading threshold R+Δ.
[0031] The parameters of the first loading threshold R-Δ and the second loading threshold R+Δ can be adaptively adjusted according to the actual application model viewer, its 3D model, and the loading effect.
[0032] Step 3: Calculate the viewing distance between the camera of the model viewer and the 3D model in real time.
[0033] Preferably, the viewing distance can be calculated based on the spatial segmentation algorithm (such as octree, etc.) in the prior art to calculate the shortest distance from the camera lens in the model viewer to the surface of the 3D model in real time.
[0034] Spatial segmentation algorithms such as octree are conventional calculation means in the art, and the viewing distance can be automatically calculated through a specific computer program. The calculation process is not elaborated here.
[0035] Step 4: The model viewer dynamically loads the 3D model according to the change of the viewing distance.
[0036] Specifically, when the viewing distance is less than the first loading threshold R - Δ, the model viewer loads the complete geometric details of the 3D model; when the viewing distance is greater than the second loading threshold R + Δ, the model viewer only loads the simplified contour lines of the 3D model; when the viewing distance is between the first loading threshold R - Δ and the second loading threshold R + Δ, the model viewer gradually loads the 3D model.
[0037] Under the same hardware conditions, since when the viewing distance is greater than the second loading threshold R + Δ, the model viewer only loads the simplified contour lines of the 3D model, it can greatly reduce the memory occupancy, increasing the bearing capacity of the model viewer for large 3D models by 5 - 8 times. In a large game engine, in the far - view mode, only the simplified contour lines of the far - view are loaded, which can reduce the video memory occupancy by more than 90%. There is no need to load the complete level - of - detail (LOD), thus eliminating the problem of discontinuous and laggy LOD switching, greatly optimizing the user experience.
[0038] In step 4 described above, when the model viewer only loads the contour of the 3D model, it includes the following sub - steps:
[0039] Step 4.1: Identify the contour edges of the 3D model through normal difference analysis or curvature calculation of existing technologies.
[0040] Normal difference analysis or curvature calculation is a conventional means of identifying contour edges in this field and can be implemented through specific computer programs. The identification process is not elaborated here.
[0041] Step 4.2: Convert the contour edges into a closed polygon chain composed of key vertices.
[0042] The contour edges are actually smooth curves composed of dense points. Key vertices can be selected according to the part structure of the 3D model, and a closed polygon chain is formed by connecting multiple key vertices, thereby realizing the lightweight of the contour edges to reduce the memory occupancy.
[0043] The more the number of key vertices, the higher the coincidence degree between the closed polygon chain and the contour edges, but it will increase the memory occupancy. The fewer the number of key vertices, the lower the coincidence degree between the closed polygon chain and the contour edges, but it can reduce the memory occupancy. The number of key vertices can be adaptively adjusted according to actual application requirements and display effects.
[0044] The topological structure of the 3D model is retained in the closed polygon chain to ensure the continuity and closure of the closed polygon chain and the contour display effect of the 3D model.
[0045] Step 4.3: According to the closed polygon chain, the simplified contour lines of the 3D model are generated in real - time through a geometric shader of existing technologies.
[0046] The geometry shader is a conventional means for line display in the art, and the specific process of generating a simplified contour line will not be elaborated here.
[0047] Step 4.4: The model viewer loads the simplified contour line of the 3D model.
[0048] When the model viewer gradually loads the 3D model, the smooth switching between the complete geometric details and the simplified contour line of the 3D model is achieved through the transparency blending and geometric deformation interpolation techniques of the prior art.
[0049] By loading the 3D model in a progressive and fading mode, based on the dual smoothing mechanism of geometric deformation interpolation and transparency blending, the display effect is between the complete geometric details and the simplified contour line, so as to improve the smoothness of the switching between the complete geometric details and the simplified contour line, thereby eliminating the problems of LOD switching jitter and incoherence.
[0050] The transparency blending and geometric deformation interpolation techniques are common graphics rendering techniques in the art, and the specific rendering process will not be elaborated here.
[0051] A 3D model hierarchical rendering system based on dynamic loading according to the viewing distance provides a viewing distance detection module, and the viewing distance detection module is used to calculate the viewing distance between the camera of the model viewer and the 3D model in real time.
[0052] Provide a dynamic loading module, and the dynamic loading module is equipped with dynamic loading decision logic, so that the model viewer dynamically loads the 3D model through the dynamic loading module based on the viewing distance.
[0053] The program of the dynamic loading decision logic is as follows:
[0054] ```if distance<R-Δ: Load the complete mesh
[0055] elif R-Δ≤distance≤R+Δ: Blend and render details and contours
[0056] else: Only render the contour ```
[0057] Provide a contour generation module, and the contour generation module is equipped with a contour lightweight algorithm, which is used to extract the contour edges of the 3D model and generate a simplified contour line after converting the contour edges into a closed polygon chain.
[0058] The program of the contour lightweight algorithm is as follows:
[0059]
[0060] Real-time edge detection and edge geometry simplification are achieved through the contour lightweight algorithm, and there is no need to generate complete geometric details, that is, LOD data.
[0061] The described contour generation module further includes a progressive transition module, which is used to smoothly switch between the complete geometric details and the simplified contour lines of the 3D model.
[0062] The described viewing distance detection module and contour generation module are driven in parallel by a GPU (Graphic Processing Unit) resource scheduler to display different loaded contents according to different viewing distances, so as to achieve the dynamic loading effect based on the viewing distance.
[0063] Embodiment 1: The present invention is used in an industrial CAD model viewer to view a 10GB-level mechanical assembly model.
[0064] The user imports a 10GB-level mechanical assembly model into the industrial CAD model viewer.
[0065] Set the first loading threshold R-Δ to 5m and the second loading threshold R+Δ to 20m.
[0066] When the user zooms the camera lens in the industrial CAD model viewer to the surface of the parts of the 10GB-level mechanical assembly model (the distance between the camera lens and the part surface < 5 meters), the industrial CAD model viewer loads the complete geometric details of the 10GB-level mechanical assembly model, that is, microscopic features such as threaded holes and chamfers.
[0067] When the user zooms the camera lens out in the industrial CAD model viewer to the overall view (the distance between the camera lens and the part surface > 20 meters), the contour edge of the 10GB-level mechanical assembly model is identified through the contour lightweight algorithm in the contour generation module based on the normal difference analysis technology of the prior art, and the contour edge is converted into a closed polygon chain composed of key vertices, and the topological structure is retained, and the simplified contour line of the 3D model is generated in real time through the geometric shader of the prior art. The industrial CAD model viewer only loads the outer contour line frame of the 10GB-level mechanical assembly model, that is, the simplified contour line, and the patch data of the 10GB-level mechanical assembly model can be reduced from 2 million to 5,000.
[0068] When the user pulls the camera lens in the industrial CAD model viewer to the range of 5-20 meters, the progressive transition module realizes the fade-in and fade-out loading effect transition of the 10GB-level mechanical assembly model based on the transparency blending and geometric deformation interpolation technology, and the frame rate can be increased from 15fps to 60fps.
[0069] Embodiment 2: The present invention is used in a certain large game engine.
[0070] In the distant view scene, only the contour silhouette, that is, the simplified contour line, of the distant view mountains is rendered, which can save 70% of the GPU memory.
[0071] In the near-view scenario, that is, when the character approaches within 100 meters, the complete geometric details of the vegetation leaves are dynamically loaded.
[0072] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the invention. Therefore, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading, characterized in that: It includes the following steps: Step 1: Import the 3D model into the model viewer; Step 2: Set the first loading threshold R-Δ and the second loading threshold R+Δ; Step 3: Calculate the viewing distance between the camera of the model viewer and the 3D model in real time; Step 4: The model viewer dynamically loads the 3D model according to the change of the viewing distance.
2. The three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 1, wherein: In the said Step 3, the viewing distance is the shortest distance from the camera lens in the model viewer to the surface of the 3D model calculated in real time based on the space segmentation algorithm.
3. The three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 1, wherein: In the said Step 4, when the viewing distance is less than the first loading threshold R-Δ, the model viewer loads the complete geometric details of the 3D model; when the viewing distance is greater than the second loading threshold R+Δ, the model viewer only loads the simplified contour line of the 3D model; when the viewing distance is between the first loading threshold R-Δ and the second loading threshold R+Δ, the model viewer gradually loads the 3D model.
4. The three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 3, wherein: In the said Step 4, when the model viewer only loads the contour of the 3D model, it includes the following sub-steps: Step 4.1: Identify the contour edge of the 3D model; Step 4.2: Convert the contour edge into a closed polygon chain composed of key vertices; Step 4.3: Generate the simplified contour line of the 3D model in real time according to the closed polygon chain; Step 4.4: The model viewer loads the simplified contour line of the 3D model.
5. The three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 4, characterized in that: In the said Step 4.2, the topological structure of the 3D model is retained in the closed polygon chain.
6. The three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 3, wherein: When the model viewer gradually loads the 3D model, the smooth switching between the complete geometric details and the simplified contour line of the 3D model is realized through transparency blending and geometric deformation interpolation techniques.
7. A three-dimensional model hierarchical rendering system adopting the three-dimensional model hierarchical rendering method based on line-of-sight dynamic loading according to claim 1, characterized in that: Provide a viewing distance detection module, which is used to calculate the viewing distance between the camera of the model viewer and the 3D model in real time; Provide a dynamic loading module, which is equipped with dynamic loading decision logic, so that the model viewer dynamically loads the 3D model based on the viewing distance through the dynamic loading module; Provide a contour generation module, which is equipped with a contour lightweight algorithm, used to extract the contour edge of the 3D model, and generate a simplified contour line after converting the contour edge into a closed polygon chain.
8. The three-dimensional model layer rendering system according to claim 7, characterized in that: The said contour generation module also includes a progressive transition module, which is used to smoothly switch between the complete geometric details and the simplified contour line of the 3D model.
9. The three-dimensional model layer-by-layer rendering system according to claim 7, characterized in that: The said viewing distance detection module and contour generation module are driven in parallel by the GPU resource scheduler to display different loaded contents according to different viewing distances, so as to achieve the dynamic loading effect based on the viewing distance.