An efficient 3D modeling dynamic rendering method
Optimizing three-dimensional modeling dynamic rendering through four buffer architectures, solving the performance bottleneck of complex model rendering, achieving smoother interactive experience and more efficient resource utilization, and supporting real-time rendering of complex models.
Patent Information
- Application Number
- CN202510543884.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The existing three-dimensional modeling dynamic rendering technology has performance bottlenecks when processing complex models, resulting in picture lag and delay, and high resource consumption, making it difficult to meet the needs of real-time rendering, especially on mobile devices.
Four buffer architectures are adopted, namely B1 frame buffer, B2 frame buffer, B3 frame buffer and B4 frame buffer. Model elements are rendered and stored through B3 frame buffer, and the results are backed up in the middle of the B4 frame buffer, and the rendering process is optimized for highlighting effects and dynamic temporary elements to reduce repeated calculations.
It significantly improves the dynamic rendering speed of three-dimensional modeling, reduces latency and lag, improves operation experience and work efficiency, supports more complex models and higher quality rendering effects, and optimizes hardware resource utilization.
Smart Images

Figure CN120070777B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of three-dimensional software, and in particular to an efficient three-dimensional modeling dynamic rendering method. Background Art
[0002] When engineers use CAD software for drawing or BIM software for 3D modeling, dynamic model creation is a key interactive feature provided by the software. For example, when users draw lines, adjust vertices, or preview deformation results in real time within the modeling software, dynamic rendering follows the mouse movement to present the intermediate modeling results in real time within the viewport. Therefore, dynamic rendering is crucial in enhancing the user interaction experience, but it also requires fast refresh rates to ensure smooth interaction.
[0003] During graphics display, the computer retrieves data from the display buffer and presents it on the monitor. Computing each frame takes a significant amount of time, especially for complex scenes, which require extensive graphics computation. Typically, the monitor's refresh rate exceeds the rendering speed of each frame, necessitating multiple accesses to the display buffer to render a complete frame. This results in graphics that appear to be tearing or flickering on the monitor. This is a common problem encountered during rendering using a single buffer.
[0004] To address this issue, the most common solution is double buffering. This involves a front buffer and a back buffer. The front buffer still handles the final graphics output, but all rendering instructions are drawn on the back buffer. After rendering is complete, the front and back buffers are swapped, and a complete frame is immediately presented. Double buffering solves the problem of image tearing.
[0005] However, using only double buffering, dynamic rendering in the 3D modeling process still faces significant performance issues, especially dynamic rendering based on complex models. Currently, common implementation methods and some optimization measures include:
[0006] 1) During dynamic rendering, each frame refresh requires a complete refresh of the entire model scene, meaning all scene elements must be redrawn. All calculation results are stored in the back buffer, and after rendering is complete, the front and back buffers are swapped and displayed. This approach has little impact when rendering simple models, but performance issues become apparent when rendering complex models that require lengthy calculations.
[0007] 2) Methods for simplifying geometry. Dynamically rendered elements are usually temporary elements and are not part of the model. Their function is to store intermediate modeling results. Therefore, simplified geometry can be used to represent dynamically rendered elements while ensuring visual feedback (for example, using lines or point clouds instead of complex meshes). Using low-precision geometry can reduce the number of vertices and triangle calculations, making it faster for the GPU (Graphics Processing Unit). In addition, temporary elements may not require complex shading, and disabling lighting, shadows, and textures can save computing resources. This method can indeed improve the rendering efficiency of the dynamic temporary elements themselves.
[0008] 3) Incremental update method. A specific algorithm is used to calculate the dirty rectangular area of a dynamically rendered element, and only that portion of the dirty area is updated, rather than a full refresh. The specific steps in the back buffer are: first calculate the dirty area, then redraw the dirty portion, leaving the rest unchanged.
[0009] The aforementioned optimization methods have indeed improved the efficiency of dynamic 3D modeling rendering in some respects. However, using existing technologies alone still presents several bottlenecks, limiting further performance improvements. The main drawbacks are: 1) Rendering efficiency remains low, especially when processing complex scenes. Existing technologies often struggle to meet the demands of real-time rendering, leading to issues such as image freezes and delays. 2) Existing technologies are resource-intensive, requiring significant computational resources and storage space, limiting their applicability on resource-constrained platforms such as mobile devices. Summary of the Invention
[0010] In order to overcome the deficiencies of the above technologies, the present invention provides an efficient three-dimensional modeling dynamic rendering method.
[0011] The technical solution adopted by the present invention to overcome the technical problems is:
[0012] An efficient 3D modeling dynamic rendering method includes the following steps:
[0013] S1. Classify the graphic elements to be rendered into at least model elements, decorative elements, dynamic temporary elements, and highlight effects of model elements;
[0014] S2. Define four buffers, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer. Among them, B1 frame buffer is responsible for graphics output presentation, B2 frame buffer is used to handle dynamic refresh of the view, B3 frame buffer is used to store intermediate rendering results, and B4 frame buffer is used to save the latest state of the model scene;
[0015] S3, rendering and storing the model element through the B3 frame buffer, and backing it up to the B4 frame buffer; then determining whether the model element has the selected highlight effect: if so, executing the next step; otherwise, executing step S5;
[0016] S4. Rendering and storing the highlight effect of the model element through the B3 frame buffer, and backing it up to the B4 frame buffer;
[0017] S5. Render the dynamic temporary element or decorative element. During rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as a background and perform dynamic rendering based on this background. After the dynamic temporary element or decorative element is rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0018] Furthermore, in step S1:
[0019] Model elements include at least line strings, polygons, curves and surfaces, entities, and meshes;
[0020] Decorative elements include at least coordinate axes, coordinate grids, AccuDraw compasses, custom-drawn mouse or icon styles, and explanatory text boxes and text;
[0021] Dynamic temporary elements refer to the intermediate modeling results presented during the modeling process;
[0022] The highlight effect of model elements refers to the highlight rendering effect after the model elements are selected.
[0023] Furthermore, in step S2:
[0024] The B3 frame buffer and the B4 frame buffer are configured as a bidirectional connection relationship, so that the content of the B3 frame buffer is backed up to the B4 frame buffer and the content of the B4 frame buffer is restored to the B3 frame buffer;
[0025] The B3 frame buffer and the B1 frame buffer are configured as a unidirectional connection relationship, so that the content of the B3 frame buffer is copied to the B1 frame buffer;
[0026] The B1 frame buffer and the B2 frame buffer are configured to be in an exchange relationship with each other. After each frame is rendered in the B2 frame buffer, the B1 frame buffer and the B2 frame buffer are exchanged.
[0027] Furthermore, in step S3, all model elements need to be re-rendered in the B3 frame buffer only when at least one of the following situations exists:
[0028] (1) There are changes in some elements of the model;
[0029] (2) The camera parameters of the view change;
[0030] (3) The user reloads the entire model file or refreshes the entire view by calling a command.
[0031] Furthermore, in step S3, after the model element is re-rendered in the B3 frame buffer, the rendering result is immediately and synchronously backed up to the B4 frame buffer so that the latest rendering result is always stored in the B4 frame buffer.
[0032] Furthermore, in step S4, the coverage range of the highlight effect of the model element is calculated, and the range is set as the dirty area, and then only the dirty area is rendered, including rendering the model element in the dirty area and rendering the highlight effect of the model element.
[0033] Furthermore, after the model elements in the dirty area and the highlight effects of the model elements are rendered, the rendering results of the dirty area are immediately and synchronously backed up to the same range area in the B4 frame buffer.
[0034] Furthermore, in step S5, when rendering dynamic temporary elements or decorative elements, the content stored in the B4 frame buffer is restored to the B3 frame buffer. Based on the current B3 frame buffer state, the existing B3 frame buffer result is not erased and is used as the background to continue rendering.
[0035] Furthermore, in step S5, the dynamic temporary elements and the decorative elements are directly rendered. After the rendering is completed, there is no need to back up the rendering results to the B4 frame buffer.
[0036] Furthermore, after step S2, the method further includes a step of dynamically refreshing the view using the B2 frame buffer. The method of dynamically refreshing the view using the B2 frame buffer specifically includes the following steps:
[0037] The view is dynamically refreshed and rendered to the B2 frame buffer. In the process of re-rendering all model elements, a maximum timeout is set to control the speed of single-frame rendering. If the single-frame rendering time exceeds the preset maximum timeout, the rendering of this frame is stopped. After each frame is rendered, the B2 frame buffer and the B1 frame buffer are swapped and the refresh result is presented in the view.
[0038] The beneficial effects of the present invention are:
[0039] 1) This invention can support the development of underlying graphics layers for 3D CAD or BIM software, significantly improving the speed of dynamic rendering for 3D modeling. This optimized rendering performance can reduce development delays and unnecessary debugging caused by rendering bottlenecks, thereby shortening product development cycles and reducing costs.
[0040] 2) This invention can improve the designer's operational experience. The enhanced rendering performance can significantly increase the frame rate of real-time rendering, making the graphics designers see smoother and clearer when performing 3D modeling, reducing delays and lags, and providing a more fluid interactive experience.
[0041] 3) This invention can improve the work efficiency of designers. Especially when frequently adjusting and modifying models, the improvement of dynamic rendering performance allows designers to avoid long waiting times when modeling, thereby greatly improving work efficiency.
[0042] 4) This invention improves software support for large-scale models. With improved dynamic rendering performance, designers can build complex 3D models or large-scale scenes while maintaining a good interactive experience. This is particularly important for the architecture and engineering industries, where models often contain a wealth of details and complex geometries.
[0043] 5) This invention enables the software to support higher-quality rendering effects. With improved dynamic rendering performance, the base model can support higher-level rendering effects without affecting the smoothness of dynamic rendering during modeling, such as more detailed lighting and shadow effects, reflections, and refractions, which improves the visual quality of the final display.
[0044] 6) This invention can optimize the use of hardware resources. Performance improvements often come with more efficient use of hardware resources, enabling CAD or BIM software to achieve stronger rendering capabilities under the same hardware environment. This helps reduce hardware requirements and allows the software to run smoothly even on mid-range and low-end devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flowchart of the efficient three-dimensional modeling dynamic rendering method described in an embodiment of the present invention.
[0046] Figure 2 This is a schematic diagram of the interaction relationship among the B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer according to an embodiment of the present invention.
[0047] Figure 3 Schematic diagram of content rendered in the B3 frame buffer and the B2 frame buffer according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to facilitate those skilled in the art to better understand the present invention, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments. The following is only exemplary and does not limit the scope of protection of the present invention.
[0049] The present invention discloses an efficient three-dimensional modeling dynamic rendering method, comprising the following steps:
[0050] S1. Classify the graphic elements to be rendered into at least model elements, decorative elements, dynamic temporary elements, and highlight effects of model elements;
[0051] S2. Define four buffers, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer. Among them, B1 frame buffer is responsible for graphics output presentation, B2 frame buffer is used to handle dynamic refresh of the view, B3 frame buffer is used to store intermediate rendering results, and B4 frame buffer is used to save the latest state of the model scene;
[0052] S3, rendering and storing the model element through the B3 frame buffer, and backing it up to the B4 frame buffer; then determining whether the model element has the selected highlight effect: if so, executing the next step; otherwise, executing step S5;
[0053] S4. Rendering and storing the highlight effect of the model element through the B3 frame buffer, and backing it up to the B4 frame buffer;
[0054] S5. Render the dynamic temporary element or decorative element. During rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as a background and perform dynamic rendering based on this background. After the dynamic temporary element or decorative element is rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0055] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings. These are merely exemplary embodiments of the present invention. However, it should be understood that the present invention can be implemented in various forms and is not limited to the embodiments described herein. These embodiments are intended to enable those skilled in the art to understand the present invention more clearly and thoroughly.
[0056] This embodiment takes the development of a certain 3D BIM modeling software as an example. The development language is C / C++, the graphics API (Application Programming Interface) uses D3D11, and the development environment is Visual Studio 2022.
[0057] like Figure 1 As shown, the efficient three-dimensional modeling dynamic rendering method described in this embodiment includes the following steps:
[0058] S1. Classify the graphic elements to be rendered, including at least model elements, decorative elements, dynamic temporary elements, and highlight effects of model elements.
[0059] In this embodiment, the graphic elements to be rendered are divided into four categories: model elements, decorative elements, dynamic temporary elements, and highlight effects for model elements. Specifically, the first category is model elements, which include at least line strings, polygons, curves and surfaces, solids, and meshes. Model elements are usually stored in model files and support operations such as mouse selection, dragging, and editing. The second category is decorative elements, which include at least coordinate axes, coordinate grids, precision drawing compasses, custom-drawn mouse or icon styles, and explanatory text boxes and text. The third category is dynamic temporary elements, which refer to the intermediate modeling results presented during the modeling process. The fourth category is highlight effects for model elements, which refer to the highlight rendering effect after the model element is selected.
[0060] Different graphic element categories refresh at different frequencies and speeds. For example, model elements refresh less frequently, only when absolutely necessary, and render more slowly. Decorative elements and dynamic temporary elements, on the other hand, refresh more frequently but render more quickly. The advantage of categorizing the graphic elements to be rendered is that if only a particular category needs to be refreshed, only the graphic elements in that category are considered, narrowing the rendering scope and improving rendering efficiency.
[0061] S2. Define four buffers, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer.
[0062] The prior art generally uses double buffering technology, that is, two buffers, the front buffer is responsible for graphics output presentation, and the back buffer is responsible for storing intermediate calculation results. This embodiment adds two additional buffers on the basis of the double buffer. Figure 2 As shown, the specific functions of each buffer are as follows:
[0063] B1 frame buffer: As a visual buffer, it is responsible for the output presentation of graphics.
[0064] B2 frame buffer: As an off-screen buffer, it is used to handle dynamic refresh of the view.
[0065] B3 frame buffer: As a drawable off-screen buffer, used to store intermediate rendering results.
[0066] B4 frame buffer: As a non-drawable off-screen buffer, it is used to save the latest state of the model scene, that is, to back up the latest state of the B3 frame buffer.
[0067] Specifically, the relationship between the various frame buffers is as follows:
[0068] The B3 frame buffer and the B4 frame buffer are configured as a bidirectional connection relationship, so that the content of the B3 frame buffer can be backed up to the B4 frame buffer, and the content of the B4 frame buffer can be restored to the B3 frame buffer.
[0069] The B3 frame buffer and the B1 frame buffer are configured as a unidirectional connection relationship, so that the content of the B3 frame buffer can be copied to the B1 frame buffer.
[0070] The B1 frame buffer and the B2 frame buffer are configured to be in an exchange relationship with each other. After each frame is rendered in the B2 frame buffer, the B1 frame buffer and the B2 frame buffer are exchanged.
[0071] S3. Render and store the model element through the B3 frame buffer and back it up to the B4 frame buffer; then determine whether the model element has the selected highlight effect: if so, execute the next step, that is, step S4; otherwise, execute step S5.
[0072] The B3 frame buffer is an off-screen buffer used to store intermediate rendering results. All graphics elements are rendered directly in the B3 frame buffer, including the rendering of model elements. Figure 3 shown.
[0073] In step S1, the graphic elements to be rendered are classified. Since model elements consume the most rendering resources, the rendering frequency needs to be reduced. All model elements need to be re-rendered in the B3 frame buffer only when at least one of the following conditions exists:
[0074] (1) There are changes in some elements of the model;
[0075] (2) The camera parameters of the view change;
[0076] (3) The user reloads the entire model file or refreshes the entire view by calling a command.
[0077] When a model element is re-rendered in the B3 frame buffer, the rendering result is immediately synchronized and backed up to the B4 frame buffer, ensuring that the B4 frame buffer always stores the latest rendering result. Since model element rendering is time-consuming, its rendering frequency has been reduced, so it is necessary to back up the rendering results of model elements. If the model rendering results are needed later, they can be directly restored from the B4 frame buffer to the B3 frame buffer without the need for repeated rendering, thus avoiding long waiting times during modeling and greatly improving rendering efficiency.
[0078] S4. When there is a selected highlight effect in the model element, the highlight effect of the model element is rendered and stored through the B3 frame buffer and backed up to the B4 frame buffer.
[0079] The principle behind the highlighting effect for model elements (i.e., the selected highlighting effect on a model element) is to overlay a graphic element with the same shape as the model element itself, but with a special display style to create the highlighting effect. Therefore, the highlighting effect for model elements is also rendered in the B3 frame buffer. To address the highlighting effect for model elements, this embodiment uses a dirty area extraction method to improve rendering efficiency. This dirty area extraction method only updates a specific area of the frame buffer, rather than the entire area. Because the selected highlighting effect for model elements is typically applied to only a few elements, there's no need to refresh the entire area. This method can improve rendering efficiency.
[0080] Specifically, first calculate the coverage range of the highlight effect of the model element, and set the range as the dirty area, and then only render the dirty area, including rendering the model elements in the dirty area and rendering the highlight effect of the model elements. After rendering the model elements in the dirty area, the rendering results of the dirty area are immediately synchronized and backed up to the same range area in the B4 frame buffer. Since the highlight effect of the model element is also part of the model element, similarly, after rendering the highlight effect of the model element in the dirty area, it is also necessary to immediately synchronize and back up the rendering results of the dirty area to the same range area in the B4 frame buffer. The process of backing up to the B4 frame buffer only needs to synchronize the dirty area range, because only the content of this area is updated. In addition, as for how to search for model elements within the dirty area range, there are many existing methods that can be used, which will not be elaborated here.
[0081] In addition, the process for canceling the highlight effect of a model element is similar to that for selecting the highlight effect of a model element. Specifically, when canceling the highlight effect of a model element, the dirty area range of the model element to be canceled is calculated first, and then the model element within this dirty area is rendered in the B3 frame buffer. Note that only the model element is rendered here, and the highlight effect is not rendered. After rendering is complete, the dirty area range of the B3 frame buffer is also backed up to the same area in the B4 frame buffer.
[0082] S5. Render the dynamic temporary element or decorative element. During rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as a background and perform dynamic rendering based on this background. After the dynamic temporary element or decorative element is rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0083] When a user draws lines, adjusts vertices, or previews deformation results in real time in 3D modeling software, the intermediate modeling results presented in the view are dynamically rendered. Step S5 mainly introduces how this dynamic rendering method is implemented.
[0084] Dynamic temporary elements and decorative elements belong to the category of elements that change frequently, especially dynamic temporary elements, which are used to store intermediate results of modeling, so the refresh frequency is very high. Due to the frequent changes, they are replaced by directly copying from the B4 frame buffer. Specifically, in step S5, when rendering dynamic temporary elements or decorative elements, the content stored in the B4 frame buffer is restored to the B3 frame buffer. Based on the current B3 frame buffer state, the existing B3 frame buffer result is not erased, and rendering is continued using it as the background. This process avoids the waste of rendering resources caused by repeatedly rendering all model elements, and greatly improves rendering efficiency while achieving the same effect. After the rendering of the dynamic temporary elements or decorative elements is completed, the calculation results of the B3 frame buffer are copied to the B1 frame buffer to present the final rendering results, and there is no need to back up the rendering results to the B4 frame buffer.
[0085] Panning or rotating the view is a common function in 3D modeling software. Dynamic refresh during these operations is also considered part of dynamic rendering. However, unlike dynamic rendering in 3D modeling, dynamic view refresh requires re-rendering all model elements, while dynamic rendering in 3D modeling does not.
[0086] As a preferred solution, after step S2, this embodiment further includes a step of dynamically refreshing the view using the B2 frame buffer, which is referred to as S2'. Step S2' specifically includes the following:
[0087] The view is dynamically refreshed and rendered to the B2 frame buffer. After each frame is rendered, the B2 frame buffer swaps with the B1 frame buffer, presenting the refreshed result in the view. This means that the B1 frame buffer is released and becomes the B2 frame buffer for the next frame. Dynamic view refresh is also an intermediate result presented to improve software interactivity. It does not need to be backed up to the B4 frame buffer, and therefore does not need to be rendered in the B3 frame buffer. Instead, it is rendered directly to the B2 frame buffer and displayed directly using the swap method between the B2 and B1 frame buffers.
[0088] Because dynamic view refreshes require re-rendering of all model elements, their performance impact is important to consider. This embodiment employs the following approach: During the re-rendering process, a maximum timeout is set, starting from the current time, to control the speed of single-frame rendering. If a single-frame rendering exceeds the preset maximum timeout, rendering of that frame is halted. Because dynamic refreshes are intermediate results and do not require backup, even if rendering is incomplete, it has little impact and can actually improve overall refresh speed.
[0089] Taking the final implementation effect of a certain 3D BIM modeling software mentioned in this embodiment as an example, it is assumed that the software opens and loads a completed large-scale 3D BIM model, which is a large-scale infrastructure model containing hundreds of thousands to millions of model elements.
[0090] Designers can continue to create new model elements or modify existing model elements based on this three-dimensional model. During the process of real-time drawing, adjusting vertices or previewing deformation results, the view enters the rendering state of dynamic temporary elements. According to traditional methods, during the rendering process of dynamic temporary elements, it is necessary to continuously re-render hundreds of thousands to millions of model elements of the entire model, or narrow the rendering range to the range covered by the dynamic temporary elements to improve performance. However, the latter will still re-render a large number of model elements within the range of dynamic temporary elements. The method adopted in this embodiment is: back up the latest state of the B3 frame buffer to the B4 frame buffer, and then continuously restore the B4 frame buffer to the B3 frame buffer during the rendering process of dynamic temporary elements. This method directly uses the backed-up frame buffer results to avoid unnecessary repeated rendering, which has obvious performance improvements compared to traditional methods.
[0091] If the view is translated or rotated, the view will enter a dynamic refresh state. For a large-scale three-dimensional BIM model containing hundreds of thousands to millions of model elements, a lot of calculations are required to complete a refresh, and the frame rate is usually very low, so the dynamic refresh process will be accompanied by a very strong sense of jitter. For example, if it takes 100 milliseconds to complete the calculation of one frame, then the frame rate is only 10 frames per second, and this frame rate cannot guarantee smoothness during real-time refresh. In this embodiment, the method of setting the maximum timeout time is used to control the maximum time for each frame refresh, and the maximum timeout time is set to 30 milliseconds. If the calculation of a frame has not been completed within 30 milliseconds, it will stop immediately. The setting of the maximum timeout time ensures that the frame rate is stably maintained at more than 30 frames per second to maintain the smoothness of the dynamic refresh of the view.
[0092] The above only describes the basic principles and preferred embodiments of the present invention. Those skilled in the art may make many changes and improvements based on the above description, and these changes and improvements should fall within the scope of protection of the present invention.
Claims
1. An efficient three-dimensional modeling dynamic rendering method, characterized in that: The steps include: S1. Classify the graphic elements to be rendered into at least model elements, decorative elements, dynamic temporary elements, and highlight effects of model elements; S2. Define four buffers, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer. Among them, B1 frame buffer is responsible for graphics output presentation, B2 frame buffer is used to handle dynamic refresh of the view, B3 frame buffer is used to store intermediate rendering results, and B4 frame buffer is used to save the latest state of the model scene; The B2 frame buffer is used to achieve dynamic view refresh, including the following: The view is dynamically refreshed and rendered to the B2 frame buffer. During the process of re-rendering all model elements, a maximum timeout is set to control the speed of single-frame rendering. If the single-frame rendering time exceeds the preset maximum timeout, the rendering of this frame is stopped. After each frame is rendered, the B2 frame buffer and the B1 frame buffer are swapped and the refreshed result is presented in the view. S3, rendering and storing the model element through the B3 frame buffer, and backing it up to the B4 frame buffer; then determining whether the model element has the selected highlight effect: if so, executing the next step; otherwise, executing step S5; S4. Rendering and storing the highlight effect of the model element through the B3 frame buffer, and backing it up to the B4 frame buffer; S5. Render the dynamic temporary element or decorative element. During rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as a background and perform dynamic rendering based on this background. After the dynamic temporary element or decorative element is rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
2. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S1: Model elements include at least line strings, polygons, curves and surfaces, entities, and meshes; Decorative elements include at least coordinate axes, coordinate grids, AccuDraw compasses, custom-drawn mouse or icon styles, and explanatory text boxes and text; Dynamic temporary elements refer to the intermediate modeling results presented during the modeling process; The highlight effect of model elements refers to the highlight rendering effect after the model elements are selected.
3. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S2: The B3 frame buffer and the B4 frame buffer are configured as a bidirectional connection relationship, so that the content of the B3 frame buffer is backed up to the B4 frame buffer and the content of the B4 frame buffer is restored to the B3 frame buffer; The B3 frame buffer and the B1 frame buffer are configured as a unidirectional connection relationship, so that the content of the B3 frame buffer is copied to the B1 frame buffer; The B1 frame buffer and the B2 frame buffer are configured to be in an exchange relationship with each other. After each frame is rendered in the B2 frame buffer, the B1 frame buffer and the B2 frame buffer are exchanged.
4. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S3, all model elements need to be re-rendered in the B3 frame buffer only when at least one of the following conditions exists: (1) There are changes in some elements of the model; (2) The camera parameters of the view change; (3) The user reloads the entire model file or refreshes the entire view by calling a command.
5. The efficient three-dimensional modeling dynamic rendering method according to claim 4, characterized in that: In step S3, after the model element is re-rendered in the B3 frame buffer, the rendering result is immediately and synchronously backed up to the B4 frame buffer so that the B4 frame buffer always stores the latest rendering result.
6. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S4, the coverage range of the highlight effect of the model element is calculated, and the range is set as the dirty area. Then, only the dirty area is rendered, including rendering the model element in the dirty area and rendering the highlight effect of the model element.
7. The efficient three-dimensional modeling dynamic rendering method according to claim 6, characterized in that: After the model elements in the dirty area and the highlight effects of the model elements are rendered, the rendering results of the dirty area are immediately and synchronously backed up to the same range area in the B4 frame buffer.
8. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S5, when rendering dynamic temporary elements or decorative elements, the content stored in the B4 frame buffer is restored to the B3 frame buffer. Based on the current B3 frame buffer state, the existing B3 frame buffer result is not erased and is used as the background for continued rendering.
9. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S5, the dynamic temporary elements and the decorative elements are directly rendered. After the rendering is completed, there is no need to back up the rendering results to the B4 frame buffer.
Citation Information
Patent Citations
Application program management method, device and equipment and computer storage medium
CN111596916A
Rendering method and apparatus
US20210358192A1