A WebGPU-based power grid multi-detail level model dynamic switching method, system, device and medium
Patent Information
- Application Number
- CN202611053762.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]本申请提供一种基于 WebGPU 的电网多细节层次模型动态切换方法、系统、设备及介质,以解决传统LOD切换机制依赖硬切换,新旧层级模型间无平滑过渡、模型加载完全被动响应用户视角变化,缺乏基于运动预测的预加载机制的问题
通过启用LOD过渡渲染管线,在模型切换层级时同步渲染新旧两个LOD层级,并采用Alpha混合技术在预设时间段内完成渐变过渡,直接解决了传统硬切换导致的视觉不连续问题。该机制确保了电网三维模型在不同细节密度间切换时,画面呈现连续、自然的视觉演化,避免了因模型突然替换而引发的闪烁与跳变现象,提升了用户在复杂电力场景中观察与交互的沉浸感与稳定性。
Smart Images

Figure CN122929042A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of dynamic model switching technology, and in particular to a method, system, device and medium for dynamic switching of power grid multi-level detail models based on WebGPU. Background Technology
[0002] Current methods for visualizing 3D power grid models on the web typically employ a static, multi-level Level of Detail (LOD) preloading strategy. This relies on client-side local resource caching and fixed distance thresholds to trigger model switching, failing to fully utilize the parallel computing capabilities of modern GPUs. Model data often originates from heterogeneous mapping systems, resulting in inconsistent formats and a lack of standardized preprocessing. This necessitates additional parsing and conversion by the rendering engine, increasing the front-end load. Redundant geometry outside the view frustum is not removed in real-time, leading to a large number of invalid triangular faces continuously participating in rasterization calculations, severely consuming rendering pipeline bandwidth. This is particularly problematic in complex substation scenarios, causing a sharp drop in frame rate and significant response latency.
[0003] Traditional LOD switching mechanisms rely on hard switching, resulting in a lack of smooth transition between old and new model levels, causing visual jumps and flickering, and disrupting scene continuity. Simultaneously, model loading is entirely reactive to changes in the user's perspective, lacking a motion-predictive preloading mechanism. When the camera moves rapidly, high-detail models cannot be positioned in time, resulting in "holes" or "blurriness." Furthermore, the rendering frame rate is decoupled from LOD decisions, making it impossible to dynamically adjust detail density based on real-time performance. This leads to continuous system overload on low-performance devices or resource waste on high-performance devices, making it difficult to achieve adaptive real-time rendering balance. Summary of the Invention
[0004] This application provides a method, system, device, and medium for dynamic switching of multi-level detail (LOD) power grid models based on WebGPU, to solve the problems of traditional LOD switching mechanisms relying on hard switching, lack of smooth transition between old and new level models, completely passive model loading in response to changes in user perspective, and lack of a preloading mechanism based on motion prediction.
[0005] In a first aspect, this application provides a method for dynamic switching of a multi-level-of-detail model of a power grid based on WebGPU, the method comprising: Receive multi-source 3D data corresponding to the model and convert it into 3D data in a preset standardized format; establish several LOD level models according to the acquisition distance of the 3D data corresponding to the model; perform 3D vector slicing on the models of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers. Obtain the current camera frustum, perform frustum culling detection based on WebGPU, and remove models and slices located outside the frustum in the power grid 3D model dataset; Based on the actual distance between the camera and the model, determine the initial LOD level of the model loading; based on the current rendering frame rate and the preset weight factor corresponding to the model, update the LOD level of the model. Based on the camera's movement direction and speed, determine the model loading queue to enter the view frustum, and preload the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue. When a model needs to switch LOD levels, the LOD transition rendering pipeline is enabled, rendering the model at both the old and new LOD levels simultaneously, and the transition is completed within a preset time period through alpha blending.
[0006] In one implementation of this application, multi-source 3D data corresponding to the model is received and converted into 3D data in a preset standardized format; several LOD-level models are established based on the acquisition distance of the 3D data corresponding to the model; 3D vector slices are performed on the models at each LOD level according to a preset spatial grid to generate a power grid 3D model dataset with level identifiers, specifically including: Convert 3D power grid models in GIM, BIM, FBX, and OSGB formats to glTF2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
[0007] In one implementation of this application, the initial LOD level of the model is determined based on the actual distance between the current camera and the model; the LOD level of the model is updated according to the current rendering frame rate and the preset weight factor corresponding to the model, specifically including: Calculate the actual distance between the center of the bounding box of each model and the camera position. Based on the actual distance falling within the range and the preset correspondence between the initial LOD level, determine the initial LOD level of the model loading. The system monitors the current rendering frame rate in real time. When the frame rate is below 25fps, the LOD level of all models is reduced by one level. When the frame rate is above 40fps, the LOD level of the models is increased to the initial LOD level according to the preset increase rule. The LOD level of the model is updated by multiplying the preset weight factor by the current LOD level.
[0008] In one implementation of this application, after determining the initial LOD level of the model based on the actual distance between the current camera and the model, and updating the LOD level of the model according to the current rendering frame rate and the preset weight factor corresponding to the model, the method further includes: The LRU algorithm is used to manage the video memory pool. When the video memory usage exceeds 80%, the preset low LOD level model resources that have not been used for the longest time are unloaded. By utilizing WebGPU's asynchronous data transfer channel, model resources can be uploaded and downloaded during rendering intervals.
[0009] In one implementation of this application, the model loading queue for entering the view frustum is determined based on the camera's movement direction and speed. Resources corresponding to the LOD level of the models in the power grid 3D model dataset are pre-loaded, specifically including: Based on the current view frustum range of the camera, combined with the camera movement direction vector and real-time movement speed, the expansion range of the view frustum per unit time is calculated; all models to be entered within the current view frustum boundary + expansion range area are marked, and the models are sorted according to their distance from the current view frustum boundary to generate an ordered model loading preloading queue.
[0010] Taking the model sorting in the preload queue as input, the determined LOD level of each model is extracted, the storage index of the corresponding level resource in the power grid 3D model dataset is retrieved, and a resource pre-fetching request is generated according to the queue order and sent to the asynchronous computing queue of WebGPU. By leveraging the multi-threaded parallel features of WebGPU, the disk read and decompression of the corresponding layer model resources are completed according to the pre-fetch request without blocking the main rendering pipeline. The decompressed resources are temporarily stored in the video memory reserve area, and can be directly switched and used after the model enters the view frustum.
[0011] In one implementation of this application, when the model needs to switch LOD levels, the LOD transition rendering pipeline is activated, rendering models at both the old and new LOD levels simultaneously. The transition is completed within a preset time period through alpha blending, specifically including: When the LOD level corresponding to the model is updated or when a user interaction triggers a switch LOD level instruction, the LOD transition rendering pipeline is enabled, and the rendering of models at different LOD levels is performed through a unified WebGPU rendering pipeline. The vertex shader performs coordinate transformation and lighting calculations for the model; the fragment shader performs texture sampling, color calculation, and fog effect processing; and the transition shader is enabled to complete the alpha blending transition between the old and new LOD models, eliminating switching flicker.
[0012] Secondly, this application provides a WebGPU-based dynamic switching system for multi-level detail models of power grids, the system comprising: The model preprocessing module is used to receive multi-source 3D data corresponding to the model, convert it into 3D data in a preset standardized format; establish several LOD levels of the model according to the acquisition distance of the 3D data corresponding to the model; and perform 3D vector slicing on the model of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers. The LOD level dynamic calculation module obtains the current camera frustum, performs frustum culling detection based on WebGPU, and removes models and slices located outside the frustum in the power grid 3D model dataset; determines the initial LOD level of the model loading based on the actual distance between the current camera and the model; and updates the LOD level of the model according to the current rendering frame rate and the preset weight factor corresponding to the model. The intelligent resource scheduling module determines the model loading queue to enter the view frustum based on the camera's moving direction and speed, and preloads the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue. The rendering execution module is used to enable the LOD transition rendering pipeline when the model needs to switch LOD levels. It renders the model at both the old and new LOD levels simultaneously and completes the transition within a preset time period through alpha blending.
[0013] In one implementation of this application, the model preprocessing module includes a model preprocessing unit. Used to convert 3D power grid models in GIM, BIM, FBX, and OSGB formats into glTF 2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
[0014] Thirdly, this application provides a WebGPU-based device for dynamically switching multi-level-of-detail models of power grids, the device comprising: processor; And a memory containing executable code, which, when executed, causes the processor to perform a WebGPU-based dynamic switching method for a multi-level-of-details model of a power grid, as described above.
[0015] Fourthly, this application provides a non-volatile computer storage medium storing computer instructions, which, when executed, implement a WebGPU-based dynamic switching method for a power grid multi-level detail model as described above.
[0016] As can be seen from the above technical solutions, this application has the following advantages: By enabling the LOD transition rendering pipeline, both the old and new LOD levels are rendered simultaneously when the model switches levels. Alpha blending technology is used to complete the gradual transition within a preset time period, directly solving the visual discontinuity problem caused by traditional hard switching. This mechanism ensures a continuous and natural visual evolution when the 3D power grid model switches between different detail densities, avoiding flickering and jumps caused by sudden model replacements. This enhances the immersive and stable experience for users observing and interacting in complex power scenarios.
[0017] The model loading queue is dynamically calculated based on the camera's movement direction and speed, and the corresponding LOD level 3D tile resources are preloaded, ensuring that high-detail models are ready before the camera approaches. This mechanism overcomes the limitations of traditional passive responsive loading, ensuring that high-precision models can be rendered in a timely manner in scenes with fast camera movement. This effectively avoids "holes" or "blurriness" caused by loading lag, improving the integrity and clarity of power grid scenes during high-speed browsing.
[0018] The model's LOD level is updated in real time based on the current rendering frame rate and preset weight factors, dynamically matching detail density with system performance. On low-performance devices, the system automatically reduces model complexity to maintain a stable frame rate and avoid continuous overload; on high-performance devices, it increases the detail level to fully utilize rendering capabilities and prevent resource idleness. Attached Figure Description
[0019] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a method for dynamic switching of a multi-level detail model of a power grid based on WebGPU, provided in an embodiment of this application.
[0021] Figure 2 This is a schematic diagram of a model transition process provided in an embodiment of this application.
[0022] Figure 3This is a schematic diagram of the internal structure of a WebGPU-based dynamic switching system for a power grid multi-level detail model, provided in an embodiment of this application.
[0023] Figure 4 This is a schematic diagram of the internal structure of a dynamic switching device for a power grid multi-level detail model based on WebGPU, provided in an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] Those skilled in the art should understand that the embodiments described below are merely preferred embodiments of this disclosure and do not imply that this disclosure can only be implemented through these preferred embodiments. These preferred embodiments are merely used to explain the technical principles of this disclosure and are not intended to limit the scope of protection of this disclosure. Based on the preferred embodiments provided by this disclosure, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this disclosure.
[0026] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0027] The technical solutions proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0028] The embodiment provides a method for dynamic switching of a multi-level-of-detail model of a power grid based on WebGPU, such as... Figure 1 As shown in the embodiments of this application, the method mainly includes the following steps: Step 110: Receive the multi-source 3D data corresponding to the model and convert it into 3D data in a preset standardized format; establish several LOD-level models according to the acquisition distance of the 3D data corresponding to the model; perform 3D vector slicing on the models of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers.
[0029] In some embodiments, multi-source 3D data corresponding to the model is received and converted into 3D data in a preset standardized format; several LOD levels of the model are established according to the acquisition distance of the 3D data corresponding to the model; 3D vector slicing is performed on the model at each LOD level according to a preset spatial grid to generate a power grid 3D model dataset with level identifiers, specifically including: Convert 3D power grid models in GIM, BIM, FBX, and OSGB formats into glTF2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
[0030] It should be noted that the LOD level division is as follows: each model is divided into 4 LOD levels based on the geometric error threshold. LOD0: The highest precision model, with a geometric error of ≤0.1 meters, is used for close-range observation of core equipment; LOD1: High-precision model with geometric error ≤0.5 meters, used for medium-distance observation; LOD2: Medium-precision model with geometric error ≤2 meters, used for long-distance observation; LOD3: Low-precision model with geometric error ≤ 5 meters, used for extremely long-distance observation.
[0031] Using the BasisUniversal texture compression format, texture atlases of different resolutions are generated with a compression ratio of up to 4:1, which greatly reduces the transmission of texture data and the amount of video memory occupied. For preset large-scale oblique photography and point cloud data, 3D vector tiling is performed according to a spatial grid of 100m×100m×50m. Each tiling contains complete LOD level information and supports on-demand loading.
[0032] The preset range can be determined by those skilled in the art based on the actual situation.
[0033] Step 120: Obtain the current camera frustum, perform frustum culling detection based on WebGPU, and remove models and slices located outside the frustum in the power grid 3D model dataset.
[0034] In some embodiments, this step may specifically involve: calculating the six plane parameters of the view frustum from the view matrix and projection matrix of the current camera, including the near clipping plane, far clipping plane, left clipping plane, right clipping plane, upper clipping plane, and lower clipping plane. Each plane corresponds to a standard plane equation and stores the normal vector and intercept parameters. The WebGPU-based computational shader traverses all unloaded slices in the 3D power grid model dataset in parallel. Using the axial bounding box of each slice as the bounding body, it sequentially determines the positional relationship between the bounding box and the six view frustum planes. If the bounding box is completely outside the view frustum of any plane, the corresponding slice is marked as to be culled. Finally, only the slices marked as visible are retained for subsequent rendering processes.
[0035] Step 130: Determine the initial LOD level of the model based on the actual distance between the current camera and the model; update the LOD level of the model according to the current rendering frame rate and the preset weight factor corresponding to the model.
[0036] In some embodiments, the initial LOD level of the model is determined based on the actual distance between the current camera and the model; the LOD level of the model is updated according to the current rendering frame rate and the preset weight factor corresponding to the model, specifically including: Calculate the actual distance between the center of the bounding box of each model and the camera position. Based on the actual distance falling within the range and the preset correspondence between the initial LOD level, determine the initial LOD level of the model loading. The system monitors the current rendering frame rate in real time. When the frame rate is below 25fps, the LOD level of all models is reduced by one level. When the frame rate is above 40fps, the LOD level of the models is increased to the initial LOD level according to the preset increase rule. The LOD level of the model is updated by multiplying the preset weight factor by the current LOD level.
[0037] It should be noted that the weighting factors are preset values in this application. For example, the preset weighting factor for the preset core model is 1.5, and the preset weighting factor for the preset secondary model is 0.8.
[0038] Specifically, 1. Frustum culling: Based on WebGPU's computational shader, frustum culling detection is performed in parallel to remove models and slices that are completely outside the frustum, reducing the number of models that need to be processed; 2. Distance Calculation: Calculate the distance between the center of the bounding box of each visible model and the camera position; 3. Initial LOD Level Determination: Based on the relationship between distance and the distance threshold corresponding to the model type, the initial LOD level of the model is determined. For example, the distance thresholds for transformers are set as follows: <10 meters use LOD0, 10-30 meters use LOD1, 30-100 meters use LOD2, and >100 meters use LOD3; the distance thresholds for ordinary towers are set as follows: <20 meters use LOD1, 20-100 meters use LOD2, and >100 meters use LOD3. 4. Frame rate feedback adjustment: Real-time monitoring of the current rendering frame rate. When the frame rate is below 25fps, the LOD level of all models is automatically reduced by one level; when the frame rate is above 40fps, the LOD level of the models is gradually increased back to the initial level. 5. Importance weighting adjustment: Introduce an importance weighting factor for power grid equipment. Multiply the weight of core equipment (such as transformers and circuit breakers) by 1.5 to increase their LOD level priority; multiply the weight of secondary equipment (such as walls and tower foundations) by 0.8 to decrease their LOD level priority.
[0039] In addition, the methods also include: The LRU algorithm is used to manage the video memory pool. When the video memory usage exceeds 80%, the preset low LOD level model resources that have not been used for the longest time are unloaded. By utilizing WebGPU's asynchronous data transfer channel, model resources can be uploaded and downloaded during rendering intervals.
[0040] It should be further explained that the process involves calculating the geometric center of the bounding box of each visible model, obtaining the camera's current position in the world coordinate system, calculating the actual spatial distance between the geometric center and the camera position using the spatial two-point distance formula, and then comparing the calculated actual distance with a preset distance interval. The initial LOD level of the model is determined based on the interval the distance falls into. The preset distance interval and LOD level have a one-to-one correspondence; the greater the distance, the lower the precision of the LOD level. Simultaneously, the browser's performance interface is used to continuously monitor the current cumulative rendering frames and time consumed each frame, calculating the real-time rendering frame rate. When the frame rate is below 25fps for three consecutive frames, an LOD level downgrade operation is triggered, reducing the current LOD level of all visible models in the scene by one level. When the frame rate is above 40fps for three consecutive frames, an LOD level rollback operation is triggered, restoring the LOD level of all visible models to the initially calculated level according to the preset initial level rules.
[0041] The currently obtained candidate LOD level is multiplied by the model's preset weight factor, and the integer part of the product is taken as the final updated LOD level of the model. To avoid excessive memory usage causing rendering stutters, the Least Recently Used (LRU) algorithm is used to manage the memory pool. After each frame is rendered, the current memory usage is calculated. When the memory usage exceeds a preset threshold of 80%, the model resources of each level stored in the memory pool are traversed to locate the low LOD level model resource that has not been used for the longest time. The corresponding resource is unloaded from the memory pool to release memory space. At the same time, the asynchronous data transmission channel provided by WebGPU is used to schedule the transmission operations of model textures and vertex data to be completed in the gaps of the rendering pipeline, without blocking the normal rendering process of the current frame.
[0042] Step 140: Based on the camera's movement direction and speed, determine the model loading queue to enter the view frustum, and preload the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue.
[0043] In some embodiments, based on the camera's movement direction and speed, a model loading queue for entering the view frustum is determined, and resources corresponding to the LOD level of the models in the model loading queue in the power grid 3D model dataset are preloaded, specifically including: Based on the current view frustum range of the camera, combined with the camera movement direction vector and real-time movement speed, the expansion range of the view frustum per unit time is calculated; all models to be entered within the current view frustum boundary + expansion range area are marked, and the models are sorted according to their distance from the current view frustum boundary to generate an ordered model loading preloading queue.
[0044] Taking the model sorting in the preload queue as input, the determined LOD level of each model is extracted, the storage index of the corresponding level resource in the power grid 3D model dataset is retrieved, and a resource pre-fetching request is generated according to the queue order and sent to the asynchronous computing queue of WebGPU. By leveraging the multi-threaded parallel features of WebGPU, the disk read and decompression of the corresponding layer model resources are completed according to the pre-fetch request without blocking the main rendering pipeline. The decompressed resources are temporarily stored in the video memory reserve area, and can be directly switched and used after the model enters the view frustum.
[0045] It's worth noting that by predicting camera motion trajectories to extend the view frustum boundary, models about to enter the visible area are identified in advance and sorted by distance to generate a pre-loading queue, transforming resource loading from a passive response to an active pre-fetching mechanism. This mechanism ensures that before a model actually enters the view frustum, its corresponding LOD level vertex data and texture resources have been read from disk, decompressed, and temporarily stored in the GPU memory reserve area, avoiding rendering frame delays or stuttering caused by the first load. The pre-loading operation is executed through the WebGPU asynchronous computation queue, without occupying the main rendering thread, maintaining frame rate stability. Resources in the GPU memory reserve area are only bound to the rendering pipeline when the model enters the view frustum; unused pre-loaded resources can be promptly reclaimed by the LRU mechanism, reducing invalid GPU memory usage.
[0046] Step 150: When the model needs to switch LOD levels, enable the LOD transition rendering pipeline and render the model at both the old and new LOD levels simultaneously. The transition is completed within a preset time period through alpha blending.
[0047] In some embodiments, when a model needs to switch LOD levels, the LOD transition rendering pipeline is enabled, rendering models at both the old and new LOD levels simultaneously. The transition is completed within a preset time period through alpha blending, specifically including: When the LOD level corresponding to the model is updated or when a user interaction triggers a switch LOD level instruction, the LOD transition rendering pipeline is enabled, and the rendering of models at different LOD levels is performed through a unified WebGPU rendering pipeline. The vertex shader performs coordinate transformation and lighting calculations for the model; the fragment shader performs texture sampling, color calculation, and fog effect processing; and the transition shader is enabled to complete the alpha blending transition between the old and new LOD models, eliminating switching flicker.
[0048] The rendering process can be specifically described as follows: 1. Vertex shader: Performs coordinate transformation, normal transformation, and lighting calculations for the model; 2. Fragment shader: Performs texture sampling, color calculation, fog effect processing, and shadow calculation; 3. Smooth Rendering Transition: When a model needs to switch LOD levels, the LOD transition rendering pipeline is enabled, rendering both the old and new LOD levels simultaneously. The transition is completed within 200ms via alpha blending, eliminating flickering during the transition. For example... Figure 2 As shown, the transition process is divided into three stages: Phase 1 (0-50ms): The opacity of the old LOD model remains at 100%, while the opacity of the new LOD model increases linearly from 0% to 100%. Phase 2 (50-150ms): The old and new LOD models are displayed simultaneously, both with 100% opacity; Phase 3 (150-200ms): The opacity of the old LOD model decreases linearly from 100% to 0%, while the opacity of the new LOD model remains at 100%. In addition, this application can provide customized LOD strategies for typical power grid scenarios to meet the needs of different business scenarios. The specific strategies are as follows: 1. Substation scenario: Indoor equipment: Improved LOD accuracy, distance threshold increased by 2 times; Main transformer area: Employs the highest precision LOD level to ensure clear equipment details; Walls and external terrain: Reduce LOD accuracy and decrease resource consumption; 2. Distribution network scenario: Backbone routes: Use a higher LOD level to ensure clear route routing; Branching paths: Use lower LOD levels to reduce the number of models; Transformer in the distribution area: Improve LOD accuracy for easier viewing by maintenance personnel; 3. Transmission line scenario: Towers: Use a fixed LOD level to avoid frequent switching; Conductors: The LOD level is dynamically adjusted based on the distance, and simplified to line segments for long distances; Insulators: Detailed models are displayed at close range, while they are merged into the tower model at long range; Custom Interface: Provides an API interface that allows users to customize LOD strategy parameters according to specific business needs, such as distance threshold and importance weight.
[0049] In addition, this application Figure 3 This application provides a WebGPU-based dynamic switching system for power grid multi-level detail models. For example... Figure 3 As shown in the embodiments of this application, the system mainly includes: The model preprocessing module 210 is used to receive multi-source 3D data corresponding to the model, convert it into 3D data in a preset standardized format, establish several LOD level models according to the acquisition distance of the 3D data corresponding to the model, and perform 3D vector slicing on the models of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers.
[0050] Model preprocessing module 210 includes a model preprocessing unit. Used to convert 3D power grid models in GIM, BIM, FBX, and OSGB formats into glTF2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
[0051] The LOD level dynamic calculation module 220 obtains the current camera frustum, performs frustum culling detection based on WebGPU, and removes models and slices located outside the frustum in the power grid 3D model dataset; determines the initial LOD level of the model loading based on the actual distance between the current camera and the model; and updates the LOD level of the model according to the current rendering frame rate and the preset weight factor corresponding to the model.
[0052] The resource intelligent scheduling module 230 determines the model loading queue to enter the view frustum based on the camera's moving direction and speed, and preloads the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue.
[0053] The rendering execution module 240 is used to enable the LOD transition rendering pipeline when the model needs to switch LOD levels, and render the model at both the old and new LOD levels at the same time, and complete the transition within a preset time period through alpha blending.
[0054] The above are method embodiments of this application. Based on the same inventive concept, this application also provides a WebGPU-based dynamic switching device for power grid multi-level detail models. Figure 4 As shown, the device includes: a processor; and a memory storing executable code thereon, which, when executed, causes the processor to perform a WebGPU-based dynamic switching method for a power grid multi-level detail model as described in the above embodiment. Specifically, the server receives multi-source 3D data corresponding to the model and converts it into 3D data in a preset standardized format; based on the acquisition distance of the 3D data corresponding to the model, it establishes several LOD levels of the model; it performs 3D vector slicing on the model of each LOD level according to a preset spatial grid, generating a power grid 3D model dataset with level identifiers; it acquires the current camera's view frustum and performs view frustum culling detection based on WebGPU to remove models and slices located outside the view frustum in the power grid 3D model dataset; it determines the initial LOD level for model loading based on the actual distance between the current camera and the model; it updates the LOD level corresponding to the model according to the current rendering frame rate and the preset weight factor corresponding to the model; it determines the model loading queue to enter the view frustum based on the camera's movement direction and speed, and preloads the resources of the LOD level corresponding to the model in the power grid 3D model dataset in the model loading queue; when the model needs to switch LOD levels, it enables the LOD transition rendering pipeline, rendering the model of both the old and new LOD levels simultaneously, and completing the transition within a preset time period through alpha blending.
[0055] In addition, embodiments of this application also provide a non-volatile computer storage medium storing executable instructions, which, when executed, implement the above-described method for dynamic switching of a power grid multi-level detail model based on WebGPU.
[0056] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for dynamic switching of multi-level-of-detail models of power grids based on WebGPU, characterized in that, The method includes: Receive multi-source 3D data corresponding to the model and convert it into 3D data in a preset standardized format; establish several LOD level models according to the acquisition distance of the 3D data corresponding to the model; perform 3D vector slicing on the models of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers. Obtain the current camera frustum, perform frustum culling detection based on WebGPU, and remove models and slices located outside the frustum in the power grid 3D model dataset; Based on the actual distance between the camera and the model, determine the initial LOD level of the model loading; based on the current rendering frame rate and the preset weight factor corresponding to the model, update the LOD level of the model. Based on the camera's movement direction and speed, determine the model loading queue to enter the view frustum, and preload the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue. When a model needs to switch LOD levels, the LOD transition rendering pipeline is enabled, rendering the model at both the old and new LOD levels simultaneously, and the transition is completed within a preset time period through alpha blending.
2. The method for dynamic switching of multi-level detail models of power grids based on WebGPU according to claim 1, characterized in that, Receive multi-source 3D data corresponding to the model and convert it into 3D data in a preset standardized format; establish several LOD-level models based on the acquisition distance of the 3D data corresponding to the model. The model at each LOD level is 3D vector-sliced according to a preset spatial grid to generate a 3D power grid model dataset with level identifiers, specifically including: Convert 3D power grid models in GIM, BIM, FBX, and OSGB formats to glTF 2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
3. The method for dynamic switching of multi-level detail models of power grids based on WebGPU according to claim 1, characterized in that, Determine the initial LOD level for model loading based on the actual distance between the current camera and the model; Based on the current rendering frame rate and the preset weight factor corresponding to the model, update the LOD level of the model, specifically including: Calculate the actual distance between the center of the bounding box of each model and the camera position. Based on the actual distance falling within the range and the preset correspondence between the initial LOD level, determine the initial LOD level of the model loading. The system monitors the current rendering frame rate in real time. When the frame rate is below 25fps, the LOD level of all models is reduced by one level. When the frame rate is above 40fps, the LOD level of the models is increased to the initial LOD level according to the preset increase rule. The LOD level of the model is updated by multiplying the preset weight factor by the current LOD level.
4. The method for dynamic switching of multi-level-of-detail models of power grids based on WebGPU according to claim 1, characterized in that, The initial LOD level for model loading is determined based on the actual distance between the current camera and the model. After updating the LOD level of the model based on the current rendering frame rate and the preset weight factor corresponding to the model, the method further includes: The LRU algorithm is used to manage the video memory pool. When the video memory usage exceeds 80%, the preset low LOD level model resources that have not been used for the longest time are unloaded. By utilizing WebGPU's asynchronous data transfer channel, model resources can be uploaded and downloaded during rendering intervals.
5. The method for dynamic switching of multi-level detail models of power grids based on WebGPU according to claim 1, characterized in that, Based on the camera's movement direction and speed, the model loading queue for entering the view frustum is determined. Resources corresponding to the LOD level of the models in the power grid 3D model dataset are preloaded, specifically including: Based on the current view frustum range of the camera, combined with the camera movement direction vector and real-time movement speed, the expansion range of the view frustum per unit time is calculated; all models to be entered that are within the current view frustum boundary + expansion range area are marked, and the models are sorted according to their distance from the current view frustum boundary to generate an ordered model loading preloading queue. Taking the model sorting in the preload queue as input, the determined LOD level of each model is extracted, the storage index of the corresponding level resource in the power grid 3D model dataset is retrieved, and a resource pre-fetching request is generated according to the queue order and sent to the asynchronous computing queue of WebGPU. By leveraging the multi-threaded parallel features of WebGPU, the disk read and decompression of the corresponding layer model resources are completed according to the pre-fetch request without blocking the main rendering pipeline. The decompressed resources are temporarily stored in the video memory reserve area, and can be directly switched and used after the model enters the view frustum.
6. The method for dynamic switching of power grid multi-level detail models based on WebGPU according to claim 1, characterized in that, When a model needs to switch LOD levels, the LOD transition rendering pipeline is activated, rendering both the old and new LOD levels simultaneously. The transition is completed within a preset time period through alpha blending, specifically including: When the LOD level corresponding to the model is updated or when a user interaction triggers a switch LOD level instruction, the LOD transition rendering pipeline is enabled, and the rendering of models at different LOD levels is performed through a unified WebGPU rendering pipeline. The vertex shader performs coordinate transformation and lighting calculations for the model; the fragment shader performs texture sampling, color calculation, and fog effect processing; and the transition shader is enabled to complete the alpha blending transition between the old and new LOD models, eliminating switching flicker.
7. A dynamic switching system for multi-level detail models of power grids based on WebGPU, characterized in that, The system includes: The model preprocessing module is used to receive multi-source 3D data corresponding to the model, convert it into 3D data in a preset standardized format; establish several LOD levels of the model according to the acquisition distance of the 3D data corresponding to the model; and perform 3D vector slicing on the model of each LOD level according to the preset spatial grid to generate a power grid 3D model dataset with level identifiers. The LOD level dynamic calculation module obtains the current camera frustum, performs frustum culling detection based on WebGPU, and removes models and slices located outside the frustum in the power grid 3D model dataset; determines the initial LOD level of the model loading based on the actual distance between the current camera and the model; and updates the LOD level of the model according to the current rendering frame rate and the preset weight factor corresponding to the model. The intelligent resource scheduling module determines the model loading queue to enter the view frustum based on the camera's moving direction and speed, and preloads the resources in the power grid 3D model dataset corresponding to the LOD level of the model in the model loading queue. The rendering execution module is used to enable the LOD transition rendering pipeline when the model needs to switch LOD levels. It renders the model at both the old and new LOD levels simultaneously and completes the transition within a preset time period through alpha blending.
8. The WebGPU-based dynamic switching system for power grid multi-level detail models according to claim 7, characterized in that, The model preprocessing module includes a model preprocessing unit. Used to convert 3D power grid models in GIM, BIM, FBX, and OSGB formats into glTF2.0 format, which supports WebGPU loading; Based on 3D data in a pre-defined standardized format, duplicate vertices are merged and 3D data corresponding to redundant faces are deleted. Each power grid model is divided into several LOD levels according to the acquisition distance; The model texture is subjected to general texture compression to generate texture atlases with preset resolutions corresponding to different LOD levels; the preset large-scale oblique photography and point cloud data are 3D vector sliced according to the spatial grid to generate a power grid 3D model dataset with hierarchical labels; each slice contains complete LOD level information.
9. A WebGPU-based device for dynamically switching multi-level-of-detail models of power grids, characterized in that, The device includes: processor; And a memory storing executable code, which, when executed, causes the processor to perform a WebGPU-based dynamic switching method for a power grid multi-level detail model as described in any one of claims 1-6.
10. A non-volatile computer storage medium, characterized in that, It stores computer instructions, which, when executed, implement a method for dynamic switching of a multi-level detail model of a power grid based on a WebGPU, as described in any one of claims 1-6.