Urban digital twinning scene LOD processing method
By dynamically adjusting the geometric error and screen space error of the LOD model in the urban digital twin scene and selecting the appropriate tile data level, the problem of excessive rendering burden on the LOD model when loading complex data in the urban digital twin scene is solved, and efficient rendering is achieved and fluency.
Patent Information
- Application Number
- CN202411767254.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In urban digital twin scenarios, LOD models that adjust the level of detail based on distance and importance cannot automatically degrade LOD when loading complex data, resulting in excessive rendering burden and unable to effectively improve rendering quality.
After triggering the detection task, obtain the initial geometric error of the current model, and dynamically adjust the geometric error according to the hardware load parameters, determine the target screen space error, and select the appropriate tile data level for rendering to ensure that the model remains under different hardware resources Appropriate rendering accuracy and fluency.
It realizes increasing model fineness when hardware resources are sufficient, reducing accuracy when resources are tight, avoiding excessive idle or overload of hardware resources, improving overall resource utilization, ensuring the best balance of visual effects and rendering performance, and improving rendering efficiency and accuracy. .
Smart Images

Figure CN119228975A_ABST
Abstract
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 the foundation of the city digital twin scene. It dynamically adjusts the level of detail of the model according to factors such as the distance and importance of the object to achieve a balance between performance optimization and visual quality. When adjusting LOD based on distance, the level of detail of the model is dynamically adjusted according to the distance from the camera (or observer) to the object. When the object is far away from the camera, a lower-detail model is used; when the object is close to the camera, a higher-detail model is used. When adjusting LOD based on importance, the level of detail of the model is dynamically adjusted according to the importance of the object in the scene. For important objects, a higher-detail model is used; for unimportant objects, a lower-detail model is used.
[0003] Adjusting the LOD level based on factors such as the distance and importance of the object is usually done to reduce the complexity and amount of data while maintaining the necessary information of the model, so that it can be displayed and applied more smoothly on various devices and platforms. However, in the above two adjustment methods, when the LOD level with complex data is loaded and the rendering burden is heavy, LOD downgrade cannot be performed automatically.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of this application is to provide a city digital twin scene LOD processing method, aiming to solve the technical problem of how to improve the rendering quality of detail level models.
[0006] To achieve the above objectives, the present application proposes a method for processing LOD of a city digital twin scene, the method comprising: After the detection task is triggered, the initial geometric error of the initial tile data in the current model is obtained; Updating the initial geometric error according to the load parameters of the hardware to obtain a target 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 current model is rendered according to the target tile data to obtain a target model.
[0007] 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: 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; Determine an 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; The target geometric error is determined according to the maximum load value, the adjustment coefficient and the initial geometric error.
[0008] In one embodiment, 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.
[0009] In one embodiment, after the step of comparing the first screen space error with the screen space error threshold, the method further comprises: 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.
[0010] 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 step 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.
[0011] 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: 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.
[0012] In one embodiment, 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.
[0013] 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: When a preset time period is reached, triggering the detection task; Obtain an index file of the tile data, and obtain the initial geometric error from the index file.
[0014] In one embodiment, the step of rendering the current model according to the target tile data to obtain the target model includes: Determine a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error and the target geometric error; The current model is rendered frame by frame according to the first geometric error and the target tile data to obtain the target model.
[0015] 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 executable 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.
[0016] 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 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 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, determine the corresponding target level and target tile data, superimpose the target tile data on the current model, and obtain the target model.
[0017] In the present 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 refinement of the model when the hardware resources are sufficient; when the resources are tight, the precision 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, which ensures both the clarity of the model and the smoothness of the rendering. 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
[0018] 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.
[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0020] Figure 1 A flow chart of the first embodiment of the method for LOD processing of the urban digital twin scene in this application; Figure 2 A detailed flow chart of Example 1 of the urban digital twin scene LOD processing method provided in this application; Figure 3 A flow chart of the second embodiment of the LOD processing method for the urban digital twin scene of this application; Figure 4 A flow chart of the third embodiment of the method for LOD processing of the urban digital twin scene of this application; Figure 5 A flow chart of the fourth embodiment of the LOD processing method for the urban digital twin scene of this application; Figure 6 A byte flow diagram provided for Example 4 of the urban digital twin scene LOD processing method of this application; 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 the present application. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0022] 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.
[0023] The main solution of the embodiment of the present application is: after triggering the detection task, obtaining the initial geometric error of the initial tile data in the current model; updating the initial geometric error according to the load parameters of the hardware to obtain the target geometric error; obtaining the first screen space error according to the target geometric error, and determining the target screen space error according to the comparison result of the first screen space error and a preset screen space error threshold; determining the target level according to the target screen space error, and obtaining the target tile data corresponding to the target level; rendering the current model according to the target tile data to obtain the target model.
[0024] The Level of Detail (LOD) model is the foundation of the city digital twin scene. It dynamically adjusts the level of detail of the model according to factors such as the distance and importance of the object to achieve a balance between performance optimization and visual quality. When adjusting LOD based on distance, the level of detail of the model is dynamically adjusted according to the distance from the camera (or observer) to the object. When the object is far away from the camera, a lower-detail model is used; when the object is close to the camera, a higher-detail model is used. When adjusting LOD based on importance, the level of detail of the model is dynamically adjusted according to the importance of the object in the scene. For important objects, a higher-detail model is used; for unimportant objects, a lower-detail model is used.
[0025] Adjusting the LOD level based on factors such as the distance and importance of the object is usually done to reduce the complexity and amount of data while maintaining the necessary information of the model, so that it can be displayed and applied more smoothly on various devices and platforms. However, in the above two adjustment methods, when the LOD level with complex data is loaded and the rendering burden is heavy, LOD downgrade cannot be performed automatically.
[0026] 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 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 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, determine the corresponding target level and target tile data, superimpose the target tile data on the current model, and obtain the target model.
[0027] In the present 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 refinement of the model when the hardware resources are sufficient; when the resources are tight, the precision 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, which ensures both the clarity of the model and the smoothness of the rendering. 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.
[0028] It should be noted that the execution subject of this embodiment can be a computing service device with network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device, a device, etc. that can realize the above functions. The following takes the city digital twin scene LOD processing device as an example to illustrate this embodiment and the following embodiments.
[0029] 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 the present application.
[0030] In this embodiment, the city digital twin scene LOD processing method includes steps S100 to S500: Step S100, after the detection task is triggered, the initial geometric error of the initial tile data in the current model is obtained.
[0031] It should be noted that tile data refers to the process of dividing a large data set or image into a series of smaller, more manageable and processable units (i.e., "tiles"). Each tile usually contains a subset of a data set or an area of an image, and these tiles can be loaded and rendered on demand.
[0032] In addition, it should be noted that in LOD (Level of Detail) technology, the geometric error (GE) is used to describe the degree of approximation between the approximate geometric model drawn by the computer and the ideal mathematical model. The geometric error reflects the deviation or error of the model geometry between different LOD levels in the multi-level detail representation.
[0033] In this embodiment, tile data refers to 3D Tiles data (three-dimensional tiles). After the detection task is triggered, the 3D Tiles data is loaded by the loader. A timer or a timer can be used to regularly check whether the current time has reached the predetermined execution time or has passed the preset time period. If the current time has reached the predetermined time or the preset time period, the corresponding task is automatically executed. The detection task can also be triggered by the user clicking a button, inputting a command, etc.
[0034] Please refer to Figure 2 In a feasible implementation manner, step S100 may further include the following steps S110-S120: Step S110, when a preset time period is reached, triggering the detection task.
[0035] 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, which can periodically send signals or interrupts so that an operating system or other application can perform certain tasks within a specified time interval. In a timed task, an operating system or application will use a timer or a timer to periodically check whether the current time has reached a preset time period. If the current time has reached the preset time period, the detection task will be automatically executed.
[0036] In this implementation, a timer instance is created in advance, and the trigger period of the timer is configured (such as every minute, every hour, etc.). A detection task is defined, and the defined detection task function or method is registered to the timer callback. When the timer is triggered, it automatically calls this callback to execute the detection task.
[0037] Step S120, obtaining an index file of the tile data, and obtaining the initial geometric error from the index file.
[0038] 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 tile corresponding to the current level model.
[0039] In this implementation, 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.
[0040] Step S200, updating the initial geometric error according to the load parameters of the hardware to obtain a target geometric error.
[0041] It should be noted that the initial geometric error refers to the preset, unadjusted geometric accuracy error in computer graphics rendering or 3D scene processing. This error value is usually set based on the ideal state of system performance. The target geometric error refers to the geometric accuracy error that is dynamically adjusted according to the current hardware load parameters. This error value reflects the geometric accuracy level accepted by the system under a given hardware load.
[0042] In this embodiment, after the detection task is triggered, the hardware load parameters are obtained. The hardware load parameters include CPU (Central Processing Unit) utilization, GPU (Graphics Processing Unit) utilization, memory usage, etc. CPU utilization indicates the proportion of CPU resources occupied. High utilization means that the CPU is processing a large number of tasks, which may cause the system to respond slowly. GPU utilization reflects the GPU load. High utilization 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.
[0043] In this embodiment, the initial geometric error can be dynamically adjusted according to 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 according to the error tolerance. When the hardware load is high, in order to reduce the rendering burden, the system may increase the tolerance of the geometric error, that is, increase the target geometric error, so as to reduce the rendering details and thus reduce the occupation of hardware resources. When the hardware load is low, the tolerance of the geometric error is reduced, that is, the target geometric error is reduced to improve the rendering quality and make the picture more refined.
[0044] In this embodiment, the initial geometric error is updated according to the load parameters of the hardware to obtain the target geometric error; the geometric error is dynamically adjusted according to the real-time load of the hardware to ensure that the model can maintain appropriate rendering accuracy under different hardware resources. When the hardware resources are sufficient, the fineness of the model can be increased; when the resources are tight, the accuracy is appropriately reduced to maintain a smooth rendering speed. Through dynamic adjustment, excessive idleness or overload of hardware resources can be avoided, thereby improving the overall resource utilization.
[0045] Step S300 : acquiring 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.
[0046] It should be noted that Screen Space Error (SSE) is a measure of the difference in the number of pixels between a model and its original model when it is displayed on the screen. Screen space error is a manifestation of geometric error that is finally presented on the screen after being processed by the 3D rendering pipeline. By calculating the relationship between geometric error and screen space error, the system can dynamically adjust the LOD level to ensure that the model maintains appropriate visual effects and rendering performance at different viewing angles.
[0047] In this embodiment, the calculated screen space error is compared with the preset screen space error according to the target geometric error, the distance and the 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 screen space error calculated for the first time is used as the target screen space error. Through the above steps, the level of detail of the tile can be dynamically adjusted to improve performance while ensuring rendering quality.
[0048] In this embodiment, the determination of 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.
[0049] Step S400: determining a target level according to the target screen space error, and acquiring target tile data corresponding to the target level.
[0050] Step S500: Render the current model according to the target tile data to obtain a target model.
[0051] It should be noted that LOD (Level of Detail) is a technology widely used in 3D computer graphics, which 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 striking 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 fewer details and lower geometric complexity. The appropriate LOD level is dynamically selected for rendering based on the observer's perspective, distance, and other factors.
[0052] In this implementation, after determining the target screen space error, the LOD level corresponding to the target screen space error is determined, and according to the determined LOD level, the corresponding model data is requested and loaded, and the model data is rendered and displayed on the front end. During the rendering process, the hardware load and rendering quality are continuously monitored. According to the monitoring results, the value of ScreenSpaceError is dynamically adjusted to achieve the best balance between performance and quality.
[0053] In this implementation, 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 the threshold is the target level.
[0054] In a feasible implementation manner, step S500 may include the following steps: Determine a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error and the target geometric error; The current model is rendered frame by frame according to the first geometric error and the target tile data to obtain the target model.
[0055] In this embodiment, in order to avoid the sudden change of the target geometric error causing the screen to flicker or freeze, a smooth transition method is used for adjustment. During the rendering process, each part of the model is rendered according to the first geometric error value and the target tile data of the current frame. As the frame advances, the geometric shape of the model will gradually approach 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.
[0056] In this implementation, adjustment is performed according to the exponential smoothing method. First, determine the initial geometric error value error_start, the target geometric error value: error_end and the smoothing coefficient alpha (the range is between [0, 1], the closer to 1, the faster the smoothing transition, and the closer to 0, the slower the smoothing transition). Secondly, calculate the smoothing value of each frame. The initial geometric error value current_error = error_start, and calculate a new error value current_error = alpha *error_end + (1 - alpha) * current_error for each frame. Use the new current_error to update the geometric error of the current frame. Finally, repeat the above calculation for each frame until the error value is close enough to error_end.
[0057] Optionally, adjustments can also be made in a linear difference manner. First, determine the initial geometric error value error_start, the target geometric error value error_end, and the transition time transition_time. Secondly, calculate the interpolation of each frame. Record the current time current_time and the start time start_time, and the elapsed time elapsed_time = current_time - start_time. Interpolation factor t = elapsed_time / transition_time (the range of t should be between [0, 1], and the boundary value is taken when it exceeds). 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.
[0058] In a feasible implementation, in order to lock the rendering clarity of a specific model (such as a building) in a three-dimensional map or scene, the maximum geometric error (MaxGeometryError) used by some models to be rendered can be locked so that they are always at the clarity set by the user. Determine which buildings or models need to have their rendering clarity locked. Determine the building or model to be locked by the model's ID, name, or other unique identifier. When it is necessary to determine the LOD for a model, check whether the model is in a list containing the locked model ID. If the model is locked, obtain the maximum geometric error set by the user for the model, and determine the LOD level by the maximum geometric error.
[0059] In this embodiment, the target screen space error can be used to accurately select tile data of the required level, avoiding data redundancy or loss, thereby improving rendering efficiency and accuracy. Rendering based on target tile data can ensure that the model is rendered at the highest efficiency when hardware resources allow. By optimizing the rendering process, it can ensure that users see clear and smooth model effects, thereby improving user experience.
[0060] 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-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , the load parameters are the load value of the central processing unit and the load value of the graphics processing unit, and step S200 may include steps S210 to S230: 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; Step S220, determining an 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; 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; Step S230: determining the target geometric error according to the maximum load value, the adjustment coefficient and the initial geometric error.
[0061] In this embodiment, whether to adjust the initial geometric error and how to adjust it are comprehensively determined according to the load value of the central processing unit and the load value of the graphics processing unit. After the tile data is loaded into the rendering engine, the negative feedback adjustment mechanism of LOD is introduced in the rendering process. In the preparatory stage of frame rendering, the load value of the central processing unit and the load value of the graphics processing unit are obtained, and the maximum load value burden = max(CPU_occupied, GPU_occupied).
[0062] In this embodiment, the adjustment coefficient is determined according to the maximum load value. When the maximum load value is greater than or equal to the preset first load value (for example, 90%), the adjustment coefficient is negatively correlated with the maximum load value, and the value of the initial geometric error is reduced. The initial geometric error is updated according to the first update formula to obtain the target geometric error. When the maximum load value is less than the preset second load value (for example, 50%), the adjustment coefficient is positively correlated with the maximum load value, the value of the initial geometric error is increased, a more refined LOD model is used, the display effect is enhanced, and the waste of computing resources is avoided. The initial geometric error is updated according to the maximum load value and the adjustment coefficient, and the update formula is: initial geometric error * (1.1 + maximum load value burden * adjustment coefficient).
[0063] 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. The update formula at this time is: initial geometric error * (1.1 + maximum load value burden * 0.5).
[0064] 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-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S300 includes steps S310 to S320: Step S310, performing calculation according to the target geometric error to obtain the first screen space error; In this implementation, the calculation formula is: ; 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 tilt angle of the camera in the vertical direction.
[0065] In this embodiment, drawingBufferHeight is obtained by querying the properties of the drawing context. For example, in WebGL, the WebGLRenderingContext.drawingBufferHeight property is used to obtain the actual height of the current drawing buffer. Fovy is determined during the camera setup or initialization phase. In a 3D rendering engine, the fovy property of the camera can be set or queried directly. The distance between the camera and the object position is obtained by calculating the Euclidean distance between them.
[0066] Step S320: If the first screen space error is less than or equal to the screen space error threshold, confirming that the first screen space error is the target screen space error.
[0067] In this implementation, 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, and the current model is rendered according to the target tile data corresponding to the LOD level.
[0068] In a feasible implementation manner, step S320 may further include steps S330 to S340: Step S330: if the first screen space error is greater than the screen space error threshold, the target geometric error is updated to obtain a second target geometric error; 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, to obtain the target screen space error.
[0069] In this implementation, 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 sub-tiles with deeper layers and higher precision and the relevant parameters of the camera are read and calculated repeatedly until the calculated screen space error is less than or equal to the set value of the preset screen space error threshold, the calculation is terminated, and finally the corresponding tile request is loaded and rendered on the front end for display.
[0070] 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, through which the position of the current tile in the overall data structure can be determined. According to the level of the current tile, the tile index of the next level is calculated, such as multiplying by 2 (in a quadtree structure) or multiplying 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.
[0071] In this implementation, in specific application scenarios and rendering requirements, when the camera position or viewing angle changes, the relevant parameters of the camera need to be updated. New parameter values are calculated based on the current state and target position of the camera. After the camera parameters are updated, the screen space error is recalculated to ensure that the rendering quality still meets the requirements. If the SSE is still greater than the preset threshold, it is necessary to continue to load higher precision tiles.
[0072] 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 first embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , before step S100, it also includes steps A100 to A300: Step A100, splitting the BIM model to be split according to the octree index to obtain the target sub-model.
[0073] It should be noted that the octree is a tree-like data structure used to describe three-dimensional space. Each node of the octree represents a volume element of a cube. Each node has eight child nodes. The volume elements represented by the eight child nodes added together equal the volume of the parent node. The octree can be used as a spatial index structure to efficiently index and store large amounts of spatial data.
[0074] In this embodiment, the BIM model (Building Information Modeling) to be split is spatially analyzed 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., nodes of the octree), each of which represents the spatial range of a sub-model. The octree is traversed to check whether each node intersects with the components in the BIM model. If so, the node is marked as valid, and the components of the intersecting part are extracted as sub-models. Each valid node corresponds to a sub-model, and each sub-model contains only one or more components in the BIM model.
[0075] Step A200, simplifying each of the target sub-models according to a preset simplification rate to obtain tile data corresponding to different levels.
[0076] Step A300: store the tile data to obtain a tile set.
[0077] In this embodiment, according to actual needs and application scenarios, a simplification rate is preset, and the simplification rate determines the proportion of model details retained during the simplification process. Exemplarily, the simplification rate of adjacent lods is set to 0.25. First, the lowest layer of LOD model (i.e., the most refined model) is generated, and the geometry and attribute information of the sub-model is extracted without any simplification. The size and number of tiles are determined according to application requirements, model size and performance requirements. The tile size is usually weighed according to the complexity and rendering performance of the model. The spatial range of the most refined model is divided into multiple tile areas. Each tile area contains a part of the geometry and attribute information of the model. For each tile area, the geometry and attribute information contained therein is extracted. This information is encoded into a tile data format for subsequent storage, transmission and rendering. The tile data corresponding to the lowest layer of the LOD model contains the most details. For each sub-model, according to its geometric complexity and the preset simplification rate, a simplification algorithm (such as edge folding, vertex clustering, etc.) is applied to gradually reduce the geometric details of the model while maintaining the overall shape and key features of the model. According to the simplified model, the LOD tile data of 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.
[0078] Optionally, during the process of LOD model simplification, the simplification process is stopped when the preset highest simplification level is reached. Before starting simplification, a highest simplification level (LOD level) is preset according to factors such as application requirements, model complexity, performance requirements, etc. This level is an integer representing the degree of simplification of the model from the finest to the coarsest. Exemplarily, the number of LOD levels is max(5, boundbox.area / 1500), where boundbox.area represents the surface area of the bounding box of the submodel, and the bounding box is a minimum cube or cuboid that can completely contain the submodel. During the simplification process, simplification starts from the finest model (i.e., the original model or the lowest LOD level), and the geometric details of the model are gradually reduced. After each simplification operation, the simplification level of the current model is checked by recording the number of simplification operations, calculating the complexity index of the model (such as the number of vertices, the number of edges, etc.), or maintaining a counter of the simplification level. The simplification level of the current model is compared with the preset highest simplification level. If the current level has reached or exceeded the preset highest level, the simplification process is stopped. After stopping simplification, save the model at the current simplification level. Output the simplified model data for subsequent use or storage. Finally, verify whether the simplified model meets the application requirements, such as visual effects, performance requirements, etc. If the simplification result does not meet expectations, you may need to adjust the preset highest simplification level or repeat the simplification process.
[0079] Please refer to Figure 6 In a feasible implementation manner, step A100 includes steps A110 to A140: Step A110, determining the bounding box of each component in the BIM model to be split; Step A120: determining the segmentation distance according to the side length and area of the bounding box.
[0080] In this embodiment, 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. A tighter bounding box is automatically calculated based on the geometric data of the sub-model using a convex hull algorithm, a minimum bounding sphere algorithm, or a directional bounding box (OBB) algorithm. After determining the bounding box, its side length boundbox.edge and surface area boundbox.area are calculated. The preset segmentation distance n is calculated according to the formula n = min(boundbox.edge / 5, boundbox.area / 150). When the bounding box is a cuboid, the minimum side length is taken for calculation. Due to the octree splitting, the surface area of the child node does not need to be recalculated, and is one-eighth of the bounding box of the parent node. For each child node, check whether the side length boundbox.edge of its bounding box is less than or equal to the preset segmentation distance n. If the condition is met, stop further splitting of the child node. For child nodes that do not meet the stop condition, repeat the recursive splitting until all child nodes meet the stop condition, that is, when the side length of the sub-model is less than or equal to the preset segmentation distance, stop splitting.
[0081] Optionally, in addition to comparing the sub-model side length with the preset splitting distance, the splitting can also be stopped when the following stop conditions are met: Set a maximum number of sub-models. Stop splitting when the number of split sub-models reaches or exceeds this limit. Set a maximum splitting depth. Stop splitting when the depth of the octree reaches or exceeds this limit. Set the stopping condition based on the geometric complexity of the sub-model (such as the number of vertices, edges, faces, etc.). Stop splitting when the geometric complexity of the sub-model drops below a certain threshold. 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. Stop splitting when the integrity of the attribute information of the sub-model is lower than this threshold.
[0082] Step A130, splitting the BIM model to be split according to the octree index; 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.
[0083] In this embodiment, the BIM model is split according to the octree index, and the splitting is stopped when the side length of the sub-model is less than or equal to the preset splitting distance. First, create an octree root node, which represents the bounding box of the entire BIM model to be split, and preset the splitting distance to determine when to stop splitting. Secondly, during the splitting process, starting from the root node, check whether the sub-model of the current node (or the partial model in the bounding box) meets the condition for stopping splitting (that is, the side length is less than or equal to the preset splitting distance). If the sub-model of the current node meets the condition for stopping splitting, the node is no longer split and is marked as a leaf node. If the stop condition is not met: If the sub-model of the current node does not meet the condition for stopping splitting, continue to perform the splitting step. Calculate the midpoint of the current node bounding box in each dimension (X, Y, Z). Divide the bounding box of the current node into eight equal-sized sub-bounding boxes according to the midpoint, and create a sub-node for each sub-bounding box. Assign the sub-models in the current node to the corresponding sub-nodes according to their positions. Repeat the above splitting process for each newly created sub-node until all sub-nodes meet the condition for stopping splitting. 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.
[0084] In this embodiment, the preset segmentation distance is determined according to 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 calculation 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 and 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.
[0085] 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 executable 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.
[0086] 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 embodiment of the present application. The city digital twin scene LOD processing device in the embodiment 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., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The city digital twin scene LOD processing device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0087] like Figure 7 As shown, the city digital twin scene LOD processing device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the city digital twin scene LOD processing device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. The 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, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a 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 the systems shown. More or fewer systems may be implemented or provided alternatively.
[0088] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a 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 through 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.
[0089] The urban digital twin scene LOD processing device provided by this application adopts the urban digital twin scene LOD processing method in the above embodiment, which can solve the technical problem of how to improve the rendering quality of the detail level model. Compared with the prior art, the beneficial effects of the urban digital twin scene LOD processing device provided by this application are the same as the beneficial effects of the urban digital twin scene LOD processing method provided by the above embodiment, and the other technical features in 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.
[0090] It should be understood that the various parts disclosed in this application can be implemented by 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.
[0091] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0092] 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.
[0093] The computer-readable storage medium provided in the present application 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 of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0094] 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.
[0095] 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 a 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.
[0096] 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 separate 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 through 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).
[0097] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the 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 square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0098] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0099] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned city digital twin scene LOD processing method, and can solve the technical problem of how to improve the rendering quality of the detail level model. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the city digital twin scene LOD processing method provided in the above-mentioned embodiment, and will not be repeated here.
[0100] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications 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; Updating the initial geometric error according to the load parameters of the hardware to obtain a target 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 current model is rendered according to the target tile data to obtain a target model.
2. The urban digital twin scene LOD processing method according to claim 1, characterized in that: 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: 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; Determine an 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; The target geometric error is determined according to the maximum load value, the adjustment coefficient and the initial geometric error.
3. 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.
4. The urban digital twin scene LOD processing method according to claim 3, 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.
5. 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.
6. The urban digital twin scene LOD processing method according to claim 5, 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.
7. 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.
8. 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.
9. The urban digital twin scene LOD processing method according to claim 1, characterized in that: The step of rendering the current model according to the target tile data to obtain the target model comprises: Determine a first geometric error value corresponding to each frame according to a smoothing coefficient, the initial geometric error and the target geometric error; The current model is rendered frame by frame according to the first geometric error and the target tile data to obtain the target model.
Citation Information
Patent Citations
Engineering three-dimensional model LOD output method based on 3D Tiles
CN112070909A
Mass skew data loading method based on multi-parameter rendering
CN115408631A
Three-dimensional model rendering method and device and computer readable storage medium
CN117115348A
System and Method For Subdividing Large Polygon Mesh Datasets Into Hierarchical Subsets For Level-Of-Detail Use
US20200302692A1
Cited By
Simplified expression method for geometric data in field of digital twinborn cities
CN119992026A
Geometric Data Simplified Representation Method in the Field of Digital Twin City
CN119992026B
BIM model front-end rapid scheduling rendering method based on WebGPU acceleration
CN120014138A
A Fast Scheduling and Rendering Method for the BIM Model Front End Based on WebGPU Acceleration
CN120014138B
Urban digital twinning scene static LOD processing method
CN120355830A
