A LOD processing method for urban digital twin scenes

By dynamically adjusting the geometric error and screen space error of the LOD level in the urban digital twin scene, and determining the target level and tile data based on the hardware load parameters, the problem of large rendering burden of complex data LOD level is solved, and efficient and accurate rendering effect is achieved.

CN119228975BActive Publication Date: 2025-04-11SHENZHEN EMAP INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411767254.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

In urban digital twin scenarios, the LOD level loading complex data is burdened with heavy loading during rendering, and cannot automatically degrade LOD, resulting in difficult to balance rendering quality and performance.

Method used

After triggering the detection task, the initial geometric error of the initial tile data of the current model is obtained, and dynamically adjusts according to the hardware load parameters, the target geometric error and screen space error are obtained, the target level and tile data are determined, and the target model is rendered to obtain the target model.

Benefits of technology

It realizes the maintenance of appropriate rendering accuracy under different hardware resources, improves rendering efficiency and accuracy, avoids excessive idleness or overload of hardware resources, and finds the best balance point between visual effects and rendering performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228975B_ABST
    Figure CN119228975B_ABST
Patent Text Reader

Abstract

The present application discloses a method for processing LOD of a city digital twin scene, and relates to the field of data processing technology. The method comprises: after triggering a detection task, obtaining an initial geometric error of initial tile data in a current model; updating the initial geometric error according to a load parameter of the hardware to obtain a target geometric error; obtaining a first screen space error according to the target geometric error, comparing the first screen space error with a preset screen space error threshold, and determining the target screen space error according to the comparison result; determining a target level according to the target screen space error, and target tile data corresponding to the target level, and rendering the current model according to the target tile data to obtain a target model. The present application can improve the rendering quality of a level of detail model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method for LOD processing of urban digital twin scenes. Background Art

[0002] The Level of Detail (LOD) model is fundamental to urban digital twin scenarios. It dynamically adjusts the model's level of detail based on factors such as the distance and importance of the object to achieve a balance between performance optimization and visual quality. When LOD adjustment is performed based on distance, the model's level of detail is dynamically adjusted based on the distance from the camera (or observer) to the object. When the object is farther from the camera, a lower-detail model is used; when the object is closer, a higher-detail model is used. When LOD adjustment is performed based on importance, the model's level of detail is dynamically adjusted based on the object's importance in the scene. A higher-detail model is used for important objects, and a lower-detail model is used for unimportant objects.

[0003] Adjusting LOD levels based on factors like object distance and importance is typically done to reduce complexity and data size while preserving essential model information, enabling smoother display and application across various devices and platforms. However, both of the aforementioned adjustment methods fail to automatically downgrade LOD levels when the rendering load is heavy at LOD levels with complex data.

[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of this application is to provide a LOD processing method for urban digital twin scenes, aiming to solve the technical problem of how to improve the rendering quality of detail level models.

[0006] To achieve the above objectives, this application proposes a method for LOD processing of urban digital twin scenes, which includes:

[0007] After the detection task is triggered, the initial geometric error of the initial tile data in the current model is obtained;

[0008] Updating the initial geometric error according to the load parameters of the hardware to obtain a target geometric error;

[0009] obtaining a first screen space error according to the target geometric error, and determining a target screen space error according to a comparison result of the first screen space error and a preset screen space error threshold;

[0010] Determining a target level according to the target screen space error, and obtaining target tile data corresponding to the target level;

[0011] The current model is rendered according to the target tile data to obtain a target model.

[0012] In one embodiment, the load parameters are the load values ​​of the central processing unit and the graphics processing unit, and the step of updating the initial geometric error according to the hardware load parameters to obtain the target geometric error includes:

[0013] Obtaining and comparing the load value of the central processing unit and the load value of the graphics processing unit, and determining a maximum load value according to the comparison result;

[0014] Determining an adjustment coefficient based on the maximum load value; wherein, when the maximum load value is greater than or equal to a preset first load value, the adjustment coefficient is negatively correlated with the maximum load value; and when the maximum load value is less than a preset second load value, the adjustment coefficient is positively correlated with the maximum load value;

[0015] The target geometric error is determined according to the maximum load value, the adjustment coefficient, and the initial geometric error.

[0016] In one embodiment, the steps of obtaining a first screen space error according to the target geometric error, comparing the first screen space error with a preset screen space error threshold, and determining a target screen space error according to the comparison result include:

[0017] Calculating according to the target geometric error to obtain the first screen space error;

[0018] If the first screen space error is less than or equal to the screen space error threshold, the first screen space error is determined to be the target screen space error.

[0019] In one embodiment, after the step of comparing the first screen space error with the screen space error threshold, the method further includes:

[0020] If the first screen space error is greater than the screen space error threshold, updating the target geometric error to obtain a second target geometric error;

[0021] Recalculation is performed according to the second target geometric error until the first screen space error is less than or equal to the screen space error threshold, thereby obtaining the target screen space error.

[0022] In one embodiment, before the step of obtaining the initial geometric error of the initial tile data in the current model after the detection task is triggered, the following steps are included:

[0023] Split the BIM model to be split according to the octree index to obtain the target sub-model;

[0024] Simplifying each of the target sub-models according to a preset simplification rate to obtain tile data corresponding to different levels;

[0025] The tile data is stored to obtain a tile set.

[0026] In one embodiment, the step of splitting the BIM model to be split according to the octree index to obtain the target sub-model includes:

[0027] Determine the bounding box of each component in the BIM model to be split;

[0028] Determine the segmentation distance according to the side length and area of ​​the bounding box;

[0029] Splitting the to-be-split BIM model according to the octree index;

[0030] When the side length of the sub-model obtained by splitting is less than or equal to the preset splitting distance, the splitting is stopped to obtain the target sub-model.

[0031] In one embodiment, the method further comprises:

[0032] Determine whether there is a locked sub-model in the current model;

[0033] If so, a preset geometric error of the locked sub-model is obtained, and the preset geometric error is confirmed as the target geometric error.

[0034] In one embodiment, after the detection task is triggered, the step of obtaining the initial geometric error of the initial tile data in the current model includes:

[0035] When a preset time period is reached, triggering the detection task;

[0036] An index file of the tile data is obtained, and the initial geometric error is obtained from the index file.

[0037] In one embodiment, the step of rendering the current model according to the target tile data to obtain the target model includes:

[0038] Determine a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error, and the target geometric error;

[0039] The current model is rendered frame by frame according to the first geometric error and the target tile data to obtain the target model.

[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a city digital twin scene LOD processing device, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor, and the computer program is configured to implement the steps of the city digital twin scene LOD processing method as described above.

[0041] The present application provides a method for LOD processing of urban digital twin scenes. After triggering the detection task, the initial geometric error of the initial tile data in the current model and the load condition of the current hardware are obtained. The initial geometric error is updated according to the load parameters of the hardware, and the geometric error can be dynamically adjusted according to the real-time load condition of the hardware to ensure that the model can maintain appropriate rendering accuracy under different hardware resources. According to the target geometric error, after obtaining the initial screen space error, the initial screen space error is compared with the preset threshold. If the calculated screen space error is less than or equal to the threshold, it is considered that the accuracy of the current model meets the requirements and there is no need to load a higher-precision LOD level; if the screen space error is greater than the threshold, it is necessary to load a higher-precision LOD level and recalculate the screen space error until the calculated screen space error is less than or equal to the threshold. After determining the target screen space error, the corresponding target level and target tile data are determined, and the target tile data is superimposed on the current model to obtain the target model.

[0042] In this application, since the initial geometric error is dynamically adjusted in real time according to the load parameters of the hardware, it is possible to increase the fineness of the model when hardware resources are sufficient; when resources are tight, the accuracy is appropriately reduced to maintain a smooth rendering speed. At the same time, excessive idleness or overload of hardware resources is avoided, thereby improving the overall resource utilization. The determination of the target screen space error helps to find the best balance between visual effects and rendering performance, ensuring both the clarity of the model and the smoothness of rendering. The tile data of the required level is selected according to the target screen space error, avoiding redundancy or missing data, thereby improving rendering efficiency and accuracy. Rendering based on the target tile data set can ensure that the model is rendered at the highest efficiency when the hardware resources permit. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0045] Figure 1 A flowchart of the first embodiment of the LOD processing method for the urban digital twin scene of this application is provided;

[0046] Figure 2 A detailed flow chart of Example 1 of the urban digital twin scene LOD processing method provided in this application;

[0047] Figure 3 A flow chart of the second embodiment of the LOD processing method for the urban digital twin scene of this application;

[0048] Figure 4 A flowchart of the third embodiment of the LOD processing method for the urban digital twin scene of this application is provided;

[0049] Figure 5 A flowchart of the fourth embodiment of the LOD processing method for the urban digital twin scene of this application is provided;

[0050] Figure 6 A byte flow diagram of the fourth embodiment of the LOD processing method for the urban digital twin scene of this application;

[0051] Figure 7 This is a schematic diagram of the device structure of the hardware operating environment involved in the urban digital twin scene LOD processing method in the embodiment of this application. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.

[0053] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0054] The main solution of the embodiment of the present application is: after triggering the detection task, obtain the initial geometric error of the initial tile data in the current model; update the initial geometric error according to the load parameters of the hardware to obtain the target geometric error; obtain the first screen space error according to the target geometric error, and determine the target screen space error based on the comparison result of the first screen space error and a preset screen space error threshold; determine the target level according to the target screen space error, and obtain the target tile data corresponding to the target level; render the current model according to the target tile data to obtain the target model.

[0055] The Level of Detail (LOD) model is fundamental to urban digital twin scenarios. It dynamically adjusts the model's level of detail based on factors such as the distance and importance of the object to achieve a balance between performance optimization and visual quality. When LOD adjustment is performed based on distance, the model's level of detail is dynamically adjusted based on the distance from the camera (or observer) to the object. When the object is farther from the camera, a lower-detail model is used; when the object is closer, a higher-detail model is used. When LOD adjustment is performed based on importance, the model's level of detail is dynamically adjusted based on the object's importance in the scene. A higher-detail model is used for important objects, and a lower-detail model is used for unimportant objects.

[0056] Adjusting LOD levels based on factors like object distance and importance is typically done to reduce complexity and data size while preserving essential model information, enabling smoother display and application across various devices and platforms. However, both of the aforementioned adjustment methods fail to automatically downgrade LOD levels when the rendering load is heavy at LOD levels with complex data.

[0057] The present application provides a method for LOD processing of urban digital twin scenes. After triggering the detection task, the initial geometric error of the initial tile data in the current model and the load condition of the current hardware are obtained. The initial geometric error is updated according to the load parameters of the hardware, and the geometric error can be dynamically adjusted according to the real-time load condition of the hardware to ensure that the model can maintain appropriate rendering accuracy under different hardware resources. According to the target geometric error, after obtaining the initial screen space error, the initial screen space error is compared with the preset threshold. If the calculated screen space error is less than or equal to the threshold, it is considered that the accuracy of the current model meets the requirements and there is no need to load a higher-precision LOD level; if the screen space error is greater than the threshold, it is necessary to load a higher-precision LOD level and recalculate the screen space error until the calculated screen space error is less than or equal to the threshold. After determining the target screen space error, the corresponding target level and target tile data are determined, and the target tile data is superimposed on the current model to obtain the target model.

[0058] In this application, since the initial geometric error is dynamically adjusted in real time according to the load parameters of the hardware, it is possible to increase the fineness of the model when hardware resources are sufficient; when resources are tight, the accuracy is appropriately reduced to maintain a smooth rendering speed. At the same time, excessive idleness or overload of hardware resources is avoided, thereby improving the overall resource utilization. The determination of the target screen space error helps to find the best balance between visual effects and rendering performance, ensuring both the clarity of the model and the smoothness of rendering. The tile data of the required level is selected according to the target screen space error, avoiding redundancy or missing data, thereby improving rendering efficiency and accuracy. Rendering based on the target tile data set can ensure that the model is rendered at the highest efficiency when the hardware resources permit.

[0059] It should be noted that the execution subject of this embodiment can be a computing service device with network communication and program execution capabilities, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device or device capable of implementing the above functions. The following uses the LOD processing device for urban digital twin scenarios as an example to illustrate this embodiment and the following embodiments.

[0060] Based on this, the embodiment of the present application provides a method for processing LOD of a city digital twin scene, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the urban digital twin scene LOD processing method of this application.

[0061] In this embodiment, the city digital twin scene LOD processing method includes steps S100 to S500:

[0062] Step S100: After the detection task is triggered, the initial geometric error of the initial tile data in the current model is obtained.

[0063] It should be noted that tile data refers to the process of dividing a large dataset or image into a series of smaller, more manageable and processable units (i.e., "tiles"). Each tile typically contains a subset of the dataset or an area of ​​the image, and these tiles can be loaded and rendered on demand.

[0064] In addition, it is important to note that in LOD (Level of Detail) technology, geometric error (GE) is used to describe the degree of approximation between the computer-rendered approximate geometric model and the ideal mathematical model. Geometric error reflects the deviation or error in the model's geometric shape between different LOD levels in a multi-level detail representation.

[0065] In this embodiment, tile data refers to 3D Tiles data (three-dimensional tiles). After a detection task is triggered, the 3D Tiles data is loaded via a loader. A timer or timer can be used to periodically check whether the current time has reached a predetermined execution time or a preset time period has passed. If the current time has reached the predetermined time or the preset time period, the corresponding task is automatically executed. A detection task can also be triggered by a user clicking a button or entering a command.

[0066] Please refer to Figure 2 In a feasible implementation manner, step S100 may further include the following steps S110 to S120:

[0067] Step S110: When a preset time period is reached, the detection task is triggered.

[0068] In this embodiment, a timer is used to detect whether a preset time period has been reached. A timer is an important component of a computer system that can periodically send signals or interrupts so that the operating system or other application can execute certain tasks within a specified time interval. In a scheduled task, the operating system or application will use a timer or timer to periodically check whether the current time has reached the preset time period. If the current time has reached the preset time period, the detection task will be automatically executed.

[0069] In this implementation, a timer instance is created in advance and its trigger period (e.g., every minute, every hour, etc.) is configured. A detection task is defined and the defined detection task function or method is registered with the timer's callback. When the timer triggers, it automatically calls this callback to execute the detection task.

[0070] Step S120: Obtain an index file of the tile data, and obtain the initial geometric error from the index file.

[0071] In this implementation, the entry file tileset.json of 3DTiles is loaded through Cesium (a JavaScript library for creating 3D globes and maps). The tileset.json contains the metadata and structural information of the entire tile set (Tileset), including: asset, which contains the metadata of the tile set, such as version, generation tool, etc. geometricError: The geometric error of the root tile of the tile set, which indicates the degree of approximation between the tile and the ideal mathematical model. tiles: An array of tile sets, each element of which is a description of a tile, including its geometric error, references to sub-tiles, etc. The tileset.json file is parsed by Cesium, and its contents are read to obtain the initial geometric error of the tiles corresponding to the current hierarchical model.

[0072] In this embodiment, the acquisition of the initial geometric error provides an evaluation basis for subsequent hardware resource utilization. By understanding the initial accuracy of the model, it can be determined whether the model needs to be further refined or simplified to match the current hardware resources.

[0073] Step S200 : updating the initial geometric error according to the hardware load parameter to obtain a target geometric error.

[0074] It should be noted that initial geometric error refers to the preset, unadjusted geometric accuracy error in computer graphics rendering or 3D scene processing. This error value is typically set based on the ideal state of system performance. Target geometric error refers to the geometric accuracy error that is dynamically adjusted based on the current hardware load parameters. This error value reflects the geometric accuracy level that the system accepts under a given hardware load.

[0075] In this embodiment, after the detection task is triggered, the hardware load parameters are obtained. The hardware load parameters include CPU (Central Processing Unit) usage, GPU (Graphics Processing Unit) usage, memory usage, etc. CPU usage indicates the proportion of CPU resources occupied. High usage means that the CPU is processing a large number of tasks, which may cause the system to respond slowly. GPU usage reflects the load of the GPU. High usage usually means that the graphics rendering task is heavy, which may affect the smoothness and rendering quality of the picture. Memory usage: including memory usage, remaining amount and swap space usage. These parameters can reflect the tension of the system memory. Based on these hardware load parameters, the system will dynamically adjust the initial geometric error according to the hardware load parameters obtained in real time. The adjusted geometric error is called the target geometric error, which reflects the level of geometric accuracy accepted by the system under a given hardware load.

[0076] In this embodiment, the initial geometric error can be dynamically adjusted based on the load threshold. A series of hardware load thresholds are pre-set, and when it is detected that the load of a certain hardware exceeds or falls below these thresholds, the corresponding adjustment action is triggered. The initial geometric error can also be dynamically adjusted based on the error tolerance. When the hardware load is high, in order to reduce the rendering burden, the system may increase the tolerance for geometric error, that is, increase the target geometric error, to reduce rendering details, thereby reducing the use of hardware resources. When the hardware load is low, the tolerance for geometric error is reduced, that is, the target geometric error is reduced to improve the rendering quality and make the picture more detailed.

[0077] In this embodiment, the initial geometric error is updated based on the hardware load parameters to obtain the target geometric error. Dynamically adjusting the geometric error based on the real-time hardware load ensures that the model maintains appropriate rendering accuracy under varying hardware resources. When hardware resources are sufficient, the model's precision can be increased; when resources are limited, the accuracy is appropriately reduced to maintain a smooth rendering speed. This dynamic adjustment prevents excessive idleness or overload of hardware resources, thereby improving overall resource utilization.

[0078] Step S300 : obtaining a first screen space error according to the target geometric error, and determining a target screen space error according to a comparison result between the first screen space error and a preset screen space error threshold.

[0079] It's important to note that Screen Space Error (SSE) measures the difference in pixel count between a model displayed on screen and its original model. Screen space error is the final manifestation of geometric error on the screen after processing by the 3D rendering pipeline. By calculating the relationship between geometric error and screen space error, the system can dynamically adjust the Level of Rendering (LOD) level to ensure that the model maintains appropriate visual quality and rendering performance at different viewing angles.

[0080] In this embodiment, the calculated screen-space error is compared with a preset screen-space error based on the target geometric error, distance, and camera angle. If the screen-space error is greater than the preset screen-space error, a tile with a higher level of detail is loaded. If the screen-space error is less than or equal to the preset screen-space error, the first calculated screen-space error is used as the target screen-space error. Through these steps, the tile level of detail can be dynamically adjusted to improve performance while maintaining rendering quality.

[0081] In this embodiment, determining the target screen space error helps to find the best balance between visual effects and rendering performance, which ensures both the clarity of the model and the smoothness of the rendering.

[0082] Step S400 : determining a target level according to the target screen space error, and acquiring target tile data corresponding to the target level.

[0083] Step S500: Render the current model according to the target tile data to obtain a target model.

[0084] It should be noted that LOD (Level of Detail) is a technology widely used in 3D computer graphics. It aims to optimize rendering performance by loading model data of different precisions at different distances or viewing angles. LOD technology reduces the rendering burden by reducing the details of distant or less important objects, while maintaining the details of nearby or important objects, thereby achieving a balance between visual effects and rendering performance. The original high-precision model is divided into multiple LOD levels of different precision. Each level contains a simplified version of the model, where the lower-level models have less details and lower geometric complexity. The appropriate LOD level is dynamically selected for rendering based on the observer's perspective, distance, and other factors.

[0085] In this implementation, after determining the target screen space error, the corresponding LOD level is determined. Based on the determined LOD level, the corresponding model data is requested and loaded, and then rendered and displayed on the front end. During the rendering process, hardware load and rendering quality are continuously monitored. Based on the monitoring results, the ScreenSpaceError value is dynamically adjusted to achieve the optimal balance between performance and quality.

[0086] In this embodiment, the target level is determined based on the calculated target screen space error and compared with the predefined LOD level threshold. The higher the LOD level, the richer the details of the model, but the greater the computational burden; the lower the LOD level, the simpler the details of the model and the smaller the computational burden. The predefined LOD level threshold is a set of values, each corresponding to an LOD level. The calculated target screen space error is compared with these thresholds to find the threshold that is closest to and not greater than the target screen space error. The LOD level corresponding to this threshold is the target level.

[0087] In a feasible implementation, step S500 may include the following steps:

[0088] Determine a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error, and the target geometric error;

[0089] The current model is rendered frame by frame according to the first geometric error and the target tile data to obtain the target model.

[0090] In this implementation, a smooth transition is used to avoid sudden changes in the target geometric error, which can cause flickering or freezing. During the rendering process, each part of the model is rendered based on the first geometric error value and the target tile data of the current frame. As the frame progresses, the model's geometry gradually approaches the target shape while maintaining the consistency of visual details such as texture and color. For example, through methods such as linear interpolation or exponential smoothing, the target geometric error gradually reaches the new set value over a period of time.

[0091] In this implementation, adjustment is performed using an exponential smoothing method. First, the initial geometric error value error_start, the target geometric error value error_end, and the smoothing coefficient alpha are determined (in the range [0, 1]; the closer to 1, the faster the smoothing transition; the closer to 0, the slower the smoothing transition). Next, the smoothing value is calculated for each frame. The initial geometric error value current_error = error_start. For each frame, a new error value is calculated: current_error = alpha * error_end + (1 - alpha) * current_error. The new current_error is used to update the geometric error for the current frame. Finally, the above calculation is repeated for each frame until the error value is sufficiently close to error_end.

[0092] Optionally, adjustments can also be made based on linear interpolation. First, determine the initial geometric error value error_start, the target geometric error value error_end, and the transition time transition_time. Second, calculate the interpolation value for each frame. Record the current time current_time and the start time start_time, and the elapsed time elapsed_time = current_time - start_time. The interpolation factor t = elapsed_time / transition_time (the range of t should be between [0, 1], and the boundary value will be taken when it exceeds). The current error value current_error = error_start + t* (error_end - error_start). Use current_error to update the geometric error of the current frame. Finally, repeat the above calculation for each frame until elapsed_time exceeds or equals transition_time.

[0093] In one feasible implementation, in order to lock the rendering clarity of specific models (such as buildings) in a 3D map or scene, the maximum geometric error (MaxGeometryError) used by some models to be rendered can be locked so that they always maintain the clarity set by the user. Determine which buildings or models need to have their rendering clarity locked. Identify the building or model to be locked by the model's ID, name, or other unique identifier. When determining the LOD for a model, check whether the model is in a list containing the IDs of locked models. If the model is locked, obtain the maximum geometric error set by the user for the model and determine the LOD level based on the maximum geometric error.

[0094] In this embodiment, the target screen space error is used to precisely select the tile data for the required level, avoiding redundant or missing data and thus improving rendering efficiency and accuracy. Rendering based on the target tile data ensures that the model is rendered at the highest efficiency possible, given the available hardware resources. By optimizing the rendering process, users can be assured of a clear and smooth model experience, thereby enhancing the user experience.

[0095] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 , the load parameters are the load values ​​of the central processing unit and the graphics processing unit, and step S200 may include steps S210 to S230:

[0096] Step S210, obtaining and comparing the load value of the central processing unit and the load value of the graphics processing unit, and determining a maximum load value according to the comparison result;

[0097] Step S220: determining an adjustment coefficient based on the maximum load value; wherein, when the maximum load value is greater than or equal to a preset first load value, the adjustment coefficient is negatively correlated with the maximum load value; and when the maximum load value is less than a preset second load value, the adjustment coefficient is positively correlated with the maximum load value;

[0098] Step S230: determining the target geometric error according to the maximum load value, the adjustment coefficient, and the initial geometric error.

[0099] In this embodiment, whether to adjust the initial geometric error and how to adjust it are comprehensively determined based on the CPU and GPU load values. After loading the tile data into the rendering engine, a negative feedback adjustment mechanism for LOD is introduced during the rendering process. During the preparatory stage of frame rendering, the CPU and GPU load values ​​are obtained, with the maximum load value burden = max(CPU_occupied, GPU_occupied).

[0100] In this embodiment, an adjustment coefficient is determined based on the maximum load value. When the maximum load value is greater than or equal to a preset first load value (e.g., 90%), the adjustment coefficient is negatively correlated with the maximum load value, reducing the initial geometric error. The initial geometric error is updated according to a first update formula to obtain a target geometric error. When the maximum load value is less than a preset second load value (e.g., 50%), the adjustment coefficient is positively correlated with the maximum load value, increasing the initial geometric error. A more refined LOD model is used to enhance the display quality and avoid wasting computing resources. The initial geometric error is updated based on the maximum load value and the adjustment coefficient. The update formula is: initial geometric error * (1.1 + maximum load value burden * adjustment coefficient).

[0101] For example, when the maximum load value is greater than or equal to the preset first load value, the adjustment coefficient can be -1, and the update formula at this time is: initial geometric error * (1.1 - maximum load value burden). When the maximum load value is less than the preset second load value, the adjustment coefficient is 0.5.

[0102] The update formula at this time is: initial geometric error * (1.1 + maximum load value burden * 0.5).

[0103] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 4 , step S300 includes steps S310 to S320:

[0104] Step S310, performing calculation according to the target geometric error to obtain the first screen space error;

[0105] In this embodiment, the calculation formula is: ;

[0106] Among them, SSE is the screen space error, geometricError is the target set error, drawingBufferHeight is the actual height of the current drawing buffer, distance refers to the closest distance between the tile's bounding volume and the camera, and fovy is the camera's tilt angle in the vertical direction.

[0107] In this implementation, drawingBufferHeight is obtained by querying the drawing context's properties. For example, in WebGL, the WebGLRenderingContext.drawingBufferHeight property is used to obtain the actual height of the current drawing buffer. Fovy is determined during camera setup or initialization. In a 3D rendering engine, the camera's fovy property can be set or queried directly. The distance between the camera and object positions is obtained by calculating the Euclidean distance between them.

[0108] Step S320: If the first screen space error is less than or equal to the screen space error threshold, confirming the first screen space error as the target screen space error.

[0109] In this embodiment, the calculated first screen space error is compared with a preset screen space error threshold. If the first screen space error is less than or equal to the preset screen space error threshold, the required accuracy is met and there is no need to load higher resolution tiles. The first screen space error is directly used as the target screen space error, and the LOD level corresponding to the target screen space error is determined. The current model is rendered based on the target tile data corresponding to the LOD level.

[0110] In a feasible implementation manner, step S320 may further include steps S330 to S340:

[0111] Step S330: if the first screen space error is greater than the screen space error threshold, then the target geometric error is updated to obtain a second target geometric error;

[0112] Step S340 : recalculating according to the second target geometric error until the first screen space error is less than or equal to the screen space error threshold, thereby obtaining the target screen space error.

[0113] In this embodiment, the calculated first screen space error is compared with a preset screen space error threshold. If the first screen space error is greater than the preset screen space error threshold, the relevant parameters of the sub-tiles with deeper layers and higher precision and the camera are read and calculated again until the calculated screen space error is less than or equal to the preset screen space error threshold. The calculation is terminated and the corresponding tile is loaded and rendered on the front end.

[0114] In this embodiment, the sub-tiles of the next level (deeper, higher precision) that need to be loaded are determined based on the level and position information of the current tile, and the data of these sub-tiles are loaded. Each tile has a unique level and position identifier in the data set, and this identifier can be used to determine the position of the current tile in the overall data structure. According to the level of the current tile, the tile index of the next level is calculated, such as multiplied by 2 (in a quadtree structure) or multiplied by 8 (in an octree structure) to obtain the index of the sub-tile. According to the calculated sub-tile index, the corresponding sub-tile is retrieved from the data set. A request is sent to the server to obtain the sub-tile data of the specified index. The obtained data is passed to the rendering engine, and the rendering engine will construct and render the tiles in the 3D scene based on this data.

[0115] In this implementation, when the camera position or viewing angle changes in specific application scenarios and rendering requirements, the camera's parameters need to be updated. New parameter values ​​are calculated based on the camera's current state and target position. After updating the camera parameters, the screen-space error is recalculated to ensure that rendering quality still meets the requirements. If the SSE is still greater than the preset threshold, it is necessary to continue loading higher-precision tiles.

[0116] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 5 , before step S100, further comprising steps A100 to A300:

[0117] Step A100: Split the BIM model to be split according to the octree index to obtain target sub-models.

[0118] It's important to note that an octree is a tree-like data structure used to describe three-dimensional space. Each node in an octree represents a cubic volume element. Each node has eight child nodes, and the sum of the volume elements represented by the eight child nodes equals the volume of the parent node. An octree can be used as a spatial index structure to efficiently index and store large amounts of spatial data.

[0119] In this embodiment, a spatial analysis is performed on the BIM model (Building Information Modeling) to be split to determine its overall structure and scope. Then, based on the octree principle, the model space is recursively divided into multiple small cubes (i.e., octree nodes), each of which represents the spatial extent of a sub-model. The octree is traversed, and each node is checked to see if it intersects with a component in the BIM model. If so, the node is marked as valid, and the components in the intersecting portion are extracted as sub-models. Each valid node corresponds to a sub-model, and each sub-model contains only one or more components from the BIM model.

[0120] Step A200 , simplifying each of the target sub-models according to a preset simplification rate to obtain tile data corresponding to different levels.

[0121] Step A300: store the tile data to obtain a tile set.

[0122] In this embodiment, a simplification rate is preset based on actual needs and application scenarios. The simplification rate determines the proportion of model detail retained during the simplification process. For example, the simplification rate for adjacent LODs is set to 0.25. First, a lowest-level-of-detail (LOD) model is generated (i.e., the most detailed model). The geometry and attribute information of the sub-models is extracted without any simplification. The size and number of tiles are determined based on application requirements, model size, and performance requirements. Tile size is typically a trade-off between model complexity and rendering performance. The spatial extent of the most detailed model is divided into multiple tile regions. Each tile region contains a portion of the model's geometry and attribute information. For each tile region, the geometry and attribute information contained within is extracted. This information is encoded into a tile data format for subsequent storage, transmission, and rendering. The tile data corresponding to the lowest-level LOD model contains the most detail. For each sub-model, a simplification algorithm (such as edge collapsing, vertex clustering, etc.) is applied based on its geometric complexity and the preset simplification rate to gradually reduce the model's geometric details while preserving its overall shape and key features. Based on the simplified model, LOD tile data for the corresponding level is generated. This process is repeated until the preset maximum simplification level is reached or the model cannot be simplified any further.

[0123] Optionally, during the LOD model simplification process, the simplification process stops when a preset maximum simplification level is reached. Before simplification begins, a maximum simplification level (LOD level) is preset based on application requirements, model complexity, performance requirements, and other factors. This level is an integer representing the degree of simplification of the model from finest to coarsest. For example, the number of LOD levels is max(5, boundbox.area / 1500), where boundbox.area represents the surface area of ​​the sub-model's bounding box, which is the smallest cube or cuboid that can completely contain the sub-model. During the simplification process, simplification begins with the finest model (i.e., the original model or the lowest LOD level), gradually reducing the model's geometric details. After each simplification operation, the current model's simplification level is checked by recording the number of simplification operations, calculating a model complexity metric (such as the number of vertices or edges), or maintaining a simplification level counter. The current model's simplification level is compared with the preset maximum simplification level. If the current level has reached or exceeded the preset maximum level, the simplification process stops. After stopping simplification, save the model at the current simplification level. Output the simplified model data for later use or storage. Finally, verify that the simplified model meets application requirements, such as visual quality and performance. If the simplification results do not meet expectations, you may need to adjust the preset maximum simplification level or repeat the simplification process.

[0124] Please refer to Figure 6 In a feasible implementation manner, step A100 includes steps A110 to A140:

[0125] Step A110, determining the bounding box of each component in the BIM model to be split;

[0126] Step A120: determining a segmentation distance according to the side length and area of ​​the bounding box.

[0127] In this implementation, the leaf nodes of the octree are traversed, and the bounding box of each leaf node is the bounding box of the corresponding sub-model. Using algorithms such as the convex hull algorithm, the minimum bounding sphere algorithm, or the oriented bounding box (OBB) algorithm, a tighter bounding box is automatically calculated based on the sub-model's geometric data. After determining the bounding box, its edge length (boundbox.edge) and surface area (boundbox.area) are calculated. The preset splitting distance n is calculated using the formula n = min(boundbox.edge / 5, boundbox.area / 150). When the bounding box is a cuboid, the minimum edge length is used for calculation. Due to the octree splitting, the surface area of ​​the child nodes does not need to be recalculated and is always one-eighth of the parent node's bounding box. For each child node, the bounding box's edge length (boundbox.edge) is checked to see if it is less than or equal to the preset splitting distance n. If so, further splitting of the child node is stopped. For child nodes that do not meet the stopping criterion, the recursive splitting is repeated until all child nodes meet the stopping criterion, that is, when the sub-model's edge length is less than or equal to the preset splitting distance, the splitting stops.

[0128] Optionally, in addition to comparing the sub-model side length with the preset splitting distance, the splitting can also be stopped when the following stopping conditions are met: Set a maximum number of sub-models. When the number of split sub-models reaches or exceeds this limit, the splitting is stopped. Set a maximum splitting depth. When the depth of the octree reaches or exceeds this limit, the splitting is stopped. Set the stopping conditions based on the geometric complexity of the sub-model (such as the number of vertices, edges, faces, etc.). When the geometric complexity of the sub-model drops below a certain threshold, the splitting is stopped. If the sub-model contains important attribute information (such as material, color, texture, etc.), and the integrity of this information is affected during the splitting process, a threshold for the integrity of the attribute information can be set. When the integrity of the attribute information of the sub-model is lower than this threshold, the splitting is stopped.

[0129] Step A130, splitting the BIM model to be split according to the octree index;

[0130] Step A140: When the side length of the sub-model obtained by splitting is less than or equal to the preset splitting distance, the splitting is stopped to obtain the target sub-model.

[0131] In this embodiment, the BIM model is split according to the octree index, and the splitting stops when the side length of the sub-model is less than or equal to the preset splitting distance. First, an octree root node is created, which represents the bounding box of the entire BIM model to be split. The preset splitting distance is used to determine when to stop splitting. Second, during the splitting process, starting from the root node, the sub-model of the current node (or the part of the model within the bounding box) is checked to see if it meets the stop splitting condition (i.e., the side length is less than or equal to the preset splitting distance). If the sub-model of the current node meets the stop splitting condition, the node is discontinued and marked as a leaf node. If the stop splitting condition is not met: If the sub-model of the current node does not meet the stop splitting condition, the splitting step continues. The midpoint of the current node's bounding box in each dimension (X, Y, Z) is calculated. Based on the midpoints, the current node's bounding box is divided into eight equal-sized sub-bounding boxes, and a child node is created for each sub-bounding box. The sub-models in the current node are assigned to the corresponding child nodes according to their positions. The splitting process is repeated for each newly created child node until all child nodes meet the stop splitting condition. During the splitting process, the information of each node is recorded, including its bounding box, child node pointer (or index), whether it contains a sub-model, etc. The recorded information is used to build a complete octree index structure for subsequent query and retrieval.

[0132] In this embodiment, the preset segmentation distance is determined based on the complexity of the BIM model and the required spatial accuracy. A smaller segmentation distance can provide a more accurate spatial index, but it will increase the amount of computation and storage requirements. When assigning a sub-model to a sub-node, when the sub-model spans multiple sub-bounding boxes, the intersection area or volume of the sub-model with each sub-bounding box is calculated, and the sub-bounding box with the largest intersection is selected to assign the sub-model. Through the above steps, the BIM model can be split according to the octree index, and the splitting can be stopped when the side length of the sub-model is less than or equal to the preset segmentation distance, thereby constructing an efficient octree spatial index structure.

[0133] The present application provides a city digital twin scene LOD processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the city digital twin scene LOD processing method in the above-mentioned embodiment one.

[0134] Reference below Figure 7, which shows a schematic diagram of the structure of a city digital twin scene LOD processing device suitable for implementing the embodiments of the present application. The city digital twin scene LOD processing device in the embodiments of the present application may include, but is not limited to, mobile terminals such as laptops, PDAs (Personal Digital Assistants), PADs (portable Android devices), etc., as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The urban digital twin scene LOD processing device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of this application.

[0135] like Figure 7 As shown, the city digital twin scene LOD processing device may include a processing device 1001 (e.g., a central processing unit, graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the city digital twin scene LOD processing device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the urban digital twin scene LOD processing device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an urban digital twin scene LOD processing device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented or have alternatively.

[0136] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0137] The urban digital twin scene LOD processing device provided in this application adopts the urban digital twin scene LOD processing method in the above-mentioned embodiment, which can solve the technical problem of how to improve the rendering quality of the detail level model. Compared with the existing technology, the beneficial effects of the urban digital twin scene LOD processing device provided in this application are the same as the beneficial effects of the urban digital twin scene LOD processing method provided in the above-mentioned embodiment, and the other technical features of the urban digital twin scene LOD processing device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0138] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0139] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

[0140] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the urban digital twin scene LOD processing method in the above-mentioned embodiment.

[0141] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0142] The above-mentioned computer-readable storage medium may be included in the urban digital twin scene LOD processing device; or it may exist independently without being assembled into the urban digital twin scene LOD processing device.

[0143] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the urban digital twin scene LOD processing device, the urban digital twin scene LOD processing device: after triggering the detection task, obtains the initial geometric error of the initial tile data in the current model; updates the initial geometric error according to the load parameters of the hardware to obtain the target geometric error; obtains the first screen space error according to the target geometric error, compares the first screen space error with the preset screen space error threshold, and determines the target screen space error according to the comparison result; determines the target level according to the target screen space error, and the target tile data corresponding to the target level, and renders the current model according to the target tile data to obtain the target model.

[0144] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0145] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0146] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0147] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for processing LODs for city digital twin scenes. This computer-readable storage medium addresses the technical problem of improving the rendering quality of level-of-detail models. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the method for processing LODs for city digital twin scenes provided in the aforementioned embodiments, and are not further elaborated here.

[0148] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for processing LOD of urban digital twin scenes, characterized in that: The method includes: After the detection task is triggered, the initial geometric error of the initial tile data in the current model is obtained; The initial geometric error is updated according to the load parameter of the hardware to obtain the target geometric error, which includes: obtaining and comparing the load value of the central processing unit and the load value of the graphics processing unit, and determining the maximum load value according to the comparison result; determining the adjustment coefficient according to the maximum load value; wherein, when the maximum load value is greater than or equal to a preset first load value, the adjustment coefficient is negatively correlated with the maximum load value; when the maximum load value is less than a preset second load value, the adjustment coefficient is positively correlated with the maximum load value; determining the target geometric error according to the maximum load value, the adjustment coefficient and the initial geometric error; Acquire a first screen space error according to the target geometric error, and determine a target screen space error according to a comparison result between the first screen space error and a preset screen space error threshold; Determine a target level according to the target screen space error, and obtain target tile data corresponding to the target level; The target model is obtained by rendering the current model according to the target tile data, which includes: determining a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error and the target geometric error; and rendering the current model frame by frame according to the first geometric error and the target tile data to obtain the target model.

2. The urban digital twin scene LOD processing method according to claim 1, characterized in that: The step of acquiring a first screen space error according to the target geometric error, comparing the first screen space error with a preset screen space error threshold, and determining a target screen space error according to the comparison result includes: Calculating according to the target geometric error to obtain the first screen space error; If the first screen space error is less than or equal to the screen space error threshold, the first screen space error is confirmed as the target screen space error.

3. The urban digital twin scene LOD processing method according to claim 2, characterized in that: After the step of comparing the first screen space error with the screen space error threshold, the method further includes: If the first screen space error is greater than the screen space error threshold, updating the target geometric error to obtain a second target geometric error; Recalculating according to the second target geometric error until the first screen space error is less than or equal to the screen space error threshold, to obtain the target screen space error.

4. The urban digital twin scene LOD processing method according to claim 1, characterized in that: The step of obtaining the initial geometric error of the initial tile data in the current model after the detection task is triggered includes: Split the BIM model to be split according to the octree index to obtain the target sub-model; Simplifying each of the target sub-models according to a preset simplification rate to obtain tile data corresponding to different levels; The tile data is stored to obtain a tile set.

5. The urban digital twin scene LOD processing method according to claim 4, characterized in that: The step of splitting the BIM model to be split according to the octree index to obtain the target sub-model includes: Determine the bounding box of each component in the BIM model to be split; Determine the segmentation distance according to the side length and area of ​​the bounding box; Splitting the to-be-split BIM model according to the octree index; When the side length of the sub-model obtained by splitting is less than or equal to the preset splitting distance, the splitting is stopped to obtain the target sub-model.

6. The urban digital twin scene LOD processing method according to claim 1, characterized in that: The method further comprises: Determine whether there is a locked sub-model in the current model; If so, a preset geometric error of the locked sub-model is obtained, and the preset geometric error is confirmed as the target geometric error.

7. The urban digital twin scene LOD processing method according to claim 1, characterized in that: After the detection task is triggered, the step of obtaining the initial geometric error of the initial tile data in the current model includes: When a preset time period is reached, triggering the detection task; An index file of the initial tile data is obtained, and the initial geometric error is obtained from the index file.

Citation Information

Patent Citations

  • Three-dimensional model rendering method and device and computer readable storage medium

    CN117115348A