Rendering optimization method and device for three-dimensional scene of power grid, electronic equipment and storage medium

By allocating the three-dimensional model to render optimization and detail control scene tree according to priority, and calculating priority scores using the depth layer distance index, accuracy index and occlusion index, the problem of waste of computing resources in power grid 3D scene rendering is solved, and the rendering efficiency and Fluency.

CN119169173APending Publication Date: 2024-12-20GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411492847.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

The existing three-dimensional scene rendering method of power grid consumes a lot of computing resources when processing complex models, resulting in poor rendering fluency and slow loading speed, making it difficult to meet actual engineering needs, especially in large-scale power grid scenarios.

Method used

By assigning the three-dimensional model to the rendering optimization scene tree or the detail control scene tree according to its priority, the priority score is calculated using the depth layer distance index, accuracy index and occlusion index. Priority rendering requires models with lower rendering accuracy, reducing the need to not Necessary computing resource consumption.

Benefits of technology

It significantly improves rendering efficiency, reduces system computing load, improves rendering fluency and loading speed, avoids waste of full-precision rendering resources, and ensures the fineness of visual effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169173A_ABST
    Figure CN119169173A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering optimization method and device for a three-dimensional scene of a power grid, electronic equipment and a storage medium. The method comprises the steps of obtaining a target three-dimensional model in the three-dimensional scene of the power grid and a depth layer distance index of the target three-dimensional model; determining the precision index of each model through the model distance; pre-rendering the target three-dimensional model to generate a shielding index of each model; calculating a priority score of each target three-dimensional model by combining the depth layer distance index, the precision index and the shielding index; the models with the priority scores exceeding a preset score threshold value serve as rendering optimization models, and the models with the priority scores smaller than the preset score threshold value serve as detail control models; ranking the priority scores of the rendering optimization model to obtain a first order; ranking the priority scores of the detail control models to obtain a second order; and the rendering optimization model is rendered according to the first order, and then the detail control model is rendered according to the second order, so that efficient rendering optimization is realized, and the calculation burden is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power grid three-dimensional scene rendering, and in particular to a rendering optimization method, device, electronic equipment and storage medium for a power grid three-dimensional scene. Background Art

[0002] With the development of the power industry, the digital construction of power grids is becoming increasingly important, especially in the visualization of three-dimensional scenes. The three-dimensional scene rendering of power grids plays a vital role in power grid design, monitoring and operation and maintenance. Through the intuitive display of three-dimensional scenes, the spatial layout, structure and operating status of power grid equipment can be presented more clearly, helping staff to make quick judgments and decisions.

[0003] However, existing technologies face many problems in the process of three-dimensional scene rendering. The current rendering method usually loads and renders all the models and their detailed information in the scene at one time, without effectively classifying the models according to their complexity, rendering requirements, etc., resulting in complex models and simple models being rendered at the same time. This method of directly rendering all model data requires a large amount of computing resources and graphics processing capabilities, resulting in a huge amount of computation in the rendering process and reduced system performance, which is manifested in poor rendering fluency and slow loading speed. It is difficult to meet actual engineering needs, especially when dealing with large-scale power grid scenes. The system often cannot complete efficient rendering within a reasonable time, which increases the redundant burden of rendering. Summary of the invention

[0004] The embodiments of the present invention provide a rendering optimization method, device, electronic device and storage medium for a three-dimensional power grid scene. By implementing the present invention, three-dimensional models of different priorities can be assigned to a rendering optimization scene tree or a detail control scene tree for processing, thereby improving rendering efficiency and avoiding the waste of resources for full-precision rendering of all three-dimensional models in the three-dimensional scene.

[0005] An embodiment of the present invention provides a rendering optimization method for a three-dimensional power grid scene, comprising:

[0006] Obtaining target three-dimensional models in the power grid three-dimensional scene and depth layer distance indexes of each target three-dimensional model;

[0007] Determine the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene;

[0008] Pre-rendering each target three-dimensional model to generate an occlusion index of each target three-dimensional model;

[0009] Calculate the priority score of each target 3D model according to the depth layer distance index, accuracy index and occlusion index of each target 3D model;

[0010] Each target three-dimensional model whose priority score is greater than or equal to a preset score threshold is set as a corresponding rendering optimization model; each target three-dimensional model whose priority score is less than a preset score threshold is set as a corresponding detail control model;

[0011] Sort the priority scores of the rendering optimization models from large to small to obtain the first order; sort the priority scores of the detail control models from large to small to obtain the second order;

[0012] After rendering each rendering optimization model in sequence according to the first order, each detail control model is rendered in sequence according to the second order.

[0013] Furthermore, obtaining a target three-dimensional model in the three-dimensional power grid scene includes:

[0014] Obtain all three-dimensional models and the viewing angle range of the virtual camera in the three-dimensional scene of the power grid;

[0015] Perform a frustum clipping operation on all three-dimensional models according to the viewing angle range of the virtual camera to obtain a three-dimensional model within the viewing angle range of the virtual camera;

[0016] Obtain the non-closed grid index and self-intersecting surface intersection index of all three-dimensional models in the three-dimensional power grid scene;

[0017] According to the non-closed grid index and self-intersecting surface intersection index of each three-dimensional model, the abnormal coefficient of each three-dimensional model is calculated;

[0018] The three-dimensional model whose abnormal coefficient is less than a preset coefficient threshold is set as a non-abnormal three-dimensional model;

[0019] A non-abnormal three-dimensional model in the three-dimensional model within the viewing range of the virtual camera is used as the target three-dimensional model.

[0020] Furthermore, the depth layer distance index of each target three-dimensional model is obtained, including:

[0021] Dividing each target three-dimensional model into a plurality of first target three-dimensional models and a plurality of second target three-dimensional models; wherein the first target three-dimensional models contain transparent components, and the second target three-dimensional models do not contain transparent components;

[0022] For each first target three-dimensional model, the distance between each transparent component and the virtual camera is calculated to obtain the distance of each component; the distances of each component are sorted from small to large to obtain the first component order;

[0023] Generating a depth layer distance index of each first target three-dimensional model according to the first component order;

[0024] For each second target three-dimensional model, the depth layer distance index of each second target three-dimensional model is set to a preset distance index.

[0025] Furthermore, according to the distance between each target three-dimensional model and the virtual camera corresponding to the three-dimensional scene of the power grid, the accuracy index of each target three-dimensional model is determined, including:

[0026] According to the distance between each target three-dimensional model and the virtual camera corresponding to the three-dimensional scene of the power grid, the distance of each model is calculated and generated;

[0027] The accuracy index of each target three-dimensional model is determined according to each model distance, a preset first distance, a preset second distance, a preset third distance and a preset fourth distance.

[0028] Furthermore, each target three-dimensional model is pre-rendered to generate an occlusion index of each target three-dimensional model, including:

[0029] Pre-rendering each target three-dimensional model to generate a depth value of each first pixel in each target three-dimensional model;

[0030] Projecting each first pixel in each target three-dimensional model to a pre-rendered two-dimensional screen coordinate system to generate a corresponding second pixel;

[0031] For each second pixel, traverse all first pixels corresponding to it, compare the depth value of each first pixel, and use the smallest depth value as the depth buffer value of the second pixel;

[0032] The first pixel in each target 3D model whose depth value is greater than the depth buffer value is taken as an occlusion pixel; for each target 3D model, the sum of the depth values ​​of all occlusion pixels is calculated as the occlusion index of each target 3D model.

[0033] Furthermore, the priority score of each target 3D model is calculated by the following formula:

[0034]

[0035] Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; γ is the adjustment coefficient of the occlusion index; Cover is the depth layer distance index of each target 3D model.

[0036] Based on the above method embodiment, the present invention provides a corresponding device embodiment.

[0037] An embodiment of the present invention provides a rendering optimization device for a three-dimensional scene of a power grid, comprising: a three-dimensional model acquisition module, an accuracy index determination module, an occlusion index generation module, a priority score calculation module, a three-dimensional model classification module and a three-dimensional scene rendering module;

[0038] The three-dimensional model acquisition module is used to acquire the target three-dimensional model in the three-dimensional scene of the power grid and the depth layer distance index of each target three-dimensional model;

[0039] The accuracy index determination module is used to determine the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene;

[0040] The occlusion index generation module is used to pre-render each target three-dimensional model and generate an occlusion index of each target three-dimensional model;

[0041] The priority score calculation module is used to calculate the priority score of each target three-dimensional model according to the depth layer distance index, accuracy index and occlusion index of each target three-dimensional model;

[0042] The three-dimensional model classification module is used to set each target three-dimensional model whose priority score is greater than or equal to a preset score threshold as a corresponding rendering optimization model; and set each target three-dimensional model whose priority score is less than a preset score threshold as a corresponding detail control model;

[0043] The three-dimensional scene rendering module is used to sort the priority scores of each rendering optimization model from large to small to obtain a first order; sort the priority scores of each detail control model from large to small to obtain a second order; render each rendering optimization model in sequence according to the first order, and then render each detail control model in sequence according to the second order.

[0044] Furthermore, the priority score of each target 3D model is calculated by the following formula:

[0045]

[0046] Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; γ is the adjustment coefficient of the occlusion index; Cover is the depth layer distance index of each target 3D model.

[0047] Based on the above method embodiment, the present invention provides a corresponding electronic device embodiment.

[0048] An embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the rendering optimization method for a three-dimensional power grid scene described in any one of the above-mentioned method embodiments can be implemented.

[0049] Based on the above method item embodiments, the present invention provides a corresponding storage medium item embodiment.

[0050] An embodiment of the present invention provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the rendering optimization method of a three-dimensional power grid scene described in any one of the above method embodiments can be implemented.

[0051] Compared with the prior art, the present invention has the following beneficial effects:

[0052] The embodiment of the present invention provides a rendering optimization method, device, electronic device and storage medium for a three-dimensional scene of a power grid. By taking the three-dimensional model in the three-dimensional scene that is within the viewing area of ​​the virtual camera and is not abnormal as the target three-dimensional model, it significantly reduces unnecessary model data participating in the calculation and reduces the rendering pressure; according to the type, precision index, occlusion index and depth layer distance index of each target three-dimensional model, the priority score of each target three-dimensional model is determined; the higher the priority score, the lower the rendering precision required for the target three-dimensional model, and the target three-dimensional model needs to be rendered first; according to the priority score of each target three-dimensional model, the model is divided into a rendering optimization model and a detail control model. By first rendering the model in the rendering optimization model that requires low rendering precision and is mainly presented as a whole, the system can quickly process simple models, reduce the consumption of system resources and the time burden of rendering. On this basis, the model in the detail control model that requires high rendering precision and needs to be displayed in detail is rendered to ensure the fineness and picture quality of the rendering process, and ensure that the final visual effect will not be affected. This classification processing method greatly reduces the computational pressure brought by rendering a large number of complex models at the same time. Through reasonable priority division, models of different priorities are assigned to the rendering optimization model and detail control model for processing as needed, which not only improves rendering efficiency, but also avoids the waste of resources for full-precision rendering of all models. Especially when processing large-scale power grid 3D scenes, it can effectively reduce the system's computing load and improve rendering fluency and loading speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flowchart of a rendering optimization method for a three-dimensional power grid scene provided by an embodiment of the present invention.

[0054] Figure 2It is a structural diagram of a rendering optimization device for a three-dimensional power grid scene provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0056] like Figure 1 As shown, an embodiment of the present invention provides a rendering optimization method for a three-dimensional power grid scene, which at least includes the following steps:

[0057] Step S1, obtaining target three-dimensional models in a three-dimensional power grid scene and a depth layer distance index of each target three-dimensional model;

[0058] Specifically, in a preferred embodiment, obtaining a target three-dimensional model in a three-dimensional power grid scene includes:

[0059] Obtain all three-dimensional models and the viewing angle range of the virtual camera in the three-dimensional scene of the power grid;

[0060] Perform a frustum clipping operation on all three-dimensional models according to the viewing angle range of the virtual camera to obtain a three-dimensional model within the viewing angle range of the virtual camera;

[0061] Obtain the non-closed grid index and self-intersecting surface intersection index of all three-dimensional models in the three-dimensional power grid scene;

[0062] According to the non-closed grid index and self-intersecting surface intersection index of each three-dimensional model, the abnormal coefficient of each three-dimensional model is calculated;

[0063] The three-dimensional model whose abnormal coefficient is less than a preset coefficient threshold is set as a non-abnormal three-dimensional model;

[0064] A non-abnormal three-dimensional model in the three-dimensional model within the viewing range of the virtual camera is used as the target three-dimensional model.

[0065] Optionally, when obtaining the viewing angle range of the virtual camera, first obtain the key parameters of the virtual camera, including the position, orientation, viewing angle, and viewport size of the camera in three-dimensional space. These parameters together define the visible range of the virtual camera. Then, based on the viewing angle and viewport size of the virtual camera, calculate the viewing angle range of the virtual camera, that is, the viewing cone. The viewing cone is a four-sided pyramid-shaped space, the vertices of which correspond to the positions of the virtual camera, the opening direction is determined by the orientation of the camera, and the angle of the cone is determined by the viewing angle and viewport size of the camera. The viewing cone is the viewing angle range of the virtual camera, which is used to describe the three-dimensional space area that the camera can see, and to determine which three-dimensional models are within this range.

[0066] Preferably, in the frustum clipping operation, it is first necessary to obtain the bounding box of each three-dimensional model according to the vertex coordinates of each three-dimensional model in the three-dimensional scene of the power grid. This is the smallest circumscribed cuboid of the three-dimensional model in space, which is used to quickly determine the position and size of the model. Then, the bounding box of each three-dimensional model is subjected to intersection detection with the frustum to determine whether the bounding box is completely outside, inside, or partially overlapped with the frustum. If the bounding box is completely outside the frustum, it means that the model is outside the camera's viewing angle and does not require further processing. It can be directly eliminated and the rendering of the model can be skipped. If the bounding box partially intersects with the frustum, it means that the model may be partially within the camera's line of sight and needs to be processed or rendered. If the bounding box is completely inside the frustum, it means that the model is completely within the visible range and can be directly rendered. In this way, for the three-dimensional model whose bounding box is completely outside the frustum, the elimination operation is performed to avoid unnecessary rendering calculations, thereby improving rendering efficiency.

[0067] Exemplarily, when obtaining the non-closed grid index of all three-dimensional models in the three-dimensional grid scene, all missing line grids in the three-dimensional model are obtained, and the ratio of the missing line length of each missing line grid to the grid perimeter is calculated to obtain the missing rate of each grid. The missing rates of all missing line grids are summed to finally obtain the non-closed grid index. The larger the non-closed grid index, the more non-closed grids there are in the three-dimensional model, which affects the overall quality of the model and may cause errors in the renderer when processing these grids, especially in lighting and shadow calculations.

[0068] Exemplarily, when obtaining the non-closed grid index of all three-dimensional models in the three-dimensional scene of the power grid, the number of self-intersecting geometric faces in the three-dimensional model is obtained, that is, two faces occupy the same space or penetrate each other, and the intersection area of ​​each self-intersecting geometric face is calculated. The intersection areas of all self-intersecting geometric faces are summed to obtain the self-intersecting face intersection index. The larger the self-intersecting face intersection index, the more geometric faces in the model intersect or the more serious the intersection, which will affect the overall quality of the three-dimensional model and may cause problems in the renderer when calculating shadows, lighting and depth, resulting in rendering failure or visual defects.

[0069] In an optional embodiment, the anomaly coefficient of the three-dimensional model is calculated in the following manner:

[0070] Obtain the non-closed grid index and self-intersection surface intersection index of all three-dimensional models in the three-dimensional power grid scene; normalize the non-closed grid index and self-intersection surface intersection index, map their value range to [0,1], and obtain the normalized value of the non-closed grid index and the normalized value of the self-intersection surface intersection index; sum the normalized value of the non-closed grid index and the normalized value of the self-intersection surface intersection index to obtain the abnormal coefficient of the three-dimensional model. It can be understood that the larger the abnormal coefficient, the worse the overall quality of the three-dimensional model.

[0071] Specifically, in a preferred embodiment, obtaining the depth layer distance index of each target three-dimensional model includes:

[0072] Dividing each target three-dimensional model into a plurality of first target three-dimensional models and a plurality of second target three-dimensional models; wherein the first target three-dimensional models contain transparent components, and the second target three-dimensional models do not contain transparent components;

[0073] For each first target three-dimensional model, the distance between each transparent component and the virtual camera is calculated to obtain the distance of each component; the distances of each component are sorted from small to large to obtain the first component order;

[0074] Generating a depth layer distance index of each first target three-dimensional model according to the first component order;

[0075] For each second target three-dimensional model, the depth layer distance index of each second target three-dimensional model is set to a preset distance index.

[0076] It is understandable that the transparent components are components made of transparent materials, and may include objects with transparent effects such as glass and liquid.

[0077] Exemplarily, for each first target three-dimensional model, the depth layer distance index of each first target three-dimensional model is generated in the following manner:

[0078] According to the first component order, the transparent components of each first target three-dimensional model are layered to generate several depth layers; the depth layer defines the front and back order of transparent components in the visual sense, and each depth level corresponds to a specific distance range; each depth layer contains at least one transparent component; since a first target three-dimensional model may span multiple depth layers, the mean Euclidean distance between the transparent component and the virtual camera in each depth layer is calculated; the mean Euclidean distance of all depth layers covered by the first target three-dimensional model is added and divided by the number of depth layers covered by the three-dimensional model to obtain the depth layer distance index. The smaller the depth layer distance index of the first target three-dimensional model, the closer the first target three-dimensional model is to the camera as a whole, and the more it needs to be rendered first.

[0079] Exemplarily, for each second target three-dimensional model, since the second target three-dimensional model does not contain a transparent component, the depth layer distance index of each second target three-dimensional model is set to 0.

[0080] Step S2, determining the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene;

[0081] Specifically, in a preferred embodiment, the accuracy index of each target three-dimensional model is determined according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene, including:

[0082] According to the distance between each target three-dimensional model and the virtual camera corresponding to the three-dimensional scene of the power grid, the distance of each model is calculated and generated;

[0083] The accuracy index of each target three-dimensional model is determined according to each model distance, a preset first distance, a preset second distance, a preset third distance and a preset fourth distance.

[0084] Optionally, determining the accuracy index of each target three-dimensional model according to each model distance, a preset first distance, a preset second distance, a preset third distance, and a preset fourth distance includes:

[0085] If the model distance of each target 3D model is less than or equal to the preset first distance, the accuracy of the target 3D model is set to LOD1 accuracy, and the accuracy index corresponding to LOD1 accuracy is 2.0; if the model distance of each target 3D model is greater than the preset first distance, and the model distance of each target 3D model is less than or equal to the preset second distance, the accuracy of the target 3D model is set to LOD2 accuracy, and the accuracy index corresponding to LOD1 accuracy is 1.8; if the model distance of each target 3D model is greater than the preset second distance, and the model distance of each target 3D model is less than or equal to the preset third distance, the target 3D model is set to LOD2 accuracy, and the accuracy index corresponding to LOD1 accuracy is 1.8. The accuracy of the model is set to LOD3, and the accuracy index corresponding to LOD3 accuracy is 1.6; if the model distance of each target three-dimensional model is greater than the preset fourth distance, and the model distance of each target three-dimensional model is less than or equal to the preset fourth distance, the accuracy of the target three-dimensional model is set to LOD4 accuracy, and the accuracy index corresponding to LOD4 accuracy is 1.4; if the model distance of each target three-dimensional model is greater than the preset fourth distance, and the model distance of each target three-dimensional model is less than or equal to the preset fifth distance, the accuracy of the target three-dimensional model is set to LOD5 accuracy, and the accuracy index corresponding to LOD5 accuracy is 1.2;

[0086] It should be noted that the accuracy is ranked as follows: LOD1 accuracy > LOD2 accuracy > LOD3 accuracy > LOD4 accuracy > LOD5 accuracy.

[0087] Optionally, the target three-dimensional models are divided into short-distance models, medium-distance models, and long-distance models according to the accuracy of each target three-dimensional model; the target three-dimensional model with LOD1 accuracy or LOD2 accuracy is set as the short-distance model; the target three-dimensional model with LOD3 accuracy is set as the medium-distance model; the target three-dimensional model with LOD4 accuracy or LOD5 accuracy is set as the medium-distance model.

[0088] It is understandable that the higher the precision of the 3D model, the more vertices, patches and texture information it contains, and the more computing resources it requires to render. Prioritizing the rendering of low-precision models can reduce the computational burden of initial rendering, thereby improving overall rendering efficiency.

[0089] Step S3, pre-rendering each target three-dimensional model to generate an occlusion index of each target three-dimensional model;

[0090] Specifically, in a preferred embodiment, pre-rendering each target three-dimensional model to generate an occlusion index of each target three-dimensional model includes:

[0091] Pre-rendering each target three-dimensional model to generate a depth value of each first pixel in each target three-dimensional model;

[0092] Projecting each first pixel in each target three-dimensional model to a pre-rendered two-dimensional screen coordinate system to generate a corresponding second pixel;

[0093] For each second pixel, traverse all first pixels corresponding to it, compare the depth value of each first pixel, and use the smallest depth value as the depth buffer value of the second pixel;

[0094] The first pixel in each target 3D model whose depth value is greater than the depth buffer value is taken as an occlusion pixel; for each target 3D model, the sum of the depth values ​​of all occlusion pixels is calculated as the occlusion index of each target 3D model.

[0095] Optionally, the pre-rendering of each target three-dimensional model refers to performing a quick rendering of each target three-dimensional model, where the quick rendering is a simple rendering, such as rendering with rough component shapes and single color rendering.

[0096] It is understandable that models closer to the virtual camera are more likely to occlude distant models, so giving priority to rendering nearby models can effectively record their depth information through the depth buffer, thereby eliminating those obscured distant models and avoiding unnecessary rendering calculations. The depth buffer specifically stores the depth value of the first pixel closest to the virtual camera. Generally speaking, the closer the pixel is to the virtual camera, the smaller its depth value, while the farther the pixel is, the larger its depth value. When the depth value of a pixel is greater than the value in the depth buffer, it means that the pixel is behind another object and is obscured by the object in front. Relatively speaking, if the depth value of a pixel is less than or equal to the value of the depth buffer, it means that the pixel is visible or is not obscured at the same position and distance.

[0097] The size of the occlusion index is an important basis for measuring the rendering priority of the model. When the occlusion index of the target 3D model is small, it means that the model is less obscured by other objects, so the rendering engine does not need to spend too many resources to analyze complex occlusion relationships. This means that these models can be rendered faster, improving the overall rendering efficiency while also reducing the computational burden. By giving priority to rendering models with smaller occlusion indices, not only the rendering efficiency is improved, but also the visual quality of the final picture is ensured, the use of resources is optimized, and a smoother and more efficient solution is provided for real-time rendering scenes.

[0098] Step S4, calculating the priority score of each target three-dimensional model according to the depth layer distance index, accuracy index and occlusion index of each target three-dimensional model;

[0099] Optionally, the priority score of each target 3D model is calculated using the following formula:

[0100]

[0101] Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; γ is the adjustment coefficient of the occlusion index; Cover is the depth layer distance index of each target 3D model.

[0102] Understandably, through this priority scoring mechanism, the rendering engine can intelligently choose the rendering order and process those models with lower requirements first. This approach not only improves rendering efficiency, but also effectively saves computing resources and avoids unnecessary rendering burden. At the same time, prioritizing the rendering of these high-priority models helps ensure that more complex models can achieve higher rendering accuracy when resources are sufficient. This method provides a practical solution for the rendering of real-time 3D scenes, which helps to achieve a smooth visual experience and efficient resource utilization.

[0103] Step S5, setting each target three-dimensional model whose priority score is greater than or equal to a preset scoring threshold as a corresponding rendering optimization model; setting each target three-dimensional model whose priority score is less than the preset scoring threshold as a corresponding detail control model;

[0104] It can be understood that by setting the target three-dimensional models with priority scores greater than or equal to the preset score threshold as rendering optimization models, it can be ensured that these models are rendered first. This step can significantly reduce the complexity of rendering calculations, because these models are often located in a farther position or have lower detail requirements, so they do not require too many resources. This can greatly improve the efficiency of scene rendering and avoid over-calculation of unnecessary details. At the same time, setting the three-dimensional models with priority scores less than the preset score threshold as detail control models provides these models with higher rendering accuracy to meet their rendering needs that may be located close to the virtual camera or have higher detail requirements. This method effectively balances the rendering accuracy and rendering efficiency of the model, reduces unnecessary computing resource consumption, and thus improves the overall rendering performance and response speed of the system while ensuring the rendering quality.

[0105] Step S6: sort the priority scores of the rendering optimization models from large to small to obtain a first order; sort the priority scores of the detail control models from large to small to obtain a second order;

[0106] It can be understood that by sorting the priority scores of the rendering optimization model and the detail control model, the rendering order and resource allocation can be effectively optimized. First, sort the priority scores of the rendering optimization model from large to small to ensure that those models with lower requirements and lower precision are rendered first. In this way, the rendering of the overall scene can be completed first, and the main outline and structure of the scene can be quickly displayed, thereby improving the speed of scene loading and the smoothness of system response. Secondly, sort the priority scores of the detail control model from large to small to ensure that models with high precision requirements and rich details are processed in sequence during subsequent rendering. In this way, it is possible to avoid complex models from occupying too many resources in the initial rendering, reduce unnecessary computing pressure, and ensure that these models are processed intensively in the subsequent rendering stage, thereby further optimizing rendering efficiency and resource utilization while ensuring accuracy.

[0107] Step S7: After rendering each rendering optimization model in sequence according to the first order, each detail control model is rendered in sequence according to the second order.

[0108] In an optional embodiment, a rendering optimization scene tree is constructed based on the rendering optimization model; a detail control scene tree is constructed based on the detail control model, and then each rendering optimization model in the rendering optimization scene tree is rendered in sequence according to a first order, and then each detail control model in the detail control scene tree is rendered in sequence according to a second order.

[0109] Among them, the root nodes of the rendering optimization scene tree and the detail control scene tree are the entrances to the entire virtual scene. The root node itself does not have specific 3D model data, and it mainly plays the role of organizing and managing the entire scene. The target 3D model is divided into close-range, medium-range and long-range model groups according to the distance from the virtual camera. Each distance category corresponds to a master node, which is used to further manage the models within their respective distance ranges. For example, the close-range model group node will contain all models that are close to the virtual camera, while the long-range model group node will contain models that are farther away. Under each distance model group, it is further divided according to the accuracy of the target 3D model. Different child nodes are formed from high accuracy to low accuracy. Each accuracy node corresponds to a 3D model of a different accuracy level, and under the accuracy node is the specific 3D model data. Each target 3D model is attached to the appropriate accuracy node.

[0110] Based on the above method embodiment, the present invention provides a corresponding device embodiment.

[0111] like Figure 2As shown, an embodiment of the present invention provides a rendering optimization device for a three-dimensional power grid scene, including: a three-dimensional model acquisition module 101, an accuracy index determination module 102, an occlusion index generation module 103, a priority score calculation module 104, a three-dimensional model classification module 105 and a three-dimensional scene rendering module 106.

[0112] The three-dimensional model acquisition module 101 is used to acquire target three-dimensional models in the three-dimensional scene of the power grid and the depth layer distance index of each target three-dimensional model;

[0113] The accuracy index determination module 102 is used to determine the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene;

[0114] The occlusion index generating module 103 is used to pre-render each target three-dimensional model and generate an occlusion index of each target three-dimensional model;

[0115] The priority score calculation module 104 is used to calculate the priority score of each target three-dimensional model according to the depth layer distance index, accuracy index and occlusion index of each target three-dimensional model;

[0116] The three-dimensional model classification module 105 is used to set each target three-dimensional model whose priority score is greater than or equal to a preset score threshold as a corresponding rendering optimization model; and set each target three-dimensional model whose priority score is less than a preset score threshold as a corresponding detail control model;

[0117] The three-dimensional scene rendering module 106 is used to sort the priority scores of each rendering optimization model from large to small to obtain a first order; sort the priority scores of each detail control model from large to small to obtain a second order; render each rendering optimization model in sequence according to the first order, and then render each detail control model in sequence according to the second order.

[0118] Specifically, in a preferred embodiment, the priority score of each target three-dimensional model is calculated by the following formula:

[0119]

[0120] Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; γ is the adjustment coefficient of the occlusion index; Cover is the depth layer distance index of each target 3D model.

[0121] It should be noted that the embodiments of the device described above correspond to the above embodiments of the present invention, and can implement any of the methods described above in the present invention. In addition, the embodiments of the above-mentioned device are merely schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0122] Based on the above method embodiment of the present invention, a corresponding electronic device embodiment is provided.

[0123] An embodiment of the present invention provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the rendering optimization method for a three-dimensional power grid scene described in any one of the present invention is implemented, or when the processor executes the computer program, the functions of each module in the above-mentioned device embodiments are implemented.

[0124] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the terminal device.

[0125] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0126] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0127] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0128] Based on the above method embodiment, the present invention provides a storage medium embodiment;

[0129] Another embodiment of the present invention provides a storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute any of the above-mentioned rendering optimization methods of the three-dimensional power grid scene of the present invention.

[0130] The storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0131] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0132] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A rendering optimization method for a three-dimensional power grid scene. It is characterized in that include: Obtaining target three-dimensional models in the power grid three-dimensional scene and depth layer distance indexes of each target three-dimensional model; Determine the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene; Pre-rendering each target three-dimensional model to generate an occlusion index of each target three-dimensional model; Calculate the priority score of each target 3D model according to the depth layer distance index, accuracy index and occlusion index of each target 3D model; Each target three-dimensional model whose priority score is greater than or equal to a preset score threshold is set as a corresponding rendering optimization model; each target three-dimensional model whose priority score is less than a preset score threshold is set as a corresponding detail control model; Sort the priority scores of the rendering optimization models from large to small to obtain the first order; sort the priority scores of the detail control models from large to small to obtain the second order; After rendering each rendering optimization model in sequence according to the first order, each detail control model is rendered in sequence according to the second order.

2. A rendering optimization method for a three-dimensional power grid scene as claimed in claim 1, It is characterized in that Obtain the target 3D model in the power grid 3D scene, including: Obtain all three-dimensional models and the viewing angle range of the virtual camera in the three-dimensional scene of the power grid; Perform a frustum clipping operation on all three-dimensional models according to the viewing angle range of the virtual camera to obtain a three-dimensional model within the viewing angle range of the virtual camera; Obtain the non-closed grid index and self-intersecting surface intersection index of all three-dimensional models in the three-dimensional power grid scene; According to the non-closed grid index and self-intersecting surface intersection index of each three-dimensional model, the abnormal coefficient of each three-dimensional model is calculated; The three-dimensional model whose abnormal coefficient is less than a preset coefficient threshold is set as a non-abnormal three-dimensional model; A non-abnormal three-dimensional model in the three-dimensional model within the viewing range of the virtual camera is used as the target three-dimensional model.

3. A rendering optimization method for a three-dimensional power grid scene as claimed in claim 1, It is characterized in that Get the depth layer distance index of each target 3D model, including: Dividing each target three-dimensional model into a plurality of first target three-dimensional models and a plurality of second target three-dimensional models; wherein the first target three-dimensional models contain transparent components, and the second target three-dimensional models do not contain transparent components; For each first target three-dimensional model, the distance between each transparent component and the virtual camera is calculated to obtain the distance of each component; the distances of each component are sorted from small to large to obtain the first component order; Generating a depth layer distance index of each first target three-dimensional model according to the first component order; For each second target three-dimensional model, the depth layer distance index of each second target three-dimensional model is set to a preset distance index.

4. A rendering optimization method for a three-dimensional power grid scene as claimed in claim 1, It is characterized in that According to the distance between each target 3D model and the virtual camera corresponding to the power grid 3D scene, the accuracy index of each target 3D model is determined, including: According to the distance between each target three-dimensional model and the virtual camera corresponding to the three-dimensional scene of the power grid, the distance of each model is calculated and generated; The accuracy index of each target three-dimensional model is determined according to each model distance, a preset first distance, a preset second distance, a preset third distance and a preset fourth distance.

5. A rendering optimization method for a three-dimensional power grid scene as claimed in claim 1, It is characterized in that Pre-render each target 3D model and generate the occlusion index of each target 3D model, including: Pre-rendering each target three-dimensional model to generate a depth value of each first pixel in each target three-dimensional model; Projecting each first pixel in each target three-dimensional model to a pre-rendered two-dimensional screen coordinate system to generate a corresponding second pixel; For each second pixel, traverse all first pixels corresponding to it, compare the depth value of each first pixel, and use the smallest depth value as the depth buffer value of the second pixel; The first pixel in each target 3D model whose depth value is greater than the depth buffer value is taken as an occlusion pixel; for each target 3D model, the sum of the depth values ​​of all occlusion pixels is calculated as the occlusion index of each target 3D model.

6. A rendering optimization method for a three-dimensional power grid scene as claimed in claim 1, It is characterized in that The priority score of each target 3D model is calculated using the following formula: Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; Υ is the adjustment coefficient of the occlusion index; Coυer is the depth layer distance index of each target 3D model.

7. A rendering optimization device for a three-dimensional power grid scene, It is characterized in that include: 3D model acquisition module, accuracy index determination module, occlusion index generation module, priority score calculation module, 3D model classification module and 3D scene rendering module; The three-dimensional model acquisition module is used to acquire the target three-dimensional model in the three-dimensional scene of the power grid and the depth layer distance index of each target three-dimensional model; The accuracy index determination module is used to determine the accuracy index of each target three-dimensional model according to the distance between each target three-dimensional model and the virtual camera corresponding to the power grid three-dimensional scene; The occlusion index generation module is used to pre-render each target three-dimensional model and generate an occlusion index of each target three-dimensional model; The priority score calculation module is used to calculate the priority score of each target three-dimensional model according to the depth layer distance index, accuracy index and occlusion index of each target three-dimensional model; The three-dimensional model classification module is used to set each target three-dimensional model whose priority score is greater than or equal to a preset score threshold as a corresponding rendering optimization model; and set each target three-dimensional model whose priority score is less than a preset score threshold as a corresponding detail control model; The three-dimensional scene rendering module is used to sort the priority scores of the rendering optimization models from large to small to obtain a first order; The priority scores of the detail control models are sorted from large to small to obtain a second order; after rendering the rendering optimization models in sequence according to the first order, the detail control models are rendered in sequence again according to the second order.

8. A rendering optimization device for a three-dimensional power grid scene as claimed in claim 7, It is characterized in that The priority score of each target 3D model is calculated using the following formula: Among them, priority is the priority score of each target 3D model; α is the adjustment coefficient of the accuracy index; LOD f is the accuracy index of each target 3D model; β is the adjustment coefficient of the depth layer distance index; sdz is the depth layer distance index of each target 3D model; Υ is the adjustment coefficient of the occlusion index; Coυer is the depth layer distance index of each target 3D model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, Features: When the processor executes the computer program, the rendering optimization method of the three-dimensional power grid scene described in any one of claims 1 to 6 can be implemented.

10. A storage medium having a computer program stored thereon, Features: When the computer program is executed by a processor, it can implement the rendering optimization method of the three-dimensional power grid scene described in any one of claims 1 to 6.

Citation Information

Cited By

  • Multi-precision dynamic loading and performance optimization rendering method for hydroelectric generating set model

    CN120032036A