This application claims the priority of Korean Patent Application No. 10-2014-0014101, filed on Feb. 7, 2014 in the KIPO (Korean Intellectual Property Office). Further, this application is the National Phase application of International Application No. PCT/KR2014/002497 filed Mar. 25, 2014, which designates the United States and was published in Korean.
1. Technical Field
The present invention relates to a method for rendering a terrain, and more particularly, to a method for rendering a multi-resolution terrain using GPU tessellation.
2. Description of the Related Art
Terrain rendering is used in various fields including a geographic information system (GIS), a flight simulation, an interactive computer game, and the like. As a method for the terrain rendering, a triangular mesh or other polygonal models are commonly used.
Since the size of a capacity of geographic information data required for the terrain rendering is very large, from hundreds of GB to tens of TB, techniques capable of rendering the geographic information data by simplifying a mesh based on a viewpoint of a user and a curve of a surface need to be applied in order to render the geographic information data in real time. As a related prior document, Korean Patent Registration No. 10-0726031 is provided.
The terrain rendering techniques can be generally classified into two groups. A first group is a group using a regular hierarchical structure and the a most representative example is hierarchies of right triangles (HRT). A second group is triangulated irregular networks (TINs). Since the TINs can unevenly sample a terrain, the number of unnecessary triangles can be minimized, but a complicated calculation and a larger storage space are required to achieve multi-resolution.
Therefore, recently, a research into the terrain rendering technique for efficiently achieving the multi-resolution has been demanded.
An aspect of the present invention provides a method for rendering a terrain, which can achieve multi-resolution while solving a crack problem
According to an aspect of the present invention, there is provided a method for rendering a terrain using GPU tessellation, including: generating a quad patch to which an inner tessellation factor and an edge tessellation factor are allocated by using a quadtree including a parent node and child nodes; generating a base mesh b using the quad patch; and restoring a terrain by applying a displacement map to the base mesh.
According to another aspect of the present invention, there is provided an apparatus for rendering a terrain using GPU tessellation, including: a calculation processing unit generating a quad patch to which an inner tessellation factor and an edge tessellation factor are allocated by using a quadtree including a parent node and child nodes; and a graphic processing unit generating a base mesh by using the quad patch and restoring a terrain by applying a displacement map to the base mesh.
Additional aspects and advantages of the present invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
100: Terrain rendering apparatus
110: Preprocessing unit
120: Calculation processing unit
130: Graphic processing unit
Hereinafter, a method and an apparatus for rendering a terrain according to embodiments of the present invention will be described with reference to the drawings.
Singular expressions used in the present specification include plural expressions unless they have definitely opposite meanings in the context. In the present specification, a term such as “comprising” or “including” should not be interpreted as necessarily including all various components or various steps disclosed in the specification, and it should be interpreted that some component or some steps among them may not be included or additional components or steps may be further included.
As illustrated in
The preprocessor 110 may perform a preprocessing procedure before performing terrain rendering. For example, the preprocessing unit 110 may measure object space errors and parameterize a terrain mesh to generate a geometry image. The object space errors and the geometry image will be described below.
The calculation processing unit 120 may calculate and generate various data for performing the terrain rendering in the graphic processing unit 130. For example, the calculation processing unit 120 may generate quadtree and determine an inner tessellation factor by using the measured object space errors. In addition, the calculation processing unit 120 may determine an edge tessellation factor by using the inner tessellation factor.
The graphic processing unit 130 may perform the terrain rendering by using data processed by the calculation processing unit 120. The graphic processing unit 130 may be a graphic processing unit (GPU). For example, the graphic processing unit 130 may restore the terrain by using quad patch information generated at the calculation processing unit. One node among a plurality of nodes included in the quadtree may become a quad patch.
The total number of tessellation factors which need to be considered per quad patch is 6. These 6 tessellation factors include 4 tessellation factors for each edge and 2 inner tessellation factors corresponding to horizontal and vertical splitting numbers therein.
Operations performed by the calculation processing unit 120 and the graphic processing unit 130 are performed every frame unlike the preprocessing unit 110.
The preprocessing unit 110 may measure the object space errors (S210). The object space errors may be used to acquire a screen-space error. A value indicating that the object space errors correspond to how many pixels on a screen is the screen-space error. The object space errors may be measured by the following method.
Hereinafter, in the embodiment, a case in which a displacement map has a resolution of a maximum of 513×513 will be described as an example. In this case, the maximum resolution which may be processed by the graphic processing unit 130 is 65×65 due to a hardware limit.
In respect to the object space errors, in a preprocessing step, a height in each mesh vertex is compared with a height of the mesh vertex at 512 levels while sequentially decreasing the resolution of the terrain to calculate a difference between both heights and finally, a largest value is determined as the object space error at each level, as shown in
The screen-space error is a value indicating that the object space error corresponds to how many pixels when the object space error is projected to a screen space (an actual location shown on a monitor).
The calculation processing unit 120 may generate the quadtree and determine an inner tessellation factor by using the screen-space error (S220). Since each node has the inner tessellation factor corresponding to a multiple of 2 and the maximum resolution which may be processed by the graphic processing unit 130 is 65×65, the inner tessellation factor may have a value of a maximum of 64.
When the quadtree is configured first, the configuration of the quadtree starts from a most sparse level (Level 1). In respect to the object-space error region of each 8×8, the corresponding error is positioned at a point closest to the viewpoint in the region and projected to the screen-space to obtain the screen-space error value. When the screen-space error is smaller than a predetermined threshold, the inner tessellation factor of the corresponding tile is set to 1.
However, when the screen-space error is larger than the threshold, while the level is increased one by one, the level is repeatedly increased until the error value becomes the threshold or more. When the inner tessellation factor of the tile is larger than 64, since the error exceeds a limit of the GPU, the tile is split into 4 patches (that is, child nodes are generated) and the error value depending on the level is measured with respect to each of the split patches. When the maximum resolution of the terrain is 513×513, a depth of the quadtree is limited to 4.
In addition, in the following embodiment, it is assumed and described that the inner tessellation factor corresponding to the horizontal splitting number and the inner tessellation factor corresponding to the vertical splitting number have the same value.
When the inner tessellation factor is determined with respect to all child nodes (leaf nodes), the calculation processing unit 120 may calculate an edge tessellation factor (S230).
Since the number of triangles generated through tessellation is maximally reduced, the calculation processing unit 120 may determine a minimum edge tessellation factor value which satisfies the threshold. The minimum edge tessellation factor value is determined by breadth-first circulating the quadtree.
In
Since a minimum number which satisfies the conditions is 4, the calculation processing unit 120 sets a left edge tessellation factor on a left of the node A to 4 and divides 4 by halves and sets the edge tessellation factor of 2 to each of the nodes B and C according to the edge length ratio.
In regarding an upper edge of the node A, the node A shares the edge with nodes D, E, and F having different sizes. A largest value among inner tessellation factor values which are increased according to the length ratio in the nodes D, E, and F is 64. In addition, since the inner tessellation factor of the node A is 8, the edge tessellation factor is in the range of [8 to 64]. Herein, the value which satisfies two conditions described above is 8. Therefore, the upper edge tessellation factor of the node A is set to 8 and while 8 is divided according to the length ratio in the nodes D, E, and F, the edge tessellation factors of the nodes D, E, and F have values of 4, 2, and 2, respectively.
In regarding a lower edge of node G, nodes B and H smaller than node G are positioned and a value of the node G is 1 and a value depending on a length ratio of the nodes B and H is 4. Therefore, the edge tessellation factor is in the range of 1 to 4. Herein, since 1 may not be divided according to the length ratio and 1 may not satisfy condition #2, 2 is determined as a lower edge tessellation factor of the node G and at the same time 1 is set to each of the nodes H and B. The smaller value of inner tessellation factors of nodes E and I having the same size is 16, and as a result, the value is determined as the edge tessellation factors of the nodes E and I.
When the resolution of the tile is determined by the aforementioned method, the multi-resolution may be provided without a crack. The process is similarly applied even to the edge shared by two tiles. To this end, before the edge tessellation factor is calculated, quadtree data and the inner tessellation factor values for all tiles in view frustum need to be determined.
The calculation processing unit 120 may generate the quad patch illustrated in
Information on the quad patch may be input into the graphic processing unit 130. The graphic processing unit 130 may perform the terrain rendering by using the input quad patch information and a tessellator (S250).
First, the quad patch information is used as an input of the graphic processing unit 130. The quad patch information is information used for make a flat base mesh called semi-uniform (u,v) grid. The terrain is restored by moving each point of the base mesh on a 3D coordinate system by using a height value (at the time of applying the height map to the displacement map) or a vector value (at the time of applying the FGI to the displacement map) in domain shader later.
The hull shader serves to transfer the tessellation factor determined by the calculation processing unit 120 to the tessellator. Tessellator is a part that actually generates semi-uniform (u,v) grid which is a patch having a resolution matching with the input tessellation factor. The generated grid restores a final terrain by moving each point by using information on the terrain referred to the displacement map to perform the rendering in a domain shader step. The displacement map may include the height map, the geometry image, and the like. An example of the geometry image includes the feature preserving geometry image (FGI) considering a variation rate.
When a technology that restores the terrain by using the height map cannot have the sufficient resolution, the terrain in which the variation rate is high cannot be normally restored. However, when the FGI is used, more apexes are positioned at the point where the variation rate is high to more excellently restore the terrain with a lower resolution.
As illustrated in
Where, Cv represents a variable to measure a bending degree, Sv represents a value given to increase weight with respect to a point included in ridge, and Av represents the sum of triangular area sharing a vertex v. Further, α represents a user-define parameter and θe represents an external dihedral angle of edge e connected to v. The weight may be construed as the variation rate, the point where the variation rate is high has a large weight, and a point where the variation rate is small has a small weight.
As shown in
Meanwhile, when the FGI is used, the crack may be prevented by performing a Zippering process in a preprocessing step.
Since the FGI is acquired by texturizing a value acquired through sampling after parameterization, a minute value difference occurs in a boundary region. Even though two tile type textures adjacent to each other refer to the same region in the boundary, the minute value difference occurs, and as a result, two textures do not have the completely same value, thereby bringing about the crack. A method which adjusts the same value by selecting one of two textures having boundaries adjacent to each other and forcibly copying data in the corresponding boundary region to the other texture in order to prevent the crack is referred to as Zippering.
Meanwhile, according to an embodiment of the present invention, after the quadtree of the tile is configured one time as described above, the quadtree may be updated in real time as the position of a view is changed. Each of the quadtrees used in the previous frame is updated through merging and splitting processes to configure a multi-resolution tile by using calculation resources still less than those when configuring the quadtree first.
When the view is changed, the calculation processing unit 120 first performs merging. In the merging, the screen-space error is measured by using tessellation factor 64 with respect to parent nodes having four child nodes (leaf nodes) by using bottom-up and breadth-first methods and when the error is the threshold or less, merging of removing the lead node is performed and otherwise, calculation of a method for just leaving the leaf node is performed.
In more detail, first, the merging is performed with respect to a node which need not be densely expressed any longer. The screen space error of a current node is measured, and when it is determined that the screen space error has the sufficient resolution (the error is the threshold or less), the screen space error is measured even in other children having the same parent node thereas. Even here, when the error is the threshold or less, last, the screen space error is again measured even in the parent node once again. Even here, when it is determined that the error has the sufficient resolution, since four child nodes need not be maintained, four child nodes are removed and only the parent node is left. Such a process is the merging.
After the merging is performed, the splitting is performed.
The screen space error is measured with tessellation factor 64 with respect to each of the child nodes (leaf nodes) to check whether the screen space error is the error threshold or less. When the error is more than the threshold, the splitting of generating four leaf nodes is performed.
In more detail, in the splitting, it is determined whether the measured screen space error is the threshold or less by considering a location of Camera which varies while circulating nodes at a last terminal. When the error is larger than the threshold, since the error may not have the sufficient resolution, the node is additionally split to generate four child nodes. Such a process is the splitting.
The merging and the splitting may be performed while satisfying a multi-resolution scheme given below.
The terrain rendering method according to the embodiment of the present invention can solve the crack problem while achieving the multi-resolution.
Further, according to the embodiment of the present invention, while the terrain can be rendered rapidly by using the tessellator of the GPU, an adaptive resolution can be determined according to the curve information of the terrain and the location of the camera to minimize rendering resources which are unnecessarily consumed.
In addition, since overall performance is enhanced by efficiently and simply managing tiles required to render the terrain through the quadtree, a large-capacity terrain can be rendered in real time.
Further, the terrain rendering method may be implemented in a program command form executable by various computer means and recorded in a computer readable recording medium. In this case, the computer readable recording medium may include one or a combination of a program command, a data file, and a data structure. Meanwhile, the program command recorded in the recording medium may be specially designed and configured for the present invention, or may be publicly known to and used by those skilled in the computer software field.
The computer-readable recording medium includes magnetic media such as a hard disk, a floppy disk, and a magnetic tape, optical media such as a CD-ROM and a DVD, a magneto-optical media such as a floptical disk, and a hardware device which is specifically configured to store and examples of the program command such as a ROM, a RAM, and a flash memory.
Meanwhile, the recording medium may be transmission media such as an optical or metallic wire, a waveguide, and the like including a carrier transmitting a signal designating a program command, a data structure, and the like.
Further, the program command includes a high-level language code executable by a computer by using an interpreter, and the like, as well as a machine language code created by a compiler. The hardware device may be configured to be operated with one or more software modules in order to perform the operation of the present invention, and an opposite situation thereof is available.
In the method and apparatus for rendering the terrain described as above, the constitutions and methods of the described embodiments cannot be limitatively applied, but all or some of the respective embodiments may be selectively combined and configured so that various modifications of the embodiments can be made.
According to an aspect of the present invention, a method and an apparatus for rendering a terrain can solve a crack problem while achieving multi-resolution.
According to another aspect of the present invention, while the terrain can be rendered at a high speed by using a tessellator of a GPU, adaptive resolution can be determined according to curve information of the terrain and a location of a camera to thereby minimize rendering resources which are unnecessarily consumed.
According to yet another aspect of the present invention, since an entire terrain is managed through a simplified data structure called quadtree, even a large-capacity terrain can be managed only by small memory consumption and operations of determining the adaptive resolution and updating data can be very rapidly, efficiently, and simply processed, and as a result, overall performance is significantly enhanced.
Number | Date | Country | Kind |
---|---|---|---|
10-2014-0014101 | Feb 2014 | KR | national |
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/KR2014/002497 | 3/25/2014 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2015/119325 | 8/13/2015 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
5990896 | Barrus | Nov 1999 | A |
6108006 | Hoppe | Aug 2000 | A |
6137492 | Hoppe | Oct 2000 | A |
6889176 | Buttolo | May 2005 | B1 |
6940505 | Savine | Sep 2005 | B1 |
7239311 | Dunn | Jul 2007 | B2 |
7561156 | Levanon | Jul 2009 | B2 |
7564455 | Gatewood, Jr. | Jul 2009 | B2 |
7948489 | Barnes | May 2011 | B1 |
8217936 | Barnes | Jul 2012 | B1 |
8482560 | Sathe | Jul 2013 | B2 |
8537158 | Gong | Sep 2013 | B2 |
8762493 | Kirmse | Jun 2014 | B1 |
8886445 | Skoog | Nov 2014 | B1 |
8976169 | Barreirinhas | Mar 2015 | B1 |
9082204 | Goel | Jul 2015 | B2 |
9123160 | Hollis | Sep 2015 | B1 |
9196079 | Yang | Nov 2015 | B2 |
9465891 | Kagan | Oct 2016 | B1 |
9607353 | Li | Mar 2017 | B2 |
9754409 | Soulard | Sep 2017 | B2 |
9779528 | Cohen | Oct 2017 | B2 |
20030117405 | Hubrecht | Jun 2003 | A1 |
20040257363 | Veach | Dec 2004 | A1 |
20050078116 | Sloan | Apr 2005 | A1 |
20060109267 | Rybacki | May 2006 | A1 |
20060170693 | Bethune | Aug 2006 | A1 |
20070247458 | Surazhsky | Oct 2007 | A1 |
20100164954 | Sathe | Jul 2010 | A1 |
20100164955 | Sathe | Jul 2010 | A1 |
20100253683 | Munkberg | Oct 2010 | A1 |
20110057931 | Goel | Mar 2011 | A1 |
20110058735 | Tastl | Mar 2011 | A1 |
20110063294 | Brown | Mar 2011 | A1 |
20110080405 | Moreton | Apr 2011 | A1 |
20110080416 | Duluk, Jr. | Apr 2011 | A1 |
20110085736 | Dmitriev | Apr 2011 | A1 |
20110091118 | Ahn | Apr 2011 | A1 |
20110128285 | Gong | Jun 2011 | A1 |
20110193859 | Kim | Aug 2011 | A1 |
20110285724 | Kilgard | Nov 2011 | A1 |
20110316854 | Vandrovec | Dec 2011 | A1 |
20120169715 | Noh | Jul 2012 | A1 |
20120182298 | Sun | Jul 2012 | A1 |
20130131978 | Han | May 2013 | A1 |
20130155080 | Nordlund | Jun 2013 | A1 |
20130169629 | Shin | Jul 2013 | A1 |
20130169636 | Yang | Jul 2013 | A1 |
20130325903 | Rohlf | Dec 2013 | A1 |
20130342535 | Sylvan | Dec 2013 | A1 |
20140063012 | Madani | Mar 2014 | A1 |
20140063013 | Goel | Mar 2014 | A1 |
20140063014 | Goel | Mar 2014 | A1 |
20140092091 | Li | Apr 2014 | A1 |
20140104197 | Khosravy | Apr 2014 | A1 |
20140111513 | Ceylan | Apr 2014 | A1 |
20140133708 | Lecuelle | May 2014 | A1 |
20140184598 | Quilot | Jul 2014 | A1 |
20140192051 | Meiri | Jul 2014 | A1 |
20140210819 | Mei | Jul 2014 | A1 |
20150054714 | Haubner | Feb 2015 | A1 |
20150130797 | Chen | May 2015 | A1 |
20150145863 | Buron | May 2015 | A1 |
20150363665 | Szasz | Dec 2015 | A1 |
20160078655 | Cohen | Mar 2016 | A1 |
20160093088 | Shreiner | Mar 2016 | A1 |
20160358373 | Fenney | Dec 2016 | A1 |
20160358375 | Lacey | Dec 2016 | A1 |
20170039765 | Zhou | Feb 2017 | A1 |
20170091993 | Andrew | Mar 2017 | A1 |
20170109927 | Patel | Apr 2017 | A1 |
20170132836 | Iverson | May 2017 | A1 |
20170132837 | Iverson | May 2017 | A1 |
20170200301 | Boisse et al. | Jul 2017 | A1 |
20170329801 | Rohlf | Nov 2017 | A1 |
Number | Date | Country |
---|---|---|
100935886 | Jan 2010 | KR |
101129084 | Mar 2012 | KR |
0019380 | Apr 2000 | WO |
Entry |
---|
“GPU-based Adaptive LOD control for Quadtree-Based Terrain Rendering”, INHA Graduate School, Feb. 2009, 34 pages. |
Ju et al, “Geomorphing Crack Elimination Technique for Improving Terrain Rendering Quality”, Agency for Defense Development, Oct. 2003, vol. 30, No. 2, 5 pages. |
Korean Office Action dated Mar. 24, 2015 corresponding to Korean Application No. 10-2014-0014101. |
Korean Notice of Allowance dated Aug. 31, 2015 corresponding to Korean Application No. 10-2014-0014101. |
International Search Report dated Nov. 5, 2014 corresponding to International Application PCT/KR2014/002497. |
Number | Date | Country | |
---|---|---|---|
20170116780 A1 | Apr 2017 | US |