Three-dimensional visualization method, system, medium and electronic equipment for urban landscape model
Technical Field
The invention relates to the field of three-dimensional visualization, in particular to a three-dimensional visualization method, a three-dimensional visualization system, a three-dimensional visualization medium and an electronic device for an urban landscape model.
Background
With the continuous acceleration of urban construction process, the application of three-dimensional landscape modeling technology is increasingly gaining attention. In the computer, the real world is reproduced and modeled in the form of three-dimensional landscape modeling, and the important role of the real world is self-evident to the urban development and construction planning, and the range of the real world comprises the urban development, planning and management, traffic, communication, tourism, public safety and the like.
The visualization of three-dimensional scenes is one of the core contents of digital cities, smart cities and even digital earth which are built at present. In recent years, the demands of people for expressing and processing various three-dimensional information in urban environments are increasingly urgent, and the continuous pursuit of large-range, high-quality and high-resolution three-dimensional visual effects makes scene models need to be established not only for expressing single buildings or building groups, but also for establishing landscape models of the whole city. Therefore, the processed data is no longer limited to several buildings or several urban cells, but all three-dimensional information that needs to be expressed in the whole urban area. As a comprehensive representation of the geographic world, the context information is not just static spatio-temporal data, but also has implicit or explicit associations with processes and relationships. This requires that the geographic scene visualization model pursue finer detail presentation, more glaring landscape simulation, richer illumination rendering effects, and more convenient and smooth interactive operations. However, with the increase of the model precision, the three-dimensional data volume is huge, and the data volume of some data can reach TB level, which brings great challenges to three-dimensional visualization. At present, the contradiction between the limited computer drawing capability and the massive geospatial data is a key problem for the visualization of the massive data.
In view of the above, in order to overcome the technical defects, it is an urgent problem in the art to provide a three-dimensional visualization method for an urban landscape model.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a three-dimensional visualization method for an urban landscape model, which can reasonably organize and manage, store and transmit mass data and schedule the mass data in real time, thereby greatly improving the experience of users.
In order to solve the technical problems, the technical scheme of the invention is as follows: the three-dimensional visualization method of the urban landscape model is characterized by comprising the following steps of:
101. partitioning the large scene landscape model: dividing a space model of a large scene, and dividing each element to different space positions to achieve the aim of relatively uniform overall distribution of the space model;
102. constructing a hierarchical model: carrying out hierarchical simplification on various entity models in a scene, and constructing a hierarchical model irrelevant to a viewpoint;
103. merging block model elements for model merging;
104. rendering and cutting three-dimensional model data: reducing the data volume in the rendering queue, and rendering the three-dimensional model;
105. and (3) top-level node dynamic merging: dynamically merging scene nodes according to space division;
106. and the cache data is compressed and stored for compression and storage of the data.
According to the above technical scheme, in the step 101, the large scene landscape model blocks include large scene landscape model non-aggregated data blocks and large scene landscape model aggregated data blocks.
According to the technical scheme, the large scene landscape model non-aggregated data partitioning method comprises the following steps:
201. when the layer data is processed, determining the number of blocks according to the number and the area of the elements of the data;
202. according to the parameters of the blocks, each data is uniquely determined into one block;
203. generating LOD data of different levels aiming at each piece of data, and removing and simplifying the model in the data according to different LODs;
204. in the process of generating the LOD, judging according to whether the elements can be subdivided, if the data can be subdivided, carrying out subdivision operation of dividing into four parts and the like to form a data organization form of a quadtree; otherwise, executing the simplification process according to whether the setting is simplified and the related parameters;
205. and aiming at the data after the block division, each block of data is corresponding to a unique paging table for paging scheduling display and data unloading.
According to the technical scheme, the large scene landscape model aggregation type data blocking method comprises the following steps:
301. adopting a quad-tree scheduling mode aiming at the aggregated data, and assigning each element to a certain leaf node in the quad-tree;
302. after all data are assigned, merging leaf nodes and performing material batch processing on each quadtree box in the quadtree, and generating LOD data according to the data volume;
303. organizing the generated data into a quad tree organization form;
304. and performing scheduling display and data unloading by using a quadtree scheduling mode.
According to the above technical solution, in the step 102, the simplification of the solid model includes the following sub-steps:
1021. simplifying the geometry;
1022. and (5) element filtering.
According to the above technical solution, in the step 103, all model vertices and index data are fused into a buffer area during merging, and texture is fused into a texture picture.
According to the above technical solution, in the step 104, the data amount in the rendering queue is reduced through three aspects of scene distance clipping, pixel clipping, and cone clipping.
A three-dimensional visualization system of an urban landscape model is characterized in that: which comprises
The large scene landscape model partitioning unit is used for partitioning the space model of the large scene, and partitioning each element to different space positions to achieve the purpose of relatively uniform overall distribution of the space model;
the system comprises a construction level model unit, a view point independent level model unit and a view point independent level model unit, wherein the construction level model unit is used for carrying out level simplification on various entity models in a scene and constructing view point independent level models;
the block model element merging unit is used for merging models;
the rendering and cutting unit of the three-dimensional model data is used for reducing the data volume in the rendering queue and rendering the three-dimensional model;
the top-level node dynamic merging unit is used for dynamically merging the scene nodes according to space division;
and the cache data compression storage unit is used for compressing and storing the data.
A computer-readable medium, on which a computer program is stored which, when being executed by a processor, is adapted to carry out the method as set forth in the preceding claims.
An electronic device, comprising:
one or more processors;
memory having one or more programs stored thereon, which when executed by the one or more processors, perform the method as described in the previous claims.
Compared with the prior art, the invention has the following beneficial effects:
the method can reasonably organize and manage, store and transmit mass data and schedule in real time, and improves and controls the rendering process by using the algorithm, so that the rendering of various large-scale complex scenes is accelerated on the premise of ensuring the sense of reality, the execution efficiency of three-dimensional interactive software is improved, and the user experience is greatly improved.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of the present invention;
FIG. 2 is a block flow diagram of non-aggregated data of a large-scale scene landscape model according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a large-scene landscape model aggregation type data blocking process according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Many aspects of the invention are better understood with reference to the following drawings. The components in the drawings are not necessarily to scale. Instead, emphasis is placed upon clearly illustrating the components of the present invention. Moreover, in the several views of the drawings, like reference numerals designate corresponding parts.
The word "exemplary" or "illustrative" as used herein means serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" or "illustrative" is not necessarily to be construed as preferred or advantageous over other embodiments. All of the embodiments described below are exemplary embodiments provided to enable persons skilled in the art to make and use the examples of the disclosure and are not intended to limit the scope of the disclosure, which is defined by the claims. In other instances, well-known features and methods are described in detail so as not to obscure the invention. For purposes of the description herein, the terms "upper," "lower," "left," "right," "front," "rear," "vertical," "horizontal," and derivatives thereof shall relate to the invention as oriented in fig. 1. Furthermore, there is no intention to be bound by any expressed or implied theory presented in the preceding technical field, background, brief summary or the following detailed description. It is also to be understood that the specific devices and processes illustrated in the attached drawings, and described in the following specification are simply exemplary embodiments of the inventive concepts defined in the appended claims. Hence, specific dimensions and other physical characteristics relating to the embodiments disclosed herein are not to be considered as limiting, unless the claims expressly state otherwise.
Referring to fig. 1 to 3, the present invention discloses a three-dimensional visualization method for an urban landscape model, which is different in that the method comprises the following steps:
101. partitioning the large scene landscape model: and dividing the space model of the large scene, and dividing each element to different space positions to achieve the aim of relatively uniform distribution of the whole space model.
In the embodiment of the invention, aiming at the characteristics of a large-scale three-dimensional space model, the display mode is mainly that the model is paved in a three-dimensional scene, the existing height difference is very small, and meanwhile, for a single model or element, the height of a space bounding box is not the main factor for determining the spatial position distribution of the model or element relative to the whole large scene range, but the plane distribution is the main factor for considering. Therefore, according to the quadtree division, the space model of the large scene is divided, and each element is divided to different space positions, so that the purpose that the whole space model is distributed uniformly is achieved.
102. Constructing a hierarchical model: and carrying out hierarchical simplification on various entity models in the scene, and constructing a hierarchical model irrelevant to the viewpoint.
In the embodiment of the invention, after the whole scene element model is divided according to the quadtree, various entity models in the geographic scene are hierarchically simplified by using a simplification algorithm, and a viewpoint-independent hierarchical model (LOD) is constructed; level of Detail (LOD) technology refers to determining resource allocation of object rendering according to the position and importance of a node of an object model in a display environment, and reducing the area and Detail of an unimportant object, thereby obtaining high-efficiency rendering operation. The hierarchical detail algorithm is one of the main methods for reducing the complexity of a scene and improving the model display rate. By utilizing the technology, the finer levels can be drawn at a near place, the more general levels can be drawn at a far place, the burden of drawing the display card is reduced, and a high-efficiency rendering effect is obtained.
103. And combining block model elements for model combination.
In the embodiment of the invention, for the landscape model under a large scene, most model data are of a simpler triangular mesh patch structure, and the triangular meshes are few, but the triangular meshes belong to different model elements, so that the elements are many, the scene node data amount in the rendering process is increased, and the scene node scheduling is slow and the rendering performance is low. The method requires element batch processing, combines all small and fine models into a large geometric model for batch rendering, improves the utilization rate of scene nodes, improves the data throughput of rendering, improves the working capacity of a rendering pipeline, and further improves the whole display efficiency.
In order to reduce the batch of model data rendering, the model data of a plurality of models need to be merged into one batch for processing, when the models are merged, all model vertexes and index data are merged into one buffer area, meanwhile, material textures are merged into one large texture picture through a corresponding algorithm to form TextureAtlas, and when the TextureAtlas is formed, texture coordinates of the model data need to be updated according to a texture merging mode. In the process of texture merging, different groups can be formed according to the resolution of textures, and a certain range of repeated mapping problems can be supported.
104. Rendering and cutting three-dimensional model data: and reducing the data volume in the rendering queue and rendering the three-dimensional model.
In the embodiment of the invention, the scene node scheduling is carried out with the elimination work of the node pixel bounding boxes, so that the elimination work of a large number of scene nodes in a large scene is mainly reduced, and the rendered objects are also reduced. The data volume in the rendering queue is reduced mainly through three aspects of scene distance clipping, pixel clipping and cone clipping, and the three-dimensional model rendering efficiency is improved.
105. And (3) top-level node dynamic merging: and dynamically combining the scene nodes according to space division.
In the embodiment of the invention, a large number of scene nodes exist under the condition of large scene data browsing, the traversal elimination of the scene nodes is indispensable work and is mainly executed by a CPU (central processing unit), and in order to reduce the expense on the CPU, the scene nodes are dynamically combined according to space division.
106. And the cache data is compressed and stored for compression and storage of the data.
In the embodiment of the invention, the cache compression is mainly used for the browsing efficiency of the client, compressing data and reducing the network transmission amount.
Specifically, in step 101, the large scene landscape model blocks include large scene landscape model non-aggregated data blocks and large scene landscape model aggregated data blocks.
In a three-dimensional scene, two common data distribution characteristics can appear, namely that data is tiled in the scene and has a large area but does not belong to aggregated data, and that data is aggregated in the scene and has a small overall area.
Aiming at the processing of non-aggregated data, the main technical principle is to expand according to the ideas of data merging, batch rendering and reduction of DrawCall.
Specifically, the non-aggregated data partitioning of the large scene landscape model comprises the following steps:
201. when the layer data is processed, calculating the number of blocks according to the number, the area and the like of elements of the data;
202. determining each data into a block uniquely according to the parameters of the block;
203. generating LOD data of different levels aiming at each piece of data, and removing and simplifying the model in the data according to different LODs;
204. in the process of generating the LOD, whether the elements can be subdivided or not is judged, and if the data can be subdivided, the data is subdivided into four parts, so that a data organization form of a quadtree is formed. Otherwise, executing the simplification process according to the simplification and the parameters;
205. and aiming at the data after the block division, a paging scheduling technology is used for corresponding each block of data to a unique paging table for paging scheduling display and unloading the data.
Specifically, the large scene landscape model aggregation type data partitioning method comprises the following steps:
301. adopting a quad-tree scheduling mode aiming at the aggregated data, and assigning each element to a certain leaf node in the quad-tree;
302. after all data are assigned, merging leaf nodes and performing material batch processing on each quadtree box in the quadtree, and generating LOD data according to the data volume;
303. organizing the generated data into a quad tree organization form;
304. and performing scheduling display and data unloading by using a quadtree scheduling mode.
Specifically, in the step 102, the simplification of the solid model includes the following sub-steps:
1021. simplifying the geometry;
1022. and (5) element filtering.
In the embodiment of the invention, the simplified entity model comprises two steps: 1. the method has the advantages that the method is simple in geometry, the number of triangular surfaces is reduced, the number of triangular surfaces at a far position is small, rendering pressure is reduced, the number of triangular surfaces at a near position is large, and a fine model is displayed; 2. element filtering, filtering smaller models at a far distance, reducing rendering objects in the GPU, reducing rendering pressure, and loading all models at a near part to ensure the integrity of the models.
Specifically, in step 103, during merging, all model vertices and index data are merged into one buffer, and material textures are merged into one texture picture.
Specifically, in the step 104, the data amount in the rendering queue is reduced through three aspects of scene distance clipping, pixel clipping, and view frustum clipping.
A three-dimensional visualization system of an urban landscape model is characterized in that: which comprises
The large scene landscape model partitioning unit is used for partitioning the space model of the large scene, and partitioning each element to different space positions to achieve the purpose of relatively uniform overall distribution of the space model;
the system comprises a construction level model unit, a view point independent level model unit and a view point independent level model unit, wherein the construction level model unit is used for carrying out level simplification on various entity models in a scene and constructing view point independent level models;
the block model element merging unit is used for merging models;
the rendering and cutting unit of the three-dimensional model data is used for reducing the data volume in the rendering queue and rendering the three-dimensional model;
the top-level node dynamic merging unit is used for dynamically merging the scene nodes according to space division;
and the cache data compression storage unit is used for compressing and storing the data.
In some possible embodiments, the aspects of the invention may also be implemented as a computer-readable medium, on which a computer program is stored, which, when being executed by a processor of an electronic device, is adapted to carry out the steps of the method according to various embodiments of the invention described in the above-mentioned solutions of the present description.
In some other embodiments of the present invention, the electronic device includes a memory storing one or more programs, and one or more processors, which when executing the one or more programs, are also configured to perform the above-described method steps.
It should be noted that: the above-mentioned medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the consumer electronic device, partly on a remote electronic device, or entirely on the remote electronic device or server. In the case of remote electronic devices, the remote electronic devices may be connected to the consumer electronic device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external electronic device (e.g., through the internet using an internet service provider).
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, an electronic device according to embodiments of the present invention may include at least one processor, and at least one memory. Wherein the memory stores a program (computer program) which, when executed by the processor, causes the processor to perform the steps of the method according to various embodiments of the present invention described in the above-mentioned technical solutions of the present specification.
The method mainly aims to solve the problems that under the condition of limited graphic hardware technology, how to fully mine and exert the computing power of heterogeneous cooperation of a Graphic Processor (GPU), a general multi-core processor and the CPU/GPU, reasonably organize, manage, store, transmit and schedule mass data in real time, and improve and control the rendering process by using an algorithm, so that the rendering of various large-scale complex scenes is accelerated on the premise of ensuring the sense of reality, the execution efficiency of three-dimensional interactive software is improved, and the user experience is greatly improved.
The foregoing is a more detailed description of the present invention that is presented in conjunction with specific embodiments, and the practice of the invention is not to be considered limited to those descriptions. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.