Method and apparatus for integrating three-dimensional scenes
By constructing a multi-level detailed model and spatial partitioning, a hierarchical partitioned 3D model is generated, which solves the problem of low rendering efficiency of 3D scenes and achieves efficient rendering when the data volume is large.
Patent Information
- Application Number
- CN202211238955.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-11
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-10-11
AI Technical Summary
In 3D scene rendering, existing technologies offer limited improvement in rendering efficiency when the data volume is large, especially when the view coverage is large and the number of models is large, the improvement effect of traditional methods is not significant.
By constructing multi-level detailed models and dividing spatial ranges from 3D scene data, a hierarchical partitioned 3D model is generated. Appropriate hierarchical partitions are selected for loading and rendering based on the viewpoint position and field of view, optimizing geometric and texture information and reducing the amount of data loaded and rendered.
It improves the rendering efficiency of 3D scenes with large amounts of data, avoids the impact of viewpoint position and field of view on the number and complexity of models, and enhances the rendering effect.
Smart Images

Figure CN115713583B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D modeling technology, and in particular to a 3D scene synthesis method and apparatus. Background Technology
[0002] 3D scene rendering is the process of generating 2D images from digital 3D scenes using computers. It primarily involves the organization, management, and display of graphics to reproduce realistic 3D graphics. Rendering efficiency is a key concern in practical applications. Generally, 3D scene rendering efficiency is negatively correlated with the complexity of the 3D model data; the more complex the 3D model, the slower the data loading and the lower the rendering efficiency.
[0003] Traditional approaches primarily reduce the data size of individual models by loading coarse models when the viewpoint distance is relatively far, thereby improving data loading and rendering efficiency. However, this method offers limited improvement in rendering efficiency when the viewport coverage is large and the number of loaded models is high. Summary of the Invention
[0004] This application provides a three-dimensional scene synthesis method and apparatus, which can solve the technical problem of how to improve the rendering efficiency of three-dimensional scenes when the data volume is large.
[0005] In a first aspect, embodiments of this application provide a method for three-dimensional scene synthesis, comprising: constructing a multi-level detail model using three-dimensional scene data, the multi-level detail model including three-dimensional scene data of different levels of detail; dividing the spatial range of the three-dimensional scene data into hierarchical partitions to obtain hierarchical partition information, the hierarchical partition information including partition information for each level, the spatial range of each level being divided into a corresponding number of partitions, and the partition of the next level being obtained by further dividing the partition of the previous level into sub-partitions, the level of detail of the partition of the previous level being lower than that of the partition of the next level.
[0006] A hierarchical partitioned 3D model is generated based on the multi-level detail model and hierarchical partitioning information. This hierarchical partitioned 3D model is used to generate multi-level detail scenes.
[0007] In one embodiment, the method further includes: selecting a model to be rendered from a hierarchical partitioned 3D model based on the viewpoint position and / or field of view, and then loading and rendering the model to be rendered.
[0008] In one embodiment, the above-mentioned construction of a multi-level detail model using 3D scene data includes: generating an optimized 3D model using the 3D scene data; and simplifying the optimized 3D model to generate a multi-level detail model.
[0009] In actual rendering, the greater the distance from the viewpoint and / or the larger the view area, the coarser the detail model is loaded, resulting in less data to load and render, and higher rendering efficiency. The relatively coarse detail model mentioned above can be considered an example of the model to be rendered. Therefore, switching between different multi-level detail models based on the distance between the model and the viewpoint can improve rendering efficiency.
[0010] In one embodiment, the above-mentioned method of generating an optimized 3D model using 3D scene data includes: optimizing the geometric and texture information of each 3D model in the 3D scene data to obtain optimized geometric and texture information; and obtaining an optimized 3D model based on the optimized geometric and texture information.
[0011] In one embodiment, the optimization of geometric and texture information to obtain optimized geometric and texture information includes: removing duplicate and invisible triangular faces or repairing erroneous triangular faces from the geometric information of the 3D model to obtain optimized geometric information. Using the optimized geometric information as the basic geometric data, the 3D model is texture remapped using its texture information to obtain optimized texture information.
[0012] In one embodiment, the above-mentioned method of generating an optimized 3D model using 3D scene data includes: performing geometric simplification processing on the optimized 3D model using its geometric information to obtain a geometrically simplified 3D model; and performing texture simplification processing on the geometrically simplified 3D model using its texture information to obtain a multi-level detail model.
[0013] In one embodiment, the above-mentioned geometric simplification process of the optimized 3D model using its geometric information to obtain a geometrically simplified 3D model includes: setting removal threshold rules for geometric elements at each level of the optimized 3D model, wherein the removal rules include: the minimum number of geometric elements at each level and / or the maximum geometric simplification error at each level; processing the geometric elements of the optimized 3D model according to a first preset rule, wherein the first preset rule includes: sorting the geometric elements in ascending order according to the removal geometric error; removing the geometric element with the smallest removal geometric error until the removal threshold rules for geometric elements are met, thereby obtaining the geometrically simplified 3D model.
[0014] In one embodiment, the above-mentioned use of the texture information of the optimized three-dimensional model to perform texture simplification processing on the geometrically simplified three-dimensional model to obtain a multi-level detail model includes: setting texture simplification rules for each level based on the geometrically simplified three-dimensional model, and remapping the texture pixel information corresponding to each triangle face in the geometrically simplified three-dimensional model according to the texture simplification rules to obtain a multi-level detail model.
[0015] The above method correlates the geometric errors caused by simplifying geometric elements with texture resolution, which can match the geometric information and texture information of multi-level detail models in terms of fineness, avoiding data redundancy and poor rendering effects caused by textures being too clear or too blurry compared to geometry.
[0016] In one embodiment, the method further includes: constructing a multi-level detail index for the multi-level detail model. This multi-level detail index is used to retrieve model levels within the multi-level detail model.
[0017] In one embodiment, the above-mentioned construction of a multi-level detail index for a multi-level detail model includes: converting the model description information of each level in the multi-level detail model into corresponding nodes, with each level corresponding to one node. The node corresponding to the first level is taken as the parent node, and child nodes are assigned to different levels according to their level of detail. Then, parent-child relationships are established between the parent nodes and child nodes based on the hierarchical relationships.
[0018] In one embodiment, the above-mentioned hierarchical partitioning of the spatial extent of the 3D scene data to obtain hierarchical partitioning information includes: reading and calculating the bounding box information of each 3D model in the 3D scene data to obtain the spatial extent information of the 3D scene data; and performing multi-level partitioning of the spatial extent of the 3D scene data according to a second preset rule to obtain hierarchical partitions of different spatial extents.
[0019] The second pre-defined rule includes: the minimum number of models C contained in the finest level. min The critical condition for hierarchical partitioning is set as follows: the number of models contained in the finest hierarchical partition is less than or equal to C. min When the time is right, stop dividing the hierarchical partitions. Match the 3D models in the 3D scene to the corresponding hierarchical partitions according to their positional relationships, and then update the spatial extent information of the hierarchical partitions. Determine whether the number of matched 3D models in each hierarchical partition exceeds a preset range. When the number of multi-level detail models in a hierarchical partition exceeds the preset range, record the information of that hierarchical partition in the hierarchical partition information table corresponding to the hierarchical partition information, thus completing the division of the hierarchical partitions. In one embodiment, the above-mentioned generation of hierarchical partition 3D models based on multi-level detail models and hierarchical partition information includes:
[0020] Read the hierarchical partition information table.
[0021] Obtain information on partitions at each level and information on multi-level detailed models within each partition.
[0022] The parameters of the hierarchical partition 3D model are calculated based on the information of the multi-level detail model within each partition; the parameters of the hierarchical partition 3D model are used to generate the hierarchical partition 3D model.
[0023] Merge multi-level detailed models within each level partition.
[0024] The partitioned 3D model is simplified to generate a partitioned 3D model.
[0025] Secondly, embodiments of this application provide a three-dimensional scene integration device, which has the function of implementing the method in the first aspect or any possible implementation thereof. Specifically, the device includes units for implementing the method in the first aspect or any possible implementation thereof.
[0026] In one embodiment, the apparatus includes a building unit for constructing a multi-level detail model using 3D scene data, the multi-level detail model including 3D scene data of different levels of detail.
[0027] The partitioning unit is used to divide the spatial range of 3D scene data into hierarchical partitions to obtain hierarchical partition information. The hierarchical partition information includes the partition information of each level. The spatial range of each level is divided into a corresponding number of partitions. The partition of the next level is obtained by further dividing the partition of the previous level into sub-partitions. The level of detail of the partition of the previous level is lower than that of the partition of the next level.
[0028] The generation unit is used to generate a hierarchical partitioned 3D model based on the multi-level detail model and hierarchical partitioning information. The hierarchical partitioned 3D model is used to generate a multi-level detail scene.
[0029] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement any of the implementation methods of the first aspect described above.
[0030] Fourthly, embodiments of this application provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method of any of the implementations of the first aspect described above.
[0031] Fifthly, embodiments of this application provide a computer program product that, when run on a computer device, causes the computer device to execute any of the implementation methods of the first aspect described above.
[0032] The beneficial effects of this application's embodiments compared to existing technologies are as follows: When dealing with large amounts of data, multi-level detailed models are generated based on 3D scene data through optimization and simplification. Then, the spatial range of the 3D scene data is divided into hierarchical partitions. Coarser partitions are further subdivided into multiple sub-partitions at finer levels, resulting in the generation of hierarchical partitioned 3D models with varying degrees of detail throughout the entire 3D scene, thus creating a multi-level detailed scene. During rendering, appropriate hierarchical partitioned 3D models can be selected for loading and rendering based on the viewpoint position and view area, making the number of 3D models to be loaded and rendered within the view area, the total data volume, and the complexity independent of the viewpoint distance, thereby improving the rendering efficiency of 3D scenes with large amounts of data. Attached Figure Description
[0033] Figure 1 This is a schematic diagram illustrating the stages of three-dimensional scene rendering provided in an embodiment of this application;
[0034] Figure 2 This is a flowchart illustrating a three-dimensional scene synthesis method provided in an embodiment of this application;
[0035] Figure 3 This is a schematic diagram of a hierarchical partitioning of a three-dimensional scene provided in an embodiment of this application;
[0036] Figure 4 This is a flowchart illustrating a method for constructing a multi-level detail model provided in an embodiment of this application;
[0037] Figure 5 This is a flowchart illustrating a method for hierarchical partitioning of a three-dimensional scene provided in an embodiment of this application;
[0038] Figure 6 This is a flowchart illustrating a method for generating a hierarchical partitioned 3D model provided in an embodiment of this application;
[0039] Figure 7 This is a flowchart illustrating a method for constructing a scene-level partition index provided in an embodiment of this application;
[0040] Figure 8 This is a schematic diagram of the structure of a three-dimensional scene integration device provided in an embodiment of this application;
[0041] Figure 9 This is a schematic diagram of another three-dimensional scene integration device provided in the embodiments of this application;
[0042] Figure 10 This is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0043] To illustrate the technical solution of this application, specific embodiments are described below.
[0044] Figure 1 This is a schematic diagram of the stages of three-dimensional scene rendering provided in an embodiment of this application.
[0045] like Figure 1 As shown, the rendering of a 3D scene is completed jointly by the CPU and GPU. The rendering of each frame can be divided into three stages: the data loading stage, the CPU stage, and the GPU stage.
[0046] The data loading stage is the process of loading the 3D model in the 3D scene from external storage into memory. This can be done all at once or in batches as needed.
[0047] In the CPU phase, the CPU filters and processes the 3D models in the scene based on the viewpoint information, then passes the 3D model data and its state to the GPU and issues rendering instructions to the GPU for drawing. During the drawing call, the CPU batch processes the 3D models to be rendered, merging triangular meshes with the same attributes into a group for simultaneous rendering, forming a single draw call.
[0048] The GPU stage involves the GPU rendering the 3D scene based on the received 3D model data and its state, through operations such as geometric processing, rasterization, and pixel processing. Generally, the more complex the 3D model, the lower the GPU's rendering efficiency.
[0049] In traditional solutions, the impact of the amount of data in a 3D scene on rendering efficiency can be reduced by loading data in batches. However, the number of 3D model objects in the scene remains unchanged, so this method has limited efficiency improvement in the rendering stage.
[0050] To address the aforementioned issues, this application provides a method for synthesizing 3D scenes. This method primarily involves dividing the 3D scene into multi-level partitions, creating hierarchical 3D models with varying degrees of detail. During actual rendering, different levels of detail are used to switch between the hierarchical 3D models based on the distance between the model and the viewpoint. The farther the model is from the viewpoint, the coarser the 3D model is loaded, reducing the amount of data loaded and rendered, thereby improving the rendering efficiency of 3D scenes with large amounts of data.
[0051] The following is combined with Figure 2 The specific process will be explained.
[0052] Figure 2 This application provides a flowchart illustrating a method for three-dimensional scene synthesis according to an embodiment.
[0053] like Figure 2 As shown, the method includes the following steps:
[0054] S1 utilizes 3D scene data to construct a multi-level detailed model.
[0055] This multi-level detail model includes 3D scene data with varying levels of detail.
[0056] The information included in the 3D scene data includes: the geometric information and texture information of the 3D model, as well as its geographic coordinates within the 3D scene. Each piece of information has a one-to-one correspondence with each 3D model, allowing the identification of the corresponding 3D model based on the relevant information.
[0057] A 3D scene can contain various types of 3D models. For example, a 3D scene based on a city residential area typically includes 3D models such as residential building models, green plant models, and traffic road facility models.
[0058] For example, in a 3D scene based on a natural landscape, the 3D models typically include: surface vegetation models, mountain models, river models, etc.
[0059] Level of Detail (LOD) models are created by simplifying a high-precision 3D model to varying degrees, resulting in 3D models with different levels of detail, ranging from fine to coarse.
[0060] In other words, the purpose of constructing multi-level detail models is to further differentiate the models within a selected 3D scene, so that the 3D models in the scene can be easily called separately according to their different levels of detail. Generally, coarser-level 3D models have a larger coverage area but lower detail, while finer-level models have higher detail but smaller coverage area.
[0061] The level of detail refers to the precision of a 3D model within a 3D scene. The phrase "different levels of detail" indicates that 3D models within a 3D scene do not necessarily possess the same level of precision. The precision of each 3D model can be different or the same; the rules for determining precision can be set according to the actual situation and are not limited here. Generally, a higher precision 3D model is closer to its real-world counterpart, with richer and more realistic details. A coarser 3D model, compared to a real-world object, exhibits greater distortion and coarser details.
[0062] In one example, the level of detail mentioned above can also be represented by the geometric length represented by a pixel in the texture of the 3D model. The larger the value of the geometric length, the less detailed the 3D model is, that is, the coarser the 3D model is.
[0063] In one example, the aforementioned level of detail can also be represented by the geometric error of the 3D model relative to the original model. The smaller the geometric error of the 3D model, the higher its level of detail and accuracy; the larger the geometric error of the 3D model, the lower its level of detail and accuracy.
[0064] S2 divides the spatial range of the 3D scene data into hierarchical partitions to obtain hierarchical partition information.
[0065] This hierarchical partitioning information includes partitioning information for each level. The spatial range of each level is divided into a corresponding number of partitions. The next level of partitioning is obtained by further subdividing the partitions of the previous level into sub-partitions. The level of detail in the partitioning of the previous level is less than that of the next level.
[0066] In one implementation, hierarchical partitioning information refers to the information of each level and partition obtained after a 3D scene is divided according to certain rules.
[0067] For example, the entire 3D scene is taken as the first level, which is the coarsest level. This level only has one partition, meaning it has the largest scope. Next, the first level is divided into two sub-partitions, which are the partitions of the second level. Each sub-partition in the second level has a smaller scope and a higher level of detail than the partition in the previous level; that is, the partitions in the second level are more precise than those in the first level.
[0068] Figure 3 This is a schematic diagram of the hierarchical partitioning of a three-dimensional scene. For example... Figure 3 As shown, A1 represents the first level of the entire 3D scene, indicating that the first level has only one partition. B1 to B4 are further subdivided based on A1, indicating that the second level has four partitions. This pattern continues, and further subdivisions can be made according to different requirements. This is just an example and not a limitation.
[0069] S3 generates a hierarchical partitioned 3D model based on the multi-level detail model and hierarchical partitioning information.
[0070] This hierarchical partitioning 3D model is used to generate multi-level detailed scenes.
[0071] In one implementation, each hierarchical partition has a multi-level detail model that matches its spatial extent. Multi-level detail models within the same hierarchical partition have similar levels of coarsness, which can also be understood as having similar levels of refinement. Based on the hierarchical partitioning relationship, the 3D model of each partition is generated layer by layer from bottom to top. The 3D model of each hierarchical partition is obtained by merging and simplifying the 3D models of its corresponding sub-partitions, thus generating the hierarchical partition 3D model.
[0072] Once a hierarchical partitioned 3D model is generated based on the multi-level detail model and hierarchical partitioning information, a multi-level detail scene can be generated, which means that the synthesis of the 3D scene has been achieved.
[0073] In one implementation, after obtaining the hierarchical partitioned 3D model, a suitable model can be selected for rendering instead of rendering all models, thereby improving rendering efficiency.
[0074] In one example, the above method also includes: selecting the model to be rendered from the hierarchical partitioned 3D model based on the viewpoint position and field of view, and then loading and rendering the model to be rendered.
[0075] In actual rendering, the greater the distance from the viewpoint and / or the larger the view area, the coarser the detail model should be loaded. This results in a smaller number of models to be loaded and rendered, and a smaller total data volume, leading to higher rendering efficiency. The relatively coarse detail model mentioned above can be considered an example of the model to be rendered. Therefore, switching between different multi-level detail models based on the distance between the model and the viewpoint can improve rendering efficiency.
[0076] The above method enables the synthesis of large-scale 3D scenes, resulting in multi-level detailed scenes organized according to hierarchical partitioning. Each level of detailed scene is divided into multiple partitions, with coarser-level partitions further subdivided into finer-level sub-partitions. Each partition contains a corresponding range of multi-level detailed models, and the multi-level detailed models within the same partition have similar levels of detail. The 3D model of a coarser-level partition is a simplified version of the 3D models of its corresponding finer-level partitions. The complexity of the 3D models across all partitions remains consistent and appropriate. This allows for hierarchical partitioned 3D models with varying levels of detail, enabling the selection of appropriate partitioned 3D models for loading and rendering based on viewpoint location and field of view. This avoids issues such as a large number of 3D model objects to load when the viewpoint is far away, numerous draw calls in the CPU stage, and high 3D model complexity in the GPU stage, thereby improving the rendering efficiency of 3D scenes.
[0077] Figure 4This application provides a flowchart illustrating a method for constructing a multi-level detail model according to one embodiment. Figure 4 It can be seen as Figure 2 A specific example of step S1. For example... Figure 4 As shown, the method includes the following steps:
[0078] S11, read 3D scene data.
[0079] In one implementation, corresponding to the data loading stage described above, the 3D model in the 3D scene is first read into memory. The texture and geometric information of the 3D model are then parsed into corresponding data structures. The texture information is parsed into a matrix ordered regularly by resolution, with each element containing corresponding color information. The geometric information is parsed into vertex data, edge composition indexes, and triangle composition indexes. The vertex data also includes the corresponding 3D coordinate position, normals, tangents, UV coordinates, color, bone weights, and other information. During loading, the information to be loaded can be selected based on the actual situation; this is merely an example and not a limitation.
[0080] S12 generates an optimized 3D model using 3D scene data.
[0081] In one implementation, the geometric and texture information of each 3D model in the 3D scene data is optimized to obtain optimized geometric and texture information.
[0082] Then, based on the optimized geometric and texture information, an optimized 3D model is obtained.
[0083] S12a, Geometric Information Optimization.
[0084] In one implementation, duplicate and invisible triangular faces are removed from the geometric information of the 3D model, or erroneous triangular faces are repaired, to obtain optimized geometric information.
[0085] S12b, texture information optimization.
[0086] In one implementation, the optimized geometric information is used as the basic geometric data, and the texture information of the 3D model is used to perform texture remapping on the 3D model to obtain the optimized texture information.
[0087] In one example, the most efficient texture resolution is first calculated. Then, using the optimized geometric information as the base geometric data, a texture remapping operation is performed on the 3D model to bake out a texture map that most efficiently utilizes the texture resolution as the optimized texture information. During the texture remapping process, the original UV area is used as the weight for mapping the new texture, ensuring that the UV area corresponding to the same triangle face remains unchanged before and after mapping, thus maintaining the matching relationship between texture information and geometric information.
[0088] The UV area represents the area of the triangle formed by the UV coordinates of the vertices of the triangle in the 3D model.
[0089] Correspondingly, the sum of all UV areas in the 3D model is the total UV area of the model. The total UV area of the model represents the sum of the areas of the triangles formed by the UV coordinates of all the vertices of the triangles in the model, and represents the total number of pixels corresponding to the model's triangular mesh.
[0090] Correspondingly, the most effective texture resolution is the square root of the total UV area of the model, raised to the power of 2, which represents the minimum regularized texture resolution required to satisfy the effective number of pixels.
[0091] S13, calculates the simplified parameters of the multi-level detail model.
[0092] This step includes calculating the LOD level, texture simplification parameters, and geometry simplification parameters, in preparation for subsequent simplification processing.
[0093] S13a, LOD level calculation.
[0094] Set the minimum texture resolution S in LOD. min Its value is limited to powers of 2. The optimized texture obtained by optimizing the texture information is used as the original texture information. If the texture resolution is less than or equal to S... min If the LOD level is greater than S, then the LOD level N = 1; min The optimized texture is used as the texture of the finest level of detail model, which is also the maximum texture resolution S of LOD. max If the texture resolution of the model is halved at each level of detail, from fine to coarse, then the number of LOD levels for this model is N = 1 + log2(S). max / S min ).
[0095] S13b, Calculation of texture simplification parameters.
[0096] The texture resolution of each level of detail model is calculated, with the finest level texture resolution S1 = S max The coarsest level texture resolution S N =S min Other texture resolutions S i =S max / 2 i-1Where i represents the i-th level. The clarity of texture information is halved with each level, ensuring a uniform decrease in the level of detail across all partitioned models, and consequently, a uniform change in loading distance. This allows for more ideal switching between partitioned models, avoiding frequent switching and preventing the loading of highly detailed partitioned models at greater distances from the viewpoint, thereby improving rendering efficiency and quality.
[0097] S13c, calculation of geometric simplification parameters.
[0098] The maximum error of geometric simplification at each level is calculated using the following steps:
[0099] Calculation of geometric pixel ratio at each level. Assuming the change in the total area of the triangular mesh during the simplification process at each level is negligible and is always GA, and the total UV area (UVA) at each level decreases by 1 / 4 with each level of resolution from the finest level, then the geometric pixel ratio at each level is calculated. Where i represents the i-th level.
[0100] Set the maximum number of pixels for geometric error (EP) max , which represents the maximum threshold number of pixels corresponding to the geometric errors caused by simplification at each level during rendering.
[0101] The maximum geometric simplification error at each level is the geometric length corresponding to the maximum number of pixels with the geometric error, i.e.:
[0102] E max,i =EP max *GPR i , where i represents the i-th level.
[0103] S14 simplifies the optimized 3D model to generate a LOD model.
[0104] In one implementation, the geometric information of the optimized 3D model is used to perform geometric simplification processing on the optimized 3D model to obtain a geometrically simplified 3D model.
[0105] In one implementation, the texture information of the optimized 3D model is used to perform texture simplification processing on the geometrically simplified 3D model to obtain a multi-level detail model.
[0106] The generation of detail models at each level is independent of each other. They are all derived from the optimization of the 3D model as the base model by simplification, including geometric information simplification, texture information simplification, and simplified model description parameter recording.
[0107] S14a, geometric information simplification.
[0108] In one implementation, critical rules for removing geometric elements at each level of the optimized 3D model are set.
[0109] The removal threshold rules include: the minimum number of geometric elements at each level and / or the maximum geometric simplification error at each level.
[0110] The geometric elements of the optimized 3D model are processed according to the first preset rule.
[0111] In one example, the first preset rule includes: sorting the geometric elements in ascending order based on the removal of geometric errors.
[0112] The geometric element with the smallest removal geometric error is removed until the critical removal rule for geometric elements is met, thus obtaining a geometrically simplified 3D model. After each removal of a geometric element, the removal geometric errors of the associated geometric elements are recalculated and reordered. The method for calculating the removal geometric error can vary depending on the actual data and application requirements; no specific method is applied here.
[0113] S14b, simplified texture information.
[0114] In one implementation, based on the geometrically simplified 3D model, texture simplification rules are set for each level. The texture pixel information corresponding to each triangle face in the geometrically simplified 3D model is remapped according to the texture simplification rules to obtain a multi-level detail model.
[0115] In one example, the texture resolution of this level, calculated using simplified parameters, is used as the target resolution for texture simplification. The texture pixel information corresponding to each triangle facet in the geometrically simplified 3D model is then remapped to the target resolution texture. During the texture remapping process, the geometric area of the triangle facets is used as the weight for mapping the new texture. This ensures that larger triangle faces in the simplified hierarchical detail model receive more pixels in the remapped texture, resulting in a more balanced overall texture detail in the model.
[0116] S14c, Model description parameter information record.
[0117] The geometric and texture information description parameters of the simplified model are calculated and recorded.
[0118] The geometric information description parameters include the total number of model vertices, the total number of model triangles, the total area of model triangles, model geometric error, model bounding box, and model bounding sphere.
[0119] Texture information description parameters include model texture resolution, total UV area, and geometric pixel ratio, which are combined with simplified geometric information description parameters to form the simplified hierarchical detail model information description parameters. Other related parameters can be extended according to actual data and application requirements; no limitations are imposed here.
[0120] S15, construct the LOD index for the LOD model.
[0121] In one implementation, a multi-level detail index is constructed for the multi-level detail model, and the multi-level detail index is used to retrieve the model hierarchy in the multi-level detail model.
[0122] In one implementation, the model description parameters of each level in the multi-level detailed model are transformed into corresponding nodes, with one node for each level. The node corresponding to the first level is taken as the parent node, and child nodes are assigned to different levels according to their level of detail. Then, parent-child relationships are established between the parent nodes and child nodes based on the hierarchical relationships.
[0123] In one example, the model description parameters are converted into tree nodes. The model description parameters for each level of detail are converted into nodes, with one node corresponding to each level. Each node records the texture data storage path, geometry data storage path, and corresponding description parameters for that level of model. These description parameters include: model bounding box, model bounding sphere, geometric pixel ratio, etc. Other relevant parameters can be added based on actual data and application requirements; no limitation is made here. Then, parent-child relationships are established between nodes. Nodes are connected according to their hierarchical relationship, with the node corresponding to the coarsest level as the parent node, proceeding downwards to the leaf nodes, which represent the finest level.
[0124] After the LOD model is built, the 3D scene can be divided into hierarchical partitions.
[0125] Figure 5 This is a flowchart illustrating a method for hierarchical partitioning of a three-dimensional scene according to an embodiment of this application. Figure 5 It can be seen as Figure 2 A specific example of step S2. For example... Figure 5 As shown, the method includes the following steps:
[0126] S21, Read the bounding box information of all 3D models in the 3D scene.
[0127] Read the bounding boxes of all 3D models in the scene. The bounding boxes are axially parallel bounding boxes, and the xyz axes coincide with the xyz axes of the 3D scene.
[0128] S22 calculates all the bounding boxes in the 3D model to obtain the spatial extent information of the 3D scene.
[0129] The bounding boxes of all 3D models in the scene are added together to obtain the bounding box of the entire scene, which represents the spatial extent of the entire scene.
[0130] S23, Set the critical conditions for hierarchical partitioning, and perform hierarchical partitioning according to these conditions.
[0131] In one implementation, the spatial range of the 3D scene data is divided into multiple levels according to a second preset rule to obtain hierarchical partitions of different spatial ranges.
[0132] In one example, the second presupposition rule includes: the minimum number of models C contained in the finest level. min Set as hierarchical partition Critical conditions for partitioning When the number of models contained in the finest level partition is less than or equal to C min When the time comes, stop dividing the hierarchical partitions.
[0133] Understandably, the division rules can be set according to the actual situation, and no restrictions are imposed here.
[0134] S24, divides the area into layers from top to bottom.
[0135] The 3D scene is divided into multi-level partitions, and the partition number and parent-child relationship of each level are recorded. This step can be divided into three cases: initialization of the top-level partition, partitioning of the second-to-top level partition, and partitioning of other levels partition.
[0136] The top-level partition is initialized by taking the bounding box of the 3D scene as the coarsest level, i.e. the top layer, and treating the entire layer as one partition.
[0137] The second-to-top level partitioning is performed using the top-level partition as the parent partition. The sub-partitioning rules are calculated based on the shape of the parent partition. The calculation method is as follows: calculate the ratio of the parent partition's x and y axes (long side / short side) and round it to R. Use R as the sub-partitioning ratio in the long and short side directions. That is, the long side direction is divided into R sub-partitions, and the short side direction is divided into 1 sub-partition. This yields the second-to-top level partitioning result, and all second-to-top level partitions are sub-partitions of the top-level partition.
[0138] For other hierarchical partitioning, the parent partition is used as the parent partition to divide the child partitions. The parent partition is divided into two parts along the x and y axes to obtain four child partitions, which are the result of the partitioning at this level. All child partitions at this level are child partitions of the parent partition.
[0139] S25 assigns the 3D model to the corresponding level of partition.
[0140] In one implementation, the 3D models in the 3D scene are matched to the corresponding hierarchical partitions according to their positional relationships, and then the spatial extent information of the hierarchical partitions is updated.
[0141] In one implementation, the 3D models contained within the spatial range of each partition are calculated based on their positional relationship with each 3D model in the scene. The inclusion relationship is calculated by the inclusion relationship between the center point of the bounding box of the 3D model and the bounding box of the partition.
[0142] S26, Update the partition range of the corresponding level.
[0143] The sum of the bounding boxes of all 3D models contained in the calculated partition is then updated to the bounding box of that partition.
[0144] S27, Critical condition judgment.
[0145] In one implementation, it is determined whether the number of matched 3D models within each level partition exceeds a preset range.
[0146] The critical condition includes determining whether the number of matched multi-level detail models within each level partition exceeds a preset range. This preset range can be set according to actual conditions and is not limited here.
[0147] When the critical condition is reached, that is, when the number of multi-level detail models within a hierarchical partition exceeds a preset range, the information of that hierarchical partition is recorded in the hierarchical partition information table corresponding to the hierarchical partition information, thus completing the division of the hierarchical partition.
[0148] In one implementation, if the critical condition is not met, steps S24 to S27 are repeated until the critical condition is met.
[0149] S28, records the hierarchical partition information table.
[0150] Record the partition number and parent-child relationship of each level partition in the hierarchical partition information table. Each row in the table is a partition information record, including partition number, parent partition number, set of child partition numbers, and a set of 3D models. The set of 3D models is only recorded in the lowest level partition.
[0151] Figure 6 This is a flowchart illustrating a method for generating a hierarchical partitioned 3D model according to an embodiment of this application. Figure 6 It can be seen as Figure 2 A specific example of step S3. For example... Figure 6 As shown, the method includes the following steps:
[0152] S31, Read the hierarchical partition information table.
[0153] Obtain information on partitions at each level and information on multi-level detailed models within each partition.
[0154] S32 retrieves partition information layer by layer from bottom to top.
[0155] Starting from the lowest level, retrieve the relevant information for each partition from the hierarchical partition information table.
[0156] S33, read the source model of each partition of this layer.
[0157] Based on the set of sub-partition numbers and the set of contained 3D models, obtain the source model for generating the 3D model of the partition. The source model here refers to all or part of the multi-level detail model mentioned above, and can be selected according to specific circumstances; no limitation is made here.
[0158] The source model for the lowest level partition is the coarsest level LOD model of each 3D model in its set of 3D models, while the source models for other level partitions are the 3D models generated by each subpartition in the set of subpartition numbers.
[0159] S34, calculate the parameters of the hierarchical partitioned 3D model based on the source model information.
[0160] The parameters of the hierarchical partition 3D model are calculated based on the information of the source model within each hierarchical partition. The parameters of the hierarchical partition 3D model are used to generate the hierarchical partition 3D model.
[0161] The hierarchical partitioning 3D model parameters are calculated based on the source model information to guide the generation of the 3D model, including the calculation of texture parameters and geometric parameters.
[0162] Texture parameter calculation includes geometric pixel ratio calculation and target texture resolution calculation.
[0163] Geometric Pixel Ratio (GPR) calculation. Based on the GPR of the source model. i The total area of the triangular face GA i Calculate the GPR of the partitioned 3D model. There are two possible calculation schemes: using the geometric area of the source model as the weight and taking the maximum value among the source models. The scheme using the geometric area of the source model as the weight uses the GPR of each source model. i GPR for weights i Weighted summation is performed, and the GPR of adjacent 3D models is set to increase by a factor of 2 from the finest level onwards. Therefore, the calculation method for the geometric pixel ratio of each level partition is GPR = 2 * (∑GPR). i *GA i ) / ∑GA i , where i represents the i-th level. The scheme of taking the maximum value in the source model is based on the GPR of each source model. i The maximum value in the range is used, and the GPR of the adjacent 3D model is set to increase by a factor of 2 from the finest level. Then the calculation method for the geometric pixel ratio of each level partition is GPR = 2 * Max(GPR). i ), where i represents the i-th level.
[0164] Target texture resolution calculation. Set minimum texture resolution S. min Assuming the change in the total area of the triangular mesh during the merging and simplification process of the 3D model can be ignored, the ideal total UV area of the hierarchical partitioned 3D model is calculated as UVA = ∑GA / GPR. 2 Then the target texture resolution S is the square root of UVA raised to the power of 2. If S is less than S... min Let S = S min .
[0165] Geometric parameter calculation. Calculation of the maximum error for geometric simplification. Setting the maximum number of pixels (EP) for geometric error. max This represents the maximum threshold number of pixels corresponding to the geometric error caused by simplification at each level during rendering. The maximum geometric simplification error is then the geometric length corresponding to the maximum number of pixels with the maximum geometric error, i.e., E. max =EP max *GPR;
[0166] S35, merge the source models to generate partitioned 3D models.
[0167] Merge all source models within each level of partition.
[0168] S36 simplifies the partitioned 3D model to generate a hierarchical partitioned 3D model.
[0169] Based on the maximum geometric simplification error and target texture resolution calculated from the parameters of the partitioned 3D model, the geometric and texture information of the partitioned 3D model is simplified. After the simplification process is completed, the hierarchical partitioned 3D model can be generated.
[0170] The methods for simplifying geometric information and texture information are the same as those described in S14a and S14b, and will not be repeated here.
[0171] Each level of the 3D model partition possesses independent geometric and texture information, allowing for independent loading. The data volume is moderate across all levels; coarser partitions have a larger coverage area but lower detail, while finer partitions have higher detail but smaller coverage. This ensures that the number of 3D models to be loaded within the viewport, the total data volume, and the complexity are independent of the viewpoint distance. This avoids the problems of frequent internal and external memory I / O and large total data volume caused by a large number of models to be loaded when the viewpoint is far away.
[0172] S37, Update the hierarchical partition 3D model information.
[0173] The 3D model obtained by merging and simplifying the source model is used as the 3D model corresponding to the partition. Its model information description parameters are calculated to obtain the information of the 3D model of the next partition.
[0174] S38, Update the hierarchical partition information table.
[0175] Record the 3D model and its description information corresponding to the hierarchical partition to the hierarchical partition information table.
[0176] After generating the hierarchical partitioned 3D model by completing the above steps, an index can be built for the hierarchical partitions of the 3D scene to facilitate retrieval and retrieval.
[0177] Figure 7 This is a flowchart illustrating a method for constructing a scene-level partition index according to an embodiment of this application.
[0178] like Figure 7 As shown, the method includes the following steps:
[0179] S41, Read the hierarchical partition information table.
[0180] S42 converts the partition information at each level into nodes.
[0181] The partition information at each level is converted into nodes, with one node corresponding to each level partition. The node records the data storage path of the 3D model corresponding to that level partition and the corresponding model description parameters.
[0182] The descriptive parameters include: model bounding box, model bounding sphere, geometric pixel ratio, etc. Other related parameters can be expanded according to actual data and application requirements, which are not limited here.
[0183] S43 connects the parent-child relationships of nodes layer by layer and partition by partition from top to bottom.
[0184] Based on the sub-partition information in each level of partitioning, parent-child relationships are established between partitions from top to bottom. Starting with the node corresponding to the coarsest level partition as the root node, nodes corresponding to sub-partitions in more refined levels are connected as child nodes, down to the most refined level partition.
[0185] S44, the finest level partition join LOD index.
[0186] The 3D model of the finest level partition corresponds to the coarsest level of the LOD model. In other words, the node corresponding to the finest level partition is the root node of the LOD index. Therefore, the LOD index is connected to the scene level partition index in the finest level partition.
[0187] S45, storage scenario hierarchical partition index.
[0188] The scene hierarchy partition index constructed in the above steps is stored in the scene hierarchy partition index table. This index can describe the spatial extent and 3D model information of each level partition, and can be used for viewpoint-based 3D model loading and scheduling, thereby avoiding the preloading of 3D scene data.
[0189] The foregoing mainly describes a three-dimensional scene synthesis method according to an embodiment of this application with reference to the accompanying drawings. It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially, these steps are not necessarily executed in the order shown in the figures. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps. The following describes an apparatus according to an embodiment of this application with reference to the accompanying drawings. For brevity, appropriate omissions will be made when describing the apparatus below; relevant content can be referred to in the relevant descriptions of the methods above, and will not be repeated.
[0190] Figure 8 This is a schematic diagram of the structure of a three-dimensional scene integration device provided in an embodiment of this application. Figure 8 As shown, a three-dimensional scene integration device 1000 includes:
[0191] Building unit 1001 is used to construct a multi-level detail model using 3D scene data. This multi-level detail model includes 3D scene data with different levels of fineness and coarseness. The 3D model can be optimized, errors corrected, and data redundancy reduced. Then, the 3D model is simplified to different degrees to obtain the multi-level detail model and the corresponding LOD index is constructed.
[0192] The partitioning unit 1002 is used to divide the spatial range of the 3D scene data into hierarchical partitions to obtain hierarchical partition information. The hierarchical partition information includes the partition information of each level. The spatial range of each level is divided into a corresponding number of partitions. The partition of the next level is obtained by further dividing the partition of the previous level into sub-partitions. The level of detail of the partition of the previous level is lower than that of the partition of the next level.
[0193] A method combining unrestricted quadtrees and hierarchical bounding boxes is used to divide the 3D scene into multiple hierarchical partitions. The spatial extent of each level is divided into multiple partitions, and the overall spatial extent of each level is the same as the scene spatial extent. Coarser-level partitions are further divided into multiple sub-partitions in adjacent finer-level partitions, until the finest-level partition is the spatial extent of the original single 3D model. Each level's spatial extent is divided into a corresponding number of partitions, and the next level's partitions are obtained by further subdividing the partitions of the previous level.
[0194] Generation unit 1003 is used to generate hierarchical partitioned 3D models based on multi-level detail models and hierarchical partitioning information. These hierarchical partitioned 3D models are used to generate multi-level detail scenes. Each hierarchical partition has a 3D model matching its spatial extent. 3D models within the same hierarchical partition have similar levels of detail, while the level of detail of 3D models in different hierarchical partitions decreases progressively from bottom to top. Based on the hierarchical partitioning relationship, the 3D models of each partition are generated layer by layer from bottom to top.
[0195] Figure 9 This is a schematic diagram of another three-dimensional scene integration device provided in an embodiment of this application. For example... Figure 9 As shown, a three-dimensional scene integration device 2000 includes:
[0196] The reading unit 2001 is used to read the 3D model in the 3D scene into memory and parse the texture information and geometric information of the 3D model into corresponding data structures.
[0197] Analysis unit 2002 is responsible for analyzing the texture and geometric information of the 3D model, including texture information analysis, geometric information analysis and overall information analysis.
[0198] Texture information analysis includes the calculation of the following parameters: number of textures, resolution of each texture, and total number of pixels in the texture.
[0199] Geometric information analysis includes the calculation of the following parameters: total number of model vertices, total number of model triangles, total area of model triangles, bounding box of model, and bounding sphere of model.
[0200] The overall information analysis includes the calculation of the following parameters: total UV area of the model, texture pixel utilization, most effective texture resolution, and model geometric pixel ratio.
[0201] The parameters mentioned above are just examples and are not limited here. Other relevant parameters can be added based on actual data and application requirements.
[0202] The total UV area of the model represents the sum of the areas of the triangles formed by the UV coordinates of all the vertices of the triangles in the model, and represents the total number of pixels corresponding to the model's triangular mesh.
[0203] Texture pixel utilization rate is the ratio of the total UV area of the model to the total number of texture pixels, that is, the proportion of effective pixels to the total number of pixels. The smaller the value, the more redundant the texture.
[0204] The most effective texture resolution is the square root of the total UV area of the model, raised to the power of 2, which represents the minimum regularized texture resolution required to satisfy the effective number of pixels.
[0205] The model geometry pixel ratio is the square root of the ratio of the total area of the model's triangles to the total area of the model's UVs. It represents the geometric length that one pixel in the model's texture represents. The larger this value is, the coarser the model is.
[0206] Index unit 2003 is used to construct the index relationship of the 3D model of each level partition.
[0207] In the index, each level of the 3D model is represented by a node. The node records the texture data storage path, geometric data storage path, and corresponding descriptive parameters for that level of the 3D model. The descriptive parameters include: the model's bounding box, the model's bounding sphere, and the geometric pixel ratio, etc. Other relevant parameters can be added based on the actual data and application requirements, which are not limited here.
[0208] Then, the nodes are connected according to their hierarchical partitioning relationships to establish parent-child relationships, thus completing the index construction.
[0209] Storage unit 2004 is used to store the 3D models of each level of partition and the scene level partition index. It stores the texture and geometric information of the 3D models of each level of partition, as well as the scene level partition index, in the database.
[0210] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of this application. Their specific functions and technical effects can be found in the method embodiments section, and will not be repeated here. Although the above-mentioned units are ordered, the calling of these units is not necessarily in the order shown in the figure. Unless explicitly stated herein, there is no strict order restriction when using these units.
[0211] This application also provides a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments.
[0212] Figure 10 This is a schematic diagram of the structure of the computer device provided in an embodiment of this application. Figure 10As shown, the computer device 3000 of this embodiment includes: at least one processor 3100 ( Figure 10 (Only one is shown) a processor, a memory 3200, and a computer program 3210 stored in the memory 3200 and executable on at least one processor 3100, wherein the processor 3100 executes the computer program 3210 to implement the steps in the above embodiments.
[0213] The processor 3100 can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0214] In some embodiments, memory 3200 may be an internal storage unit of computer device 3000, such as a hard disk or RAM of computer device 3000. In other embodiments, memory 3200 may be an external storage device of computer device 3000, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on computer device 3000. Furthermore, memory 3200 may include both internal and external storage units of computer device 3000. Memory 3200 is used to store operating system, application programs, boot loader data, and other programs, such as program code for computer programs. Memory 3200 may also be used to temporarily store data that has been output or will be output.
[0215] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units is merely an example. In practical applications, the above functions can be assigned to different functional units or modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0216] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.
[0217] This application provides a computer program product that, when run on a computer, can implement the methods described above.
[0218] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a computer device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0219] It should be understood that the sequence numbers of the steps in the above embodiments do not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In the description, specific details such as particular system structures and technologies are set forth for illustrative purposes rather than for limiting purposes, so as to provide a thorough understanding of the embodiments of this application. However, those skilled in the art should understand that this application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary details.
[0220] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0221] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0222] Furthermore, in the description of this application and the appended claims, the terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0223] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0224] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0225] In the embodiments provided in this application, it should be understood that the disclosed apparatus, computer equipment, and methods can be implemented in other ways. For example, the apparatus and computer equipment embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0226] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for synthesizing three-dimensional scenes, characterized in that, include: A multi-level detail model is constructed using 3D scene data, wherein the multi-level detail model includes 3D scene data of different levels of detail; The spatial range of the three-dimensional scene data is divided into hierarchical partitions to obtain hierarchical partition information. The hierarchical partition information includes partition information for each level. The spatial range of each level is divided into a corresponding number of partitions. The partition of the next level is obtained by further dividing the partition of the previous level into sub-partitions. The level of detail of the partition of the previous level is lower than that of the partition of the next level. A hierarchical partition 3D model is generated based on the multi-level detail model and the hierarchical partition information. The hierarchical partition 3D model is used to generate a multi-level detail scene. Based on the viewpoint position and / or field of view, select the model to be rendered from the hierarchical partitioned 3D model; Load and render the model to be rendered; The construction of a multi-level detail model using 3D scene data includes: An optimized 3D model is generated using the aforementioned 3D scene data; The optimized 3D model is simplified to generate the multi-level detail model; The process of simplifying the optimized 3D model to generate the multi-level detail model includes: The optimized 3D model is geometrically simplified using its geometric information to obtain a geometrically simplified 3D model. The texture information of the optimized 3D model is used to perform texture simplification processing on the geometrically simplified 3D model to obtain the multi-level detail model; The step of using the geometric information of the optimized 3D model to perform geometric simplification processing on the optimized 3D model to obtain a geometrically simplified 3D model includes: Set removal threshold rules for geometric elements at each level of the optimized 3D model. The removal threshold rules include: the minimum number of geometric elements at each level and / or the maximum geometric simplification error at each level. The geometric elements of the optimized 3D model are processed according to a first preset rule, which includes: sorting the geometric elements in ascending order according to the removal of geometric errors; The geometric element with the smallest removal geometric error is removed until the removal critical rule of the geometric element is met, thereby obtaining the geometrically simplified 3D model. After each removal of a geometric element, the removal geometric error of the geometric elements associated with the removed element is recalculated and sorted.
2. The method as described in claim 1, characterized in that, The process of generating an optimized 3D model using the 3D scene data includes: The geometric and texture information of each 3D model in the 3D scene data are optimized to obtain optimized geometric and texture information. The optimized 3D model is obtained based on the optimized geometric information and the optimized texture information.
3. The method as described in claim 1, characterized in that, The optimization of the geometric information and the texture information to obtain optimized geometric information and optimized texture information includes: Remove duplicate and invisible triangular faces or repair erroneous triangular faces from the geometric information of the 3D model to obtain the optimized geometric information; Using the optimized geometric information as the basic geometric data, the texture information of the three-dimensional model is used to perform texture remapping on the three-dimensional model to obtain the optimized texture information.
4. The method as described in claim 1, characterized in that, The process of using the texture information of the optimized 3D model to perform texture simplification processing on the geometrically simplified 3D model to obtain the multi-level detail model includes: Based on the geometrically simplified 3D model, texture simplification rules are set for each level. The texture pixel information corresponding to each triangle face in the geometrically simplified 3D model is remapped according to the texture simplification rules to obtain the multi-level detail model.
5. The method as described in claim 1, characterized in that, The method further includes: Constructing a multi-level detail index for the multi-level detail model, wherein the multi-level detail index is used to retrieve model levels in the multi-level detail model; the construction of the multi-level detail index for the multi-level detail model includes: The model description information of each level in the multi-level detail model is converted into a corresponding node, with each level corresponding to one node. The node corresponding to the first level is taken as the parent node. Child nodes are assigned to different levels according to the level of refinement. Then, the parent node and the child node are connected according to the hierarchical relationship.
6. The method as described in claim 1, characterized in that, The process of dividing the spatial range of the three-dimensional scene data into hierarchical partitions to obtain hierarchical partition information includes: Read and calculate the bounding box information of each 3D model in the 3D scene data to obtain the spatial range information of the 3D scene data; The spatial range of the 3D scene data is divided into multiple levels according to the second preset rule to obtain hierarchical partitions of different spatial ranges; the second preset rule includes: the minimum number of models C contained in the finest level. min The critical condition for hierarchical partitioning is set as follows: when the number of models contained in the finest hierarchical partition is less than or equal to C. min When the time comes, stop dividing the hierarchical partitions; The three-dimensional models in the three-dimensional scene are matched to the corresponding hierarchical partitions according to their positional relationships, and then the spatial range information of the hierarchical partitions is updated. Determine whether the number of matched 3D models within each of the hierarchical partitions exceeds a preset range; When the number of multi-level detail models within the hierarchical partition exceeds the preset range, the information of the hierarchical partition is recorded in the hierarchical partition information table corresponding to the hierarchical partition information, thus completing the division of the hierarchical partition.
7. The method as described in claim 1, characterized in that, The step of generating a hierarchical partitioned 3D model based on the multi-level detail model and the hierarchical partitioning information includes: Read the hierarchical partition information table to obtain the partition information of each level and the information of the multi-level detail model within each partition; The parameters of the hierarchical partition 3D model are calculated based on the information of the multi-level detail model within each hierarchical partition, and the parameters of the hierarchical partition 3D model are used to generate the hierarchical partition 3D model. Merge the multi-level detail models within each of the aforementioned partitions; The partitioned 3D model is simplified to generate the hierarchical partitioned 3D model.
Citation Information
Patent Citations
Three-dimensional geographic data-oriented transmission and rendering method and system
CN111858828A
Urban landscape model three-dimensional visualization method and system, medium and electronic equipment
CN111932668A