Efficient three-dimensional modeling dynamic rendering method
By using four buffers in three-dimensional modeling dynamic rendering, the problem of low rendering performance of complex models in the existing technology is solved, efficient dynamic rendering is achieved, and the rendering speed and the operation experience of designers is significantly improved.
Patent Information
- Application Number
- CN202510543884.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-28
AI Technical Summary
The existing three-dimensional modeling dynamic rendering technology has low performance when processing complex models, resulting in lag and delay in picture, and high resource consumption, making it difficult to meet the real-time rendering needs.
The technical solution of four buffers is adopted, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer. The model elements are rendered and stored through the B3 frame buffer and backed up to the B4 frame buffer. When rendering dynamic temporary elements or decorative elements, the content of the B4 frame buffer is restored to the B3 frame buffer as the background for rendering.
It significantly improves the speed of dynamic rendering of three-dimensional modeling, reduces development delays and debugging work caused by rendering bottlenecks, shortens product development cycles, reduces costs, and improves designers' operation experience and work efficiency.
Smart Images

Figure CN120070777A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of 3D software, and particularly to an efficient 3D modeling dynamic rendering method. Background Art
[0002] During the process of engineering designers using CAD software for drawing or BIM software for 3D modeling, the dynamic creation of models is one of the important interactive functions provided by the software. For example, when users are drawing lines in real time, adjusting vertices or previewing deformation results in a modeling software, the dynamic rendering can present the intermediate modeling results in real time following the movement of the mouse in the view. Therefore, dynamic rendering is very important in enhancing the interactive experience with users. At the same time, dynamic rendering also needs to be refreshed quickly to ensure the smoothness of the interaction.
[0003] During the graphics display process, the computer fetches data from the display buffer unit and then presents it on the display. It takes a lot of time to calculate each frame, especially for complex scenes which require a large amount of graphics calculations. Usually, the refresh rate of the display is higher than the rendering speed of each frame of graphics. Therefore, it is necessary to access the display buffer unit multiple times to present a complete frame. As a result, the graphics effect presented on the display is torn or flickering. This is the problem that the single-buffer method will encounter during the rendering process.
[0004] To solve the above problems, the most commonly used solution at present is the double-buffer technology, including a front buffer and a back buffer. The front buffer is still responsible for the final graphics output, but all rendering instructions are drawn on the back buffer. After the rendering is completed, the front and back buffers are swapped, and a complete frame will be presented immediately. The double-buffer technology solves the problem of graphics tearing.
[0005] However, only using the double-buffer, the dynamic rendering in the 3D modeling process still faces great performance problems, especially for the dynamic rendering based on complex models. Currently, the common implementation methods and some optimization measures include: 1) During the dynamic rendering process, each frame refresh requires refreshing the entire model scene, that is, all graphic elements in the scene must be redrawn. All calculation results are stored in the back buffer, and after the rendering is completed, the front and back buffers are swapped and displayed. This method has little impact when dealing with the rendering of simple models, but when dealing with complex models that require long-time calculations, performance problems will emerge.
[0006] 2) Method for simplifying geometric figures. Elements for dynamic rendering are usually temporary elements and not part of the model. Their function is to store intermediate results of modeling. Therefore, simplified geometric figures can be used to represent elements for dynamic rendering on the premise of ensuring visual feedback (for example, using lines or point clouds instead of complex meshes). Using low-precision geometric bodies can reduce the number of vertices and the calculation of triangular patches, making it faster for the GPU (Graphics Processing Unit) to process. Additionally, temporary elements may not require complex shading. Disabling lighting, shadows, and textures can save computing resources. This method can indeed improve the rendering efficiency of dynamic temporary elements themselves.
[0007] 3) Method for incremental update. Calculate the rectangular dirty area range of elements for dynamic rendering through a certain algorithm, and only update the dirty area part instead of a full-frame refresh. The specific execution steps in the back buffer are to first calculate the range of the dirty area, and then redraw the dirty area part while keeping the rest unchanged.
[0008] The several optimization methods mentioned above do improve the efficiency of 3D modeling dynamic rendering in a certain aspect. However, there are still some bottlenecks in only using existing technologies, which limit the further improvement of their performance. The main disadvantages are as follows: 1) The rendering efficiency is still relatively low. Especially when dealing with complex scenes, existing technologies often struggle to meet the requirements of real-time rendering, resulting in problems such as frame drops and delays; 2) The resource consumption is large. Existing technologies require a large amount of computing resources and storage space, restricting their application on resource-constrained platforms such as mobile devices. Summary of the Invention
[0009] In order to overcome the above technical deficiencies, the present invention provides an efficient method for 3D modeling dynamic rendering.
[0010] The technical solution adopted by the present invention to overcome its technical problems is: An efficient method for 3D modeling dynamic rendering, comprising the following steps: S1. Classify the graphic elements to be rendered, including at least model elements, decorative elements, dynamic temporary elements, and highlight effects of model elements; S2. Define four buffer areas, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer. Among them, the B1 frame buffer is responsible for the output presentation of graphics, the B2 frame buffer is used to process the dynamic refresh of the view, the B3 frame buffer is used to store intermediate results of rendering, and the B4 frame buffer is used to save the latest state of the model scene; S3. Render and store the model elements through the B3 frame buffer and back them up to the B4 frame buffer; then determine whether there is a selected highlight effect in the model elements: if so, execute the next step, otherwise, execute step S5; S4. Render and store the highlighting effect of the model elements through the B3 frame buffer, and back up the result to the B4 frame buffer; S5. Render the dynamic temporary elements or decorative elements. When rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as the background and perform dynamic rendering on this background. After the dynamic temporary elements or decorative elements are rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0011] Further, in step S1: The model elements at least include wire strings, polygons, curve surfaces, solids, and meshes; The decorative elements at least include coordinate axes, coordinate grids, precise drawing compasses, custom-drawn mouse or icon styles, illustrative text boxes, and text; The dynamic temporary elements refer to the intermediate modeling results presented during the modeling process; The highlighting effect of the model elements refers to the highlighted rendering effect after the model elements are selected.
[0012] Further, in step S2: The B3 frame buffer and the B4 frame buffer are configured in a two-way connection relationship, enabling the content of the B3 frame buffer to be backed up to the B4 frame buffer and the content of the B4 frame buffer to be restored to the B3 frame buffer; The B3 frame buffer and the B1 frame buffer are configured in a one-way connection relationship, enabling the content of the B3 frame buffer to be copied to the B1 frame buffer; The B1 frame buffer and the B2 frame buffer are configured to exchange with each other. After each frame is rendered in the B2 frame buffer, the B1 frame buffer and the B2 frame buffer exchange positions.
[0013] Further, in step S3, when at least any one of the following situations exists, it is necessary to re-render all the model elements in the B3 frame buffer: (1) There are changes in the model elements; (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.
[0014] Further, in step S3, after the model elements are re-rendered in the B3 frame buffer, immediately synchronize and back up the rendering result to the B4 frame buffer so that the content stored in the B4 frame buffer is always the latest rendering result.
[0015] Further, in step S4, for the highlighting effect of the model elements, calculate its coverage area, set this area as the dirty area, and then only render this dirty area, including rendering the model elements in this dirty area and rendering the highlighting effect of the model elements.
[0016] Further, after rendering the model elements and the highlighting effect of the model elements in the dirty area, immediately synchronously back up the rendering result of the dirty area to the same area range in the B4 frame buffer.
[0017] Further, in step S5, when rendering dynamic temporary elements or decorative elements, restore the content stored in the B4 frame buffer to the B3 frame buffer. Based on the current B3 frame buffer state, do not erase the existing B3 frame buffer result, and continue rendering with this as the background.
[0018] Further, in step S5, directly render the dynamic temporary elements and decorative elements. After rendering is completed, there is no need to back up the rendering result to the B4 frame buffer.
[0019] Further, after step S2, there is also a step of realizing dynamic view refresh through the B2 frame buffer. The specific steps of realizing dynamic view refresh through the B2 frame buffer are as follows: The dynamic view refresh is rendered to the B2 frame buffer. During the process of re-rendering all model elements, set a maximum timeout to control the speed of single-frame rendering. If the time used for single-frame rendering exceeds the preset maximum timeout, stop the rendering of this frame. After each frame is rendered, exchange the positions of the B2 frame buffer and the B1 frame buffer, and present the refresh result in the view.
[0020] The beneficial effects of the present invention are: 1) The present invention can support the graphic underlying research and development of 3D CAD software or BIM software, and can significantly improve the speed of dynamic rendering of 3D modeling. The optimized rendering performance can reduce the development delay and unnecessary debugging work caused by rendering bottlenecks, thereby shortening the product development cycle and reducing costs.
[0021] 2) The present invention can improve the operation experience of designers. The enhanced rendering performance can significantly increase the frame rate of real-time rendering, making the graphics seen by designers during 3D modeling more smooth and clear, reducing latency and stuttering, and thus providing a more smooth interaction experience.
[0022] 3) The present invention can improve the work efficiency of designers. Especially when frequently adjusting and modifying the model, the improvement of dynamic rendering performance enables designers to avoid excessive waiting time during modeling, thereby greatly improving work efficiency.
[0023] 4) The present invention enables better support for large-scale software models. When the dynamic rendering performance is improved, designers can model based on complex 3D models or large-scale scenes while ensuring a good interaction experience, which is particularly important for the architecture and engineering industries as the models in these fields often contain a large amount of details and complex geometries.
[0024] 5) The present invention enables the software to support higher-quality rendering effects. With the improvement of dynamic rendering performance, the basic model can support more advanced rendering effects without affecting the smoothness of dynamic rendering during modeling, such as finer lighting effects, reflections, refractions, etc., which can improve the visual quality of the final display.
[0025] 6) The present invention can optimize the use of hardware resources. Performance improvement is usually accompanied by more efficient utilization of hardware resources, enabling CAD software or BIM software to achieve stronger rendering capabilities in the same hardware environment, helping to reduce hardware requirements and enabling the software to run smoothly on mid-range and low-end devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a flowchart of an efficient 3D modeling dynamic rendering method according to an embodiment of the present invention.
[0027] Figure 2 It is a schematic diagram of the interaction relationship of the B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer according to an embodiment of the present invention.
[0028] Figure 3 It is a schematic diagram of the content rendered in the B3 frame buffer and B2 frame buffer according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] To facilitate better understanding of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The following is merely exemplary and does not limit the protection scope of the present invention.
[0030] The present invention discloses an efficient 3D modeling dynamic rendering method, including the following steps: S1. Classify the graphic elements to be rendered, including 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, the B1 frame buffer is responsible for the output presentation of graphics, the B2 frame buffer is used to process the dynamic refresh of the view, the B3 frame buffer is used to store the intermediate results of rendering, and the B4 frame buffer is used to save the latest state of the model scene; S3. Render and store the model elements through the B3 frame buffer, and back up to the B4 frame buffer; then determine whether there is a selected highlighting effect in the model elements: if so, proceed to the next step, otherwise, execute step S5; S4. Render and store the highlighting effect of the model elements through the B3 frame buffer, and back up to the B4 frame buffer; S5. Render the dynamic temporary elements or decorative elements. When rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as the background and perform dynamic rendering on this background. After the dynamic temporary elements or decorative elements are rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0031] To better understand the above technical solution, the exemplary embodiments of the present invention will be described in detail below with reference to the accompanying drawings. These are only the 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 here. These embodiments are to enable those skilled in the art to understand the present invention more clearly and thoroughly.
[0032] In this embodiment, taking 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.
[0033] As Figure 1 shown, an efficient 3D modeling dynamic rendering method described in this embodiment includes the following steps: S1. Classify the graphic elements to be rendered, including at least model elements, decorative elements, dynamic temporary elements, and highlighting effects of model elements.
[0034] In this embodiment, the graphic elements to be rendered are divided into four categories: model elements, decorative elements, dynamic temporary elements, and highlighting effects of model elements. Specifically, the first category is model elements, including at least line strings, polygons, curve 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, including at least coordinate axes, coordinate grids, precise drawing compasses, custom-drawn mouse or icon styles, explanatory text boxes and texts; the third category is dynamic temporary elements, referring to the intermediate modeling results presented during the modeling process; the fourth category is the highlighting effects of model elements, referring to the highlighted rendering effects after the model elements are selected.
[0035] The frequencies and speeds of refreshing for different graphic element classifications vary. For example, the model elements have a lower refreshing frequency and are only refreshed when necessary, and the rendering speed of the model elements is slower; while the decorative elements and dynamic temporary elements have a very high refreshing frequency but a faster rendering speed. The advantage of classifying the graphic elements to be rendered is that if only one of the classifications needs to be refreshed, only the graphic elements of that classification need to be considered, narrowing the rendering scope and thus improving the rendering efficiency.
[0036] S2. Define four buffers, namely B1 frame buffer, B2 frame buffer, B3 frame buffer, and B4 frame buffer.
[0037] In the prior art, generally the double-buffer technology is used, that is, two buffers in the front and back. The front buffer is responsible for graphic output presentation, and the back buffer is responsible for storing the intermediate results of calculations. In this embodiment, on the basis of the double buffer, two additional buffers are added, as Figure 2 shown, and the specific functions of each buffer are as follows: B1 frame buffer: As a visible buffer, it is responsible for graphic output presentation.
[0038] B2 frame buffer: As an off-screen buffer, it is used to process the dynamic refresh of the view.
[0039] B3 frame buffer: As a drawable off-screen buffer, it is used to store the intermediate results of rendering.
[0040] 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.
[0041] Specifically, the relationships between the respective frame buffers are as follows: The B3 frame buffer and the B4 frame buffer are configured in 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.
[0042] The B3 frame buffer and the B1 frame buffer are configured in a unidirectional connection relationship, so that the content of the B3 frame buffer can be copied to the B1 frame buffer.
[0043] The B1 frame buffer and the B2 frame buffer are configured 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 exchange positions.
[0044] S3. Render and store the model elements through the B3 frame buffer and back them up to the B4 frame buffer; then determine whether there is a selected highlight effect in the model elements: if so, execute the next step, that is, step S4, otherwise, execute step S5.
[0045] The B3 frame buffer is an off-screen buffer used to store the intermediate results of rendering. All graphical elements are directly rendered in the B3 frame buffer, including the rendering of model elements, as shown below. Figure 3 as shown
[0046] In step S1, the graphical elements to be rendered are classified. Since model elements are the classification that consumes the most rendering resources, it is necessary to reduce the frequency of rendering. Only when at least any one of the following situations occurs, all model elements need to be re-rendered in the B3 frame buffer: (1) An element in the model elements has changed; (2) The camera parameters of the view have changed; (3) The user reloads the entire model file or refreshes the entire view by calling a command.
[0047] After the model elements are re-rendered in the B3 frame buffer, the rendering result is immediately synchronized and backed up to the B4 frame buffer so that the B4 frame buffer always stores the latest rendering result. Since the rendering of model elements is time-consuming and its rendering frequency has been reduced, it is necessary to back up the rendering result of model elements. If the rendering result of the model is needed later, it can be directly restored from the B4 frame buffer to the B3 frame buffer without repeated rendering, thus avoiding the situation of excessive waiting time during modeling and greatly improving the rendering efficiency.
[0048] S4. When there is a selected highlighting effect in the model elements, the highlighting effect of the model elements is rendered and stored through the B3 frame buffer and backed up to the B4 frame buffer.
[0049] The principle of the highlighting effect of model elements (that is, there is a selected highlighting effect in the model elements) is that a graphical element with the same shape as the model element itself is overlaid on the upper layer of the model element, but a special display style is set to present the highlighting effect. Therefore, the rendering of the highlighting effect of model elements is also carried out in the B3 frame buffer. For the highlighting effect of model elements, this embodiment adopts the method of extracting the dirty area to improve the rendering efficiency. The method of extracting the dirty area only needs to update a certain area of the frame buffer instead of the whole area, because the highlighting effect of the selected model elements mostly occurs on only a few elements, so there is no need to refresh the whole range, and thus this method can improve the rendering efficiency.
[0050] Specifically, first calculate the coverage range of the highlighting effect of the model elements and set this range as the dirty area, and then only render this dirty area, including rendering the model elements in the dirty area and rendering the highlighting effect of the model elements. After rendering the model elements in the dirty area, immediately synchronously back up the rendering result of the dirty area to the same range area in the B4 frame buffer. Since the highlighting effect of the model elements is also part of the model elements, similarly, after rendering the highlighting effect of the model elements in the dirty area, it is also necessary to immediately synchronously back up the rendering result 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 has been updated. Additionally, as for how to search for the model elements within the dirty area range, there are many existing methods that can be used and will not be elaborated here.
[0051] In addition, the processing flow for canceling the highlighting effect of the model elements is similar to that of selecting the highlighting effect of the model elements. Specifically, when canceling the highlighting effect of the model elements, first calculate the dirty area range of the highlighting effect of the model elements to be canceled, and then render the model elements within this dirty area range in the B3 frame buffer. Note that only the model elements are rendered here, and the highlighting effect of the elements is no longer rendered. After rendering is completed, similarly back up the dirty area range of the B3 frame buffer to the same area in the B4 frame buffer.
[0052] S5. Render the dynamic temporary elements or decorative elements. When rendering, restore the content stored in the B4 frame buffer to the B3 frame buffer as the background and perform dynamic rendering on this background. After the dynamic temporary elements or decorative elements are rendered, copy the calculation result of the B3 frame buffer to the B1 frame buffer to present the final rendering result.
[0053] When the user is drawing lines, adjusting vertices, or previewing the deformation result in real time in the 3D modeling software, the intermediate modeling result presented in the view is dynamically rendered. Step S5 mainly introduces how this dynamic rendering method is implemented.
[0054] Dynamic temporary elements and decorative elements belong to the category of elements that change frequently. Especially for dynamic temporary elements, which are used to store intermediate results of modeling, they are refreshed very frequently. Due to the frequent changes, a method of directly copying from the B4 frame buffer is adopted instead. 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 state of the B3 frame buffer, the existing results in the B3 frame buffer are not erased, and rendering continues with this as the background. This process avoids the waste of rendering resources caused by repeatedly rendering all model elements and greatly improves the rendering efficiency while achieving the same effect. After the rendering of 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 result, without the need to back up the rendering result to the B4 frame buffer.
[0055] In 3D modeling software, panning or rotating the view is a common function for viewing models. The dynamic refresh during the operation of panning or rotating the view also belongs to part of dynamic rendering. However, different from 3D modeling dynamic rendering, the dynamic refresh of the view requires re-rendering all model elements, while 3D modeling dynamic rendering does not.
[0056] As a preferred solution, after step S2 of this embodiment, there is also a step of implementing dynamic view refresh through the B2 frame buffer, which is set as step S2'. Step S2' specifically includes the following: The dynamic view refresh is rendered to the B2 frame buffer. After each frame is rendered, the B2 frame buffer and the B1 frame buffer are swapped in position, and the refresh result is presented in the view. That is, the B1 frame buffer is released and becomes the B2 frame buffer for the next frame of rendering. The dynamic view refresh is also an intermediate result presented to improve the software interactivity and does not need to be backed up to the B4 frame buffer. Therefore, it is not rendered in the B3 frame buffer but directly rendered to the B2 frame buffer, and the method of swapping the B2 frame buffer and the B1 frame buffer is used to directly output and display.
[0057] Since the dynamic view refresh requires re-rendering all model elements, attention needs to be paid to its performance impact. In this embodiment, the following method is adopted: During the process of re-rendering all model elements, starting from the current time, a maximum timeout is set to control the speed of single-frame rendering. If the time taken for single-frame rendering exceeds the preset maximum timeout, the rendering of this frame is stopped. Because the dynamic refresh is an intermediate result and does not need to be backed up, even if the rendering is not completed, it will not have too much impact. On the contrary, it can improve the overall refresh speed.
[0058] Taking the final implementation effect of a certain 3D BIM modeling software mentioned in this embodiment as an example, assume that the software opens and loads a large-scale 3D BIM model that has been completed in modeling. This model belongs to a large infrastructure model and contains hundreds of thousands to millions of model elements.
[0059] Designers can continue to create new model elements or modify existing model elements based on this 3D 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 the traditional method, 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 area 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 the 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 the dynamic temporary elements. This method directly uses the backed-up frame buffer results to avoid unnecessary repeated rendering, and has obvious performance improvement compared with the traditional method.
[0060] If a panning or rotation operation is performed on the view, the view will enter the dynamic refresh state. For a large-scale 3D BIM model containing hundreds of thousands to millions of model elements, a large amount of calculation is required to complete one refresh, and the frame rate is usually very low. Therefore, there will be a very strong sense of jitter during the dynamic refresh process. 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 ensure the smoothness during the real-time refresh process. In this embodiment, the method of setting the maximum timeout is used to control the maximum time for each frame refresh. The maximum timeout is set to 30 milliseconds. If the calculation of one frame has not been completed within 30 milliseconds, then it will stop immediately. The setting of this maximum timeout ensures that the frame rate is stably maintained above 30 frames per second to maintain the smoothness of the view dynamic refresh.
[0061] Only the basic principles and preferred embodiments of the present invention are described above. Those skilled in the art can make many changes and improvements according to the above description, and these changes and improvements should fall within the protection scope 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, including 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, wherein B1 frame buffer is responsible for the output presentation of graphics, B2 frame buffer is used to process the dynamic refresh of the view, B3 frame buffer is used to store the intermediate results of rendering, and B4 frame buffer is used to save the latest state of the model scene; S3, rendering and storing the model elements through the B3 frame buffer, and backing up to the B4 frame buffer; then determining whether the model elements have the selected highlight effect: if yes, 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 elements or decorative elements. When 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 elements or decorative elements are rendered, copy the calculation results of the B3 frame buffer to the B1 frame buffer to present the final rendering results.
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, precision drawing 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 exchange positions.
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 situations exists: (1) Some of the model elements have changed; (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 latest rendering result is always stored in the B4 frame buffer.
6. The efficient three-dimensional modeling dynamic rendering method according to claim 1, characterized in that: In step S4, for the highlight effect of the model element, the coverage range is calculated, and the range is set as the dirty area, and then only the dirty area is rendered, including rendering the model elements in the dirty area and rendering the highlight effect of the model elements.
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 a dynamic temporary element or a decorative element, the content stored in the B4 frame buffer is restored to the B3 frame buffer, and 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.
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.
10. The efficient three-dimensional modeling dynamic rendering method according to any one of claims 1 to 9, characterized in that: After step S2, the method further includes a step of implementing dynamic view refresh through the B2 frame buffer, wherein the step of implementing dynamic view refresh through the B2 frame buffer specifically includes the following steps: 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 exchanged and the refresh result is presented in the view.
Citation Information
Patent Citations
Application program management method, device and equipment and computer storage medium
CN111596916A
Rendering method and apparatus
US20210358192A1
Binocular three-dimensional graphic rendering method and related system
WO2015196791A1
Cited By
Drawing method and device for highlight primitives and storage medium
CN120726166A
Method for optimizing loading and rendering of large BIM (Building Information Modeling) model
CN121258769A
A method for optimizing loading and rendering of a large volume BIM model
CN121258769B