Model rendering method and device

By calculating the rendering cost of BIM model components and optimizing the rendering order, the problems of slow speed and low refresh rate when rendering BIM models by the browser are solved, achieving a smoother model rendering effect.

CN112419469BActive Publication Date: 2025-02-25BEIJING DAOPOWER
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011310202.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-20
Publication Date
2025-02-25
Estimated Expiration
2040-11-20

AI Technical Summary

Technical Problem

When rendering BIM models with a browser, large or high load models with large size or high loads lead to slow rendering speed and reduced image refresh rate, which affects the user experience.

Method used

By obtaining the components of the model to be rendered, the rendering cost of each component is calculated, and the set of components that are preferred to be rendered based on the rendering cost is determined, reducing the rendering difficulty and improving the image refresh rate.

Benefits of technology

By optimizing the order and selection of rendering components, the time resources and computing resources required to render the model to be rendered are reduced, the image refresh rate is improved, and the user can see a smooth model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112419469B_ABST
    Figure CN112419469B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a model rendering method and device, which aims to reduce the difficulty of model rendering, thereby ensuring that users can see a smooth model. The method includes: calculating the rendering cost of each component to be rendered in at least one component to be rendered, the rendering cost represents the time resources and / or computing resources required to render the component to be rendered; obtaining a first time, the first time is the time required to render the model to be rendered; if the first time is greater than the time threshold, determining a first component from at least one component to be rendered, the rendering cost of the first component is lower than the component to be rendered with the highest rendering cost in at least one component to be rendered; determining a first component set from at least one component to be rendered, the first component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the first component set is not higher than that of the first component; rendering each component to be rendered in the first component set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a model rendering method and device. Background Art

[0002] Building Information Modeling (BIM) can display information such as the structure of a building in a visual way. Compared with traditional two-dimensional drawings, BIM can display the three-dimensional characteristics of the building structure, which is more intuitive. In addition, BIM can visualize the construction process, making it easier for managers and owners to grasp the construction process. In this way, during actual on-site construction, the use of BIM can make it easier for construction personnel to understand the construction process and construction nodes.

[0003] Traditional BIM display technology requires dedicated BIM software or engines to obtain BIM model data and render it. Since dedicated BIM software or engines start slowly, it is not convenient to quickly view the application scenarios of BIM models. To solve this problem, BIM models can be displayed through the web graphics library (webGL) of the browser.

[0004] However, for models with large volumes or heavy loads, the number of triangles is large, which causes the browser to render the BIM model slowly. Thus, when the user moves the BIM model, the image refresh rate is greatly reduced, which reduces the user experience. Summary of the invention

[0005] In view of this, an embodiment of the present application provides a model rendering method and device, aiming to reduce the difficulty of rendering the model, thereby ensuring that the user can see a smooth model.

[0006] In a first aspect, an embodiment of the present application provides a model rendering method, the method comprising:

[0007] Obtaining a model to be rendered, wherein the model to be rendered includes at least one component to be rendered;

[0008] Calculating a rendering cost of each component to be rendered in the at least one component to be rendered, where the rendering cost represents time resources and / or computing resources required to render the component to be rendered;

[0009] Acquire a first time, where the first time is the time required to render the model to be rendered;

[0010] If the first time is greater than a time threshold, determining a first component from the at least one component to be rendered, wherein a rendering cost of the first component is lower than a component to be rendered with the highest rendering cost among the at least one component to be rendered;

[0011] Determine a first component set from the at least one component to be rendered, the first component set including at least one component to be rendered, and a rendering cost of any component to be rendered in the first component set is not higher than that of the first component;

[0012] Render each component to be rendered in the first component set.

[0013] Optionally, calculating the rendering cost of each component to be rendered in the at least one component to be rendered includes:

[0014] The volume of each component to be rendered in the at least one component to be rendered is calculated, and the volume of the component to be rendered is determined as the rendering cost of the component to be rendered.

[0015] Optionally, calculating the rendering cost of each component to be rendered in the at least one component to be rendered includes:

[0016] The number of triangles of each component to be rendered in the at least one component to be rendered is calculated, and the number of triangles of the component to be rendered is determined as the rendering cost of the component to be rendered.

[0017] Optionally, determining the first component from the at least one component to be rendered includes:

[0018] sorting the at least one component to be rendered according to a rendering cost of each component to be rendered in the at least one component to be rendered;

[0019] A component to be rendered that is located in the middle of at least one sorted component to be rendered is determined as a first component.

[0020] Optionally, the method further comprises:

[0021] Recording a second time required for rendering all components to be rendered in the first component set;

[0022] If the second time is greater than the time threshold, determining a second component from the first component set, the rendering cost of the second component being lower than the component to be rendered with the highest rendering cost in the first component set;

[0023] Determine a second component set from the first component set, the second component set including at least one component to be rendered, and a rendering cost of any component to be rendered in the second component set is not higher than that of the second component;

[0024] Render each to-be-rendered component in the second component set.

[0025] Optionally, if the second time is less than a time threshold, the method further includes:

[0026] Determine a third component from the at least one component to be rendered, wherein the rendering cost of the third component is higher than that of the first component;

[0027] Determine a third component set from the at least one component to be rendered, the third component set including at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component;

[0028] Render each to-be-rendered component in the third component set.

[0029] In a second aspect, an embodiment of the present application provides a model rendering device, the device comprising:

[0030] An acquisition module is used to acquire a model to be rendered, wherein the model to be rendered includes at least one component to be rendered; a calculation module is used to calculate the rendering cost of each component to be rendered in the at least one component to be rendered, wherein the rendering cost represents the time resources and / or computing resources required to render the model to be rendered; a component selection module is used to acquire a first time, wherein the first time is the time required to render the model to be rendered; if the first time is greater than a time threshold, a first component is determined from the at least one component to be rendered, wherein the rendering cost of the first component is lower than the component to be rendered with the highest rendering cost in the at least one component to be rendered; a first component set is determined from the at least one component to be rendered, wherein the first component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the first component set is not higher than that of the first component; a rendering module is used to render each component to be rendered in the first component set.

[0031] Optionally, the calculation module is used to calculate the volume of each component to be rendered in the at least one component to be rendered, and determine the volume of the component to be rendered as the rendering cost of the component to be rendered.

[0032] Optionally, the calculation module is used to calculate the number of triangles of each component to be rendered in the at least one component to be rendered, and determine the number of triangles of the component to be rendered as the rendering cost of the component to be rendered.

[0033] Optionally, the component selection module is used to sort the at least one component to be rendered according to the rendering cost of each component to be rendered in the at least one component to be rendered; and determine the component to be rendered located in the middle of the sorted at least one component to be rendered as the first component.

[0034] Optionally, the component selection module is also used to record the second time required to render the entire set of components to be rendered in the first component; if the second time is greater than the time threshold, determine a second component from the first component set, and the rendering cost of the second component is lower than the component to be rendered with the highest rendering cost in the first component set; determine a second component set from the first component set, the second component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the second component set is not higher than that of the second component; the rendering module is also used to render each component to be rendered in the second component set.

[0035] Optionally, the option selection module is also used to determine a third component from the first component assembly if the second time is less than a time threshold, determine a third component from the at least one component to be rendered, and the rendering cost of the third component is higher than that of the first component; determine a third component set from the at least one component to be rendered, the third component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component; the rendering module is also used to render each component to be rendered in the third component set.

[0036] The embodiment of the present application provides a model rendering method and device. When rendering a model to be rendered, the model to be rendered can be first obtained, and the model to be rendered includes at least one component to be rendered. Then, the rendering cost of each component to be rendered in at least one component to be rendered that constitutes the model to be rendered can be calculated. The rendering cost represents the time resources and / computing resources required to render the component to be rendered. Then, the model to be rendered can be rendered, and the first time required to render the model to be rendered can be recorded. Then, the size of the first time and the time threshold can be compared. If the first time is greater than the time threshold, it means that the time required to render the component to be rendered is longer, which may cause the refresh rate of the image to be reduced. Therefore, a first component can be determined from at least one component to be rendered, and a first component set can be determined based on the first component. Among them, the rendering cost of the first component is lower than the rendering component with the highest rendering cost in the at least one component to be rendered, and the rendering cost of any one component to be rendered in the first component set is not higher than the first component. After determining the first component set, the first component set can be rendered and displayed. Since the rendering cost of any component to be rendered in the first component set being rendered is lower than the component to be rendered with the highest rendering cost in the model to be rendered, the time resources and computing resources required to render the first component set must be lower than the time resources and computing resources required to render the entire model to be rendered. Then, when the rendering cost of the model to be rendered is too high, part of the model to be rendered can be rendered, thereby reducing the time resources and computing resources required to render the model to be rendered. In this way, by optimizing the model to be rendered, the rendering difficulty of the model is reduced, the image refresh rate is increased, and it can be ensured that the user can see a smooth model. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0038] Figure 1 A method flow chart of a model rendering method provided in an embodiment of the present application;

[0039] Figure 2 A structural schematic diagram of a model rendering device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] Rendering refers to the process of projecting a 3D model according to the set environment, material and other parameters to obtain a digital image. It is an important step in the computer graphics process. The quality of the rendering result is directly related to the quality of the output image. Therefore, when some low-performance devices are rendering, the rendering will not be detailed enough due to insufficient device performance, the output image quality will deteriorate or the video frame rate will be low.

[0041] When a BIM model is displayed in a web browser, the BIM model data can be obtained, the three-dimensional data of the BIM model can be calculated, and the projection image of the BIM can be determined according to the user's perspective, and then the projection image can be displayed to the user.

[0042] At present, the speed of computer rendering models is mainly affected by the number of triangles in the model. As the number of triangles in the model increases, the computer needs more computing resources and time resources to project the three-dimensional model. In order to solve this problem, most of the current professional BIM software or engines have dedicated algorithms or programs to improve the rendering speed. However, the main purpose of web browsers is to browse web pages, and most of them do not have the function of fast rendering. In this way, when the user moves the BIM model, the computer needs to spend a lot of time to recalculate the projected image of the BIM, resulting in a significant reduction in the refresh rate of the image.

[0043] In order to provide a technical solution that can improve the speed of rendering models in ordinary web browsers, the present application provides a model rendering method and device. The preferred embodiments of the present application will be described below from the perspective of computer software. It should be noted that the technical solution of the present application is proposed by the inventor for the special application scenario of displaying BIM models in web browsers, and it does not mean that the technical solution of the present application can only be applied to this application scenario. For example, the model rendering method provided in the embodiment of the present application can also be applied to application scenarios such as mobile terminals that need to improve the rendering speed and image refresh rate.

[0044] See also Figure 1 , Figure 1 The method flow chart of the model rendering method provided in the embodiment of the present application includes:

[0045] S101: Obtain a model to be rendered.

[0046] After receiving an instruction to render a model to be rendered, the computer may obtain the model to be rendered, the rendering model including at least one component to be rendered. The component to be rendered is a part of the model to be rendered. For example, assuming that the model to be rendered is a house, the component to be rendered may be a component such as a beam, a column or a wall of the house. In an embodiment of the present application, the computer may obtain parameters of each component to be rendered in at least one component to be rendered included in the model to be rendered one by one.

[0047] In some possible implementations, the computer may further split the model to be rendered according to its structure, split the model to be rendered into at least one component to be rendered, and determine rendering parameters of each component to be rendered. The rendering parameters may include information such as the three-dimensional size, spatial position, and surface texture of the component to be rendered.

[0048] S102: Calculate the rendering cost of each component to be rendered in the at least one component to be rendered.

[0049] The computer can respectively calculate the rendering cost of each component to be rendered in at least one component to be rendered constituting the model to be rendered. The rendering cost of the component to be rendered represents the time resources and / or computing resources required by the computer to render the component to be rendered. Among them, the time resources can be the shortest duration or average duration required to render the component to be rendered, and the computing resources can be the memory occupancy rate or CPU occupancy rate required to render the component to be rendered. Optionally, the computer can predict the rendering cost of the component to be rendered through the model. The computer can input the rendering parameters of the component to be rendered into the model, and analyze the rendering parameters through the model to obtain the rendering cost of the component to be rendered.

[0050] Since components with larger volumes generally have more complex structures and more triangular faces, in the embodiment of the present application, in order to increase the speed of calculating the rendering cost, the computer can also determine the rendering cost of the component to be rendered according to the volume of the component to be rendered. Specifically, the computer can calculate the volume of each component to be rendered in at least one component to be rendered according to the rendering parameters of the component to be rendered, and determine the volume of the component to be rendered as the rendering cost of the component to be rendered.

[0051] In some possible implementations, the computer may also use the number of triangular faces of the component to be rendered as the rendering cost of the component to be rendered. Specifically, the computer may determine the shape of the component to be rendered based on the three-dimensional data of the component to be rendered, and then determine the number of triangular faces of the component to be rendered. Then, the computer may determine the number of triangular faces of the component to be rendered as the rendering cost of the component to be rendered.

[0052] In some possible implementations, the computer may also calculate the number of triangles of the component to be rendered and the volume of the component to be rendered respectively, and determine the rendering cost of the component to be rendered by combining the number of triangles and the volume.

[0053] S103: Acquire the first time.

[0054] After acquiring the model to be rendered, the computer may determine the first time according to the model to be rendered. The first time is the time required for the computer to render the model to be rendered, that is, the time required to render all components to be rendered in at least one component to be rendered. In the embodiment of the present application, the first time represents the time required to render the complete model to be rendered. That is, the time required for the computer to render the model to be rendered without optimizing the model to be rendered.

[0055] In an embodiment of the present application, the computer can predict the first time through a model, or can render a frame of the model to be rendered and record the time required to render the model to be rendered to obtain the first time.

[0056] S104: If the first time is greater than a time threshold, determine a first component from the at least one component to be rendered.

[0057] After determining the first time, the computer may compare the first time with the threshold value. The time threshold represents the longest time required to render the model to be rendered when the user can see a smooth image. For example, assuming that the user can see a smooth image when the image refresh rate is 2 frames, the time threshold may be 1 / 20 = 0.05 milliseconds.

[0058] If the first time threshold is less than the time threshold, it means that the time required for the computer to render the model to be rendered is short, the image refresh rate is high, and the computer does not need to optimize the model to be rendered. Then, the computer can directly render the model to be rendered and display the rendered image.

[0059] If the first time threshold is less than the time threshold, it means that the time required for the computer to render the model to be rendered is long, the image refresh rate is low, and the user cannot see a smooth image. Then, the computer can determine the first component from the components to be rendered. The rendering cost of the first component is lower than the component to be rendered with the highest rendering cost among all the components to be rendered that constitute the model to be rendered. That is, the first component can be any other component to be rendered among the at least one component to be rendered except the rendering component with the highest rendering cost.

[0060] In some possible implementations, the first component may be a component to be rendered with a medium rendering cost among at least one component to be rendered. When determining the first component, the computer may first sort the at least one component to be rendered according to the rendering cost of each component to be rendered among the at least one component to be rendered. The at least one component to be rendered is sorted in order of rendering cost from large to small (or from small to large), and then the component to be rendered located in the middle of the sorted at least one component to be rendered is determined as the first component.

[0061] S105: Determine a first component set from the at least one component to be rendered.

[0062] After determining the first component, the computer may determine a first component set from the at least one component to be rendered. The first component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the first component set is not higher than the rendering cost of the first component. For example, the computer may determine a component to be rendered whose rendering cost is not higher than that of the first component among at least one component to be rendered constituting the model to be rendered as a component to be rendered in the first component combination.

[0063] S106: Render each component to be rendered in the first component set.

[0064] After determining the first component set, the computer may render the first component set to aggregate each component to be rendered, obtain a rendered image, and display it to the user.

[0065] The embodiment of the present application provides a model rendering method. When rendering a model to be rendered, the model to be rendered can be first obtained, and the model to be rendered includes at least one component to be rendered. Then, the rendering cost of each component to be rendered in at least one component to be rendered that constitutes the model to be rendered can be calculated. The rendering cost represents the time resources and / computing resources required to render the component to be rendered. Then, the model to be rendered can be rendered, and the first time required to render the model to be rendered can be recorded. Then, the size of the first time and the time threshold can be compared. If the first time is greater than the time threshold, it means that the time required to render the component to be rendered is longer, which may cause the refresh rate of the image to be reduced. Therefore, a first component can be determined from at least one component to be rendered, and a first component set can be determined based on the first component. Among them, the rendering cost of the first component is lower than the rendering component with the highest rendering cost in the at least one component to be rendered, and the rendering cost of any one component to be rendered in the first component set is not higher than the first component. After determining the first component set, the first component set can be rendered and displayed. Since the rendering cost of any component to be rendered in the first component set being rendered is lower than the component to be rendered with the highest rendering cost in the model to be rendered, the time resources and computing resources required to render the first component set must be lower than the time resources and computing resources required to render the entire model to be rendered. Then, when the rendering cost of the model to be rendered is too high, part of the model to be rendered can be rendered, thereby reducing the time resources and computing resources required to render the model to be rendered. In this way, by optimizing the model to be rendered, the rendering difficulty of the model is reduced, the image refresh rate is increased, and it can be ensured that the user can see a smooth model.

[0066] In actual application scenarios, the structure of the model to be rendered may be extremely complex, resulting in the time required to render the first component set still being longer than the time threshold. Considering this situation, in an embodiment of the present application, the computer may further screen the first component set.

[0067] Specifically, the computer can record the second time required to render all the components to be rendered in the first component set, and compare the second time with the time threshold. If the second time is greater than the time threshold, it means that the time required for the computer to render all the components to be rendered in the first component set is long, the image refresh rate is low, and the user cannot see a smooth image. Then, the computer can determine a second component from the first component set, and the rendering cost of the second component is lower than the component to be rendered with the highest rendering cost in the first component set. For example, the computer can select a component to be rendered with a medium rendering cost from the first component set as the second component. Then, the computer can determine a second component set from the first component set, the second component set including at least one component to be rendered, and the rendering cost of any one component to be rendered in the second component set is not higher than that of the second component. After determining the second component set, the computer can render each component to be rendered in the second component set one by one.

[0068] If the second time is greater than the time threshold, it means that the time required for the computer to render all the components to be rendered in the first component set is short and the image refresh rate is high. Then, in order to increase the number of constructions included in the image, the computer can appropriately increase the number of rendered constructions to be rendered.

[0069] Specifically, the computer can determine a third component from the first component set, and the rendering cost of the third component is higher than that of the first component. For example, the computer can determine the component to be rendered with a medium rendering cost among the other components to be rendered except the first component set among at least one component to be rendered constituting the model to be rendered as the third component. Then, a third component set is determined from the at least one component to be rendered, and the third component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component; after determining the third component set, the computer can render each component to be rendered in the third component set one by one.

[0070] In some possible implementations, the computer may use a method similar to binary search to determine a suitable target component to be rendered from at least one component to be rendered constituting the model to be rendered, and determine the component to be rendered whose rendering cost is not lower than the target component to be rendered as the rendering object. For example, the computer may determine the target component to be rendered by performing five binary searches. In this way, as much structure as possible can be displayed to the user while ensuring smooth images, thereby ensuring the integrity of the model.

[0071] The above are some specific implementations of the model rendering method provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The above device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.

[0072] See also Figure 2 The schematic diagram of the structure of the model rendering device shown in FIG. 200 includes:

[0073] The acquisition module 210 is used to acquire a model to be rendered, where the model to be rendered includes at least one component to be rendered.

[0074] The calculation module 220 is used to calculate the rendering cost of each component to be rendered in the at least one component to be rendered, and the rendering cost represents the time resources and / or computing resources required to render the model to be rendered.

[0075] The component selection module 230 is used to obtain a first time, where the first time is the time required to render the model to be rendered; if the first time is greater than a time threshold, determine a first component from the at least one component to be rendered, and the rendering cost of the first component is lower than the component to be rendered with the highest rendering cost among the at least one component to be rendered; determine a first component set from the at least one component to be rendered, where the first component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the first component set is not higher than that of the first component.

[0076] The rendering module 240 is used to render each component to be rendered in the first component set.

[0077] The embodiment of the present application provides a model rendering device. When rendering a model to be rendered, the model to be rendered can be first obtained, and the model to be rendered includes at least one component to be rendered. Then, the rendering cost of each component to be rendered in at least one component to be rendered that constitutes the model to be rendered can be calculated. The rendering cost represents the time resources and / computing resources required to render the component to be rendered. Then, the model to be rendered can be rendered, and the first time required to render the model to be rendered can be recorded. Then, the size of the first time and the time threshold can be compared. If the first time is greater than the time threshold, it means that the time required to render the component to be rendered is longer, which may cause the refresh rate of the image to be reduced. Therefore, a first component can be determined from at least one component to be rendered, and a first component set can be determined based on the first component. Among them, the rendering cost of the first component is lower than the rendering component with the highest rendering cost in the at least one component to be rendered, and the rendering cost of any one component to be rendered in the first component set is not higher than the first component. After determining the first component set, the first component set can be rendered and displayed. Since the rendering cost of any component to be rendered in the first component set being rendered is lower than the component to be rendered with the highest rendering cost in the model to be rendered, the time resources and computing resources required to render the first component set must be lower than the time resources and computing resources required to render the entire model to be rendered. Then, when the rendering cost of the model to be rendered is too high, part of the model to be rendered can be rendered, thereby reducing the time resources and computing resources required to render the model to be rendered. In this way, by optimizing the model to be rendered, the rendering difficulty of the model is reduced, the image refresh rate is increased, and it can be ensured that the user can see a smooth model.

[0078] Optionally, in some possible implementations, the calculation module 220 is used to calculate the volume of each component to be rendered in the at least one component to be rendered, and determine the volume of the component to be rendered as the rendering cost of the component to be rendered.

[0079] Optionally, in some possible implementations, the calculation module 220 is used to calculate the number of triangles of each component to be rendered in the at least one component to be rendered, and determine the number of triangles of the component to be rendered as the rendering cost of the component to be rendered.

[0080] Optionally, in some possible implementations, the component selection module 230 is used to sort the at least one component to be rendered according to the rendering cost of each component to be rendered in the at least one component to be rendered; and determine the component to be rendered located in the middle position of the at least one component to be rendered after sorting as the first component.

[0081] Optionally, in some possible implementations, the component selection module 230 is further used to record the second time required to render all the components to be rendered in the first component set; if the second time is greater than the time threshold, determine a second component from the first component set, the rendering cost of the second component is lower than the component to be rendered with the highest rendering cost in the first component set; determine a second component set from the first component set, the second component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the second component set is not higher than that of the second component. The rendering module 240 is also used to render each component to be rendered in the second component set.

[0082] Optionally, in some possible implementations, the component selection module 230 is further used to determine a third component from the first component set if the second time is less than a time threshold, determine a third component from the at least one component to be rendered, and the rendering cost of the third component is higher than that of the first component; determine a third component set from the at least one component to be rendered, the third component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component. The rendering module 240 is also used to render each component to be rendered in the third component set.

[0083] The "first" and "second" in the names of the "first component" and "second component" mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.

[0084] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.

[0085] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0086] The above description is merely an exemplary embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A model rendering method, characterized in that: The method comprises: Obtaining a model to be rendered, wherein the model to be rendered includes at least one component to be rendered; Calculating a rendering cost of each component to be rendered in the at least one component to be rendered, where the rendering cost represents time resources and / or computing resources required to render the component to be rendered; Acquire a first time, where the first time is the time required to render the model to be rendered; If the first time is greater than a time threshold, determining a first component from the at least one component to be rendered, wherein a rendering cost of the first component is lower than a component to be rendered with the highest rendering cost among the at least one component to be rendered; Determine a first component set from the at least one component to be rendered, the first component set including at least one component to be rendered, and a rendering cost of any component to be rendered in the first component set is not higher than that of the first component; Render each component to be rendered in the first component set.

2. The method according to claim 1, characterized in that The calculating the rendering cost of each component to be rendered in the at least one component to be rendered comprises: The volume of each component to be rendered in the at least one component to be rendered is calculated, and the volume of the component to be rendered is determined as the rendering cost of the component to be rendered.

3. The method according to claim 1, characterized in that The calculating the rendering cost of each component to be rendered in the at least one component to be rendered comprises: The number of triangles of each component to be rendered in the at least one component to be rendered is calculated, and the number of triangles of the component to be rendered is determined as the rendering cost of the component to be rendered.

4. The method according to claim 1, characterized in that The determining the first component from the at least one component to be rendered comprises: sorting the at least one component to be rendered according to a rendering cost of each component to be rendered in the at least one component to be rendered; A component to be rendered that is located in the middle of at least one sorted component to be rendered is determined as a first component.

5. The method according to claim 4, characterized in that The method further comprises: Recording a second time required for rendering all components to be rendered in the first component set; If the second time is greater than the time threshold, determining a second component from the first component set, the rendering cost of the second component being lower than the component to be rendered with the highest rendering cost in the first component set; Determine a second component set from the first component set, the second component set including at least one component to be rendered, and a rendering cost of any component to be rendered in the second component set is not higher than that of the second component; Render each to-be-rendered component in the second component set.

6. The method according to claim 5, characterized in that If the second time is less than the time threshold, the method further includes: Determine a third component from the at least one component to be rendered, wherein the rendering cost of the third component is higher than that of the first component; Determine a third component set from the at least one component to be rendered, the third component set including at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component; Render each to-be-rendered component in the third component set.

7. A model rendering device, characterized in that: The device comprises: An acquisition module, used to acquire a model to be rendered, wherein the model to be rendered includes at least one component to be rendered; A calculation module, used to calculate the rendering cost of each component to be rendered in the at least one component to be rendered, wherein the rendering cost represents the time resources and / or computing resources required to render the model to be rendered; A component selection module is used to obtain a first time, where the first time is the time required to render the model to be rendered; if the first time is greater than a time threshold, determine a first component from the at least one component to be rendered, where the rendering cost of the first component is lower than the component to be rendered with the highest rendering cost among the at least one component to be rendered; determine a first component set from the at least one component to be rendered, where the first component set includes at least one component to be rendered, and the rendering cost of any component to be rendered in the first component set is not higher than that of the first component; A rendering module is used to render each component to be rendered in the first component set.

8. The device according to claim 7, characterized in that The component selection module is used to sort the at least one component to be rendered according to the rendering cost of each component to be rendered in the at least one component to be rendered; and determine the component to be rendered located in the middle position of the at least one component to be rendered after sorting as the first component.

9. The device according to claim 8, characterized in that The component selection module is further configured to record a second time required to render all the components to be rendered in the first component set; if the second time is greater than the time threshold, determine a second component from the first component set, the rendering cost of the second component being lower than the component to be rendered with the highest rendering cost in the first component set; determine a second component set from the first component set, the second component set including at least one component to be rendered, and the rendering cost of any component to be rendered in the second component set is not higher than that of the second component; The rendering module is further used to render each to-be-rendered component in the second component set.

10. The device according to claim 9, characterized in that The component selection module is further configured to determine a third component from the first component assembly if the second time is less than a time threshold, and to determine the third component from the at least one component to be rendered, wherein the rendering cost of the third component is higher than that of the first component; Determine a third component set from the at least one component to be rendered, the third component set including at least one component to be rendered, and the rendering cost of any component to be rendered in the third component set is not lower than that of the third component; The rendering module is further used to render each component to be rendered in the third component set.

Citation Information

Patent Citations

  • Rendering method and device of physical model, and electronic equipment

    CN108846791A

  • A method and device for generating rendering task processing time

    CN109949394A