Presentation is loading. Please wait.

Presentation is loading. Please wait.

Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids

Similar presentations

Presentation on theme: "Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids"— Presentation transcript:

1 Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids
Frank Losasso Stanford University Hugues Hoppe Microsoft Research Thank you for the introduction

2 Terrain Rendering Challenges
Mount Rainier Primary Dataset: United States at 30m spacing 20 Billion samples Olympic Mountains The rendering of terrains in real-time pose several challenges The difficulty comes from the large number of samples (often billions) that need to be stored, manipulated and rendered. This means that any terrain rendering system should incorporate the following elements: A concise storage scheme not susceptible to paging hick-ups The data must be rendered efficiently such that high framerates can be sustained (preferably 60 fps or higher) And lastly, it’s important to ensure temporal continuity. Concise storage  No paging hick-ups Real-Time frame rates  60 fps Visual continuity  No temporal pops

3 Previous Work Irregular Meshes (e.g. [Hoppe 98])
Fewest polygons Extremely CPU intensive Bin-trees (e.g. [Lindstrom et al 96]) Simpler data structures / algorithms Still CPU intensive Bin-tree Regions (e.g. [Cignoni et al 03]) Precomputed regions  Decreased CPU cost Temporal continuity difficult There has been lots of work done in the terrain rendering field. I’m going to divide the state of the art into 3 different categories: Irregular Meshes, which render the fewest number of polygons while still faithfully representing the terrain. They achieve this by performing several expensive preprocess operations combined with a very CPU intensive runtime system. Bin-trees (also known as longest-edge bisection or restricted quadtrees), which use more restrictive data structures making the algorithms cheaper. But they have to traverse these tree based structures and as such are still relatively CPU intensive. Lastly, Bin-tree regions, which use precomputed regions to further optimize the standard bintres. This means the runtime cost is significantly smaller, but temporal continuity is difficult when using these pre-cached blocks.

4 Previous Work Texture Clipmaps [Tanner 1998]
‘Infinitely’ large textures Clipped mipmap hierarchy Modeling for the Plausible Emulation of Large Worlds [Dollins 2002] Quadtree LOD around viewer Terrain synthesis Other related work include Texture clipmaps, which were invented by Tanner in 98 to support arbitrarily large mipmaps efficiently without having to have the whole hierarchy in hardware. Since they are a generalization on mipmaps, no transitions were considered, and LOD is performed per pixel. Also, Dollins’ thesis in 2002 considered a similar refinement scheme to ours, and, he also considered terrain synthesis using stochastic subdivision. Their method does differ significantly from ours however especially due to their usage of quadtrees for storage.

5 Geometry Clipmaps Store data in uniform 2D grids
Level-of-Detail from nesting of grids Refine based on distance Main Advantages Simplicity Compression Synthesis Lets delve into some more details about the geometry clipmap method: As I mentioned earlier, we store data in a set uniform 2D grids The LOD comes from nesting these grids around the viewer. We refine purely based on distance from the viewer, where the grids differ by a factor of two in resolution at each refinement transition. This structure brings many advantages: First and foremost, the method is simple! Since we store data in a highly regular fashion, we enjoy very high compression ratios. The successive powers of two for refinement also allows for very promising terrain synthesis techniques.

6 Terrain as a Pyramid Terrain as mipmap pyramid LOD using nested grids
Coarsest Level The clipmap hierarchy itself can be seen as a pyramid similar to a mipmap pyramid. The full hierarchy is a prefiltered sequence of power-of-two sized grids, where the finest level contains the whole terrain at the finest resolution. <click> The clipmap is a clipped version of this pyramid consisting of windows at each level. Each cached and rendered level is of a predetermined size centered around the viewer. <click> Here we see the finest level closest to the viewer <click> The next coarser level, which has a region cut out where the next finer level would be rendered. <click> <click> Which is the way it looks for all of the other levels At the coarsest level, the entire terrain extents have been rendered. Top right shows a coarse example. As the viewer moves, clipmap levels incrementally updated and shifted. Finest Level

7 Puget Sound Here is a higher resolution example of the clipmaps in action. The dataset is a 10meter horizontal spacing map for the Puget Sound region. The mountain is Mount Rainier

8 Individual Clipmap Levels
Uniform 2D grid Indexed triangle strip Efficient caching 60 M triangles/second 255-by-255 grid Expected Soon: Vertex Textures The individual clipmaps are very simple. As I mentioned earlier, they are uniform 2D grids, which allows us to render and process them very efficiently. By using indexed triangle strips for rendering, the graphics card can perform efficient caching of vertices, allowing for rendering rates of approximately 60M tris/sec on an ATI R300. The grid size that we used for the main examples in the paper were 255 by 255 which was chosen due to screen space error analysis and rendering efficiency We expect that vertex textures will become common place in the future. This feature will allow textures to be interpreted as vertex data, which should increase rendering rates significantly  in fact, betas forms of such an extension are already available from the major vendors.

9 Inter-Level Transitions
Between respective power-of-2 grids Due to the nesting of grids that we use to get LOD, we need to consider the boundaries between these levels in order to ensure both spatial continuity and temporal continuity

10 Inter-Level Transitions
BLOW UP PICTURES Luckily, the regular structure of our terrain samples allows us to perform blending between levels very efficiently. On the left, we show an example where there are no transitions. This yields the expected gaps in geometry. In the middle, we show the result of just morphing vertices to close gaps. The texturing is still discontinuous though And on the right, the same morphing parameter is used for both the vertices and the textures. Which yields the expected smooth transition. No transition Geometry transition Geometry & texture transition Gaps in geometry Gaps in texturing/shading

11 Inter-Level Transitions
Vertex shader  blend geometry Pixel shader  blend textures Both are inexpensive To perform this morphing efficiently, we pass both the height value and texture for both the finer and the next coarser level to the graphics card. A distance based morphing parameter is then calculated based on the viewers position and the extents of the clipmap level. The blue regions in the pictures show the morphing parameter, with a coarse wireframe example on the right The morphing for the vertices is done in the vertex shader, and the morphing for textures is done in the pixels shaders. Because of this, both are very inexpensive to perform and add negligible cost to our method.

12 Clipmap Update For each level Calculate new clipmap region
Fill new L-shaped region Use toroidal arrays for efficiency Lets see how clipmap levels are updated as the viewer moves. When the viewer moves <click>, We have to update the clipmap levels. To do so, we go through each level, <click> calculate the new clipmap region <click> Then fill the exposed L-shaped region <click> To prevent data copying, we use toroidal arrays.

13 Clipmap Update Update levels coarse-to-fine Use limited update budget
Only render updated data Fine levels may be cropped Rendering load decreases as update load becomes to large for the budget The levels themselves are updated coarse-to-fine. This order is required due to the finer levels dependence on the next coarser level, both when rendering and when updating (as we’ll see shortly). It’s possible for the update load to get too high for the allowed frame time, especially if the viewer is moving fast. To prevent this from adversely affecting the frame rate, we can use a limited update budged. This is done by updating only a limited number of vertices per frame. It may mean that levels may not have up to date data though, and in this case, we fall back on the next coarser level in those regions. It’s interesting to note that if the update budget gets excessive, then some parts of the finer levels may not be up to date, forcing us to fall back on coarser data in those areas, which contains less triangles hence leading to a smaller rendering load. Note that this only happens when the viewer is moving quickly however, and as such the dropped details are unlikely to be noticed.

14 ‘Filling’ New Regions Two Sources:
Computed on-demand  at 60 frames/second There are two sources of data for the updating of the terrain. On the left we see explicit terrain. This terrain is stored in compressed form, then decompressed as needed. On the right is synthesized data that is generated on the fly. Decompressed explicit terrain Synthesized new terrain

15 Clipmap Update Fine level from coarse level
U is a 16 point C1 smooth interpolant For synthesized terrain, X = Gaussian noise For explicit terrain, X = compression residual To better understand how each of these two sources of data work, lets look at the update procedure in more detail. The fine level (T_l) is calculated from next coarser level (T_l-1). U is an upsampling function which performs one level of refinement, for which we use a 16 point C^1 smooth interpolant. It is important that this interpolant is C^1 for the synthesis, as we’ll see later. After upsampling, we add either Gaussian noise for synthesized terrain Or decompressed inter-level residuals for explicit terrain.

16 Terrain Synthesis Adds high frequency detail
Upsample then add Gaussian noise Precomputed 50-by-50 noise texture Per-octave amplitude from real terrain Lets consider terrain synthesis in slightly more detail Geometry clipmaps provide for a natural structure in which to generate synthesized detail. Stochastic subdivision [Fournier et al 82] or multiresolution texture synthesis [Wei and Levoy 2000] are two examples of promising synthesis methods that should be explored further. We used a very simple scheme as a demonstration: On the left, There are three levels with explicit decompressed terrain, followed by another 8 levels of only the 16 point upsampling filter. On the right, the same 3 explicit levels are used, but they are then followed by gaussian noise. The noise comes from a precomputed texture (for speed). We found that the result is not very sensitive to the size of this texture as long as it’s not too small, and sizes of powers of two should of course be avoided The noise function must also be spatially deterministic (so that the same terrain is generated every time). The amplitude of displacement at each level comes from statistical analysis of real terrain.

17 Texture Synthesis Here is a demo showing first the smooth terrain
Then the same terrain with the noise added. Only 3 levels of explicit data is used followed by 8 levels of synthesized data.

18 Subdivision Interpolant
As I mentioned earlier, the choice of which up-sampling function to use is very important. As an example, On the left were using a Bilinear Interpolant. Creases visible at every refinement level On the right, we are using the 16 point subdivision interpolant which does not have the crease causing derivative discontinuities. Bilinear Interpolant (C0) 16-point Interpolant (C1)

19 Terrain Compression Create mipmap fine-to-coarse
D found from data such that: The second source of data is the compressed explicit terrain. Before I show how we insert the compression residuals into the refinement operation, I would like to discuss the compression itself. To create the compressed hierarchy, we use downsampling filter, D, to create a coarser level (creating a mipmap pyramid). An optimal filter of size 11X11 is found s.t. U(D(T_l)) gives the best approximation of T_l. This is done by simply solving linear system over a subset of the terrain.

20 Terrain Compression Calculate residuals coarse-to-fine
Upsample and compute inter-level residual Quantize and compress residual Replace approximation  Prevent error accumulation Residuals are then calculated going back from coarse to fine. This is done by calculating an approximation of T_l from T_l-1 using the prior upsampling filter U. We can then Quantize and Compress the residual and store that. For the compression, we use the PTC image coder which has several nice properties: It uses overlapping basis function which means that there won’t be any blocking artifacts. And the basis functions are spatially localized which allows for efficient regional compression and decompression. To prevent error accumulation, we replace the approximation for T_l by using the result from decompressing the quantized and compressed residual.

21 Compression Results U.S height map 30m horizontal spacing
1m vertical resolution 216,000-by-93,600 grid 40GB uncompressed 350MB compressed  factor of over 100 rms error 1.8m (6% of sample spacing) To demonstrate the effectiveness of our compression scheme, we have tested it on the US geological survey height map of the United States of America. The data takes up 40 GB of space uncompressed, but by using our compression scheme it consumes only 350MB. This is a factor of about 115:1 The rms error of this amount of compression is 1.8m, or only 6% of the sample spacing.

22 Compression Results LOD scheme Number of samples Runtime space
Bytes per sample Hoppe [98] 8 M 50 MB 6.0 Lindstrom [02] 256 M 5.0 GB 19.5 Cignoni et al [02] 64 M 115 MB 1.8 Geometry Clipmaps 20 G 375 MB 0.02 To see how this scheme compares to other leading LOD schemes:

23 Level-of-detail Error
Analyzed statistically  See paper For U.S. terrain (640-by-480 resolution) rms error = 0.15 pixels max error = 12 pixels 99.9th percentile = 0.90 pixels The error introduced by the LOD is analyzed statistically, and I would like to refer anyone interested to the paper for the details I would like to summarize the results however: Using the same main dataset, The rms errror is only .15 pixels. Max error is 12 pixels… BUT happens very infrequently as the 99.9th percentile is still less than one pixel.

24 United States of America
This is a video clip showing our system using the full U.S dataset. The framerate of program is a consistent 60 frames per second, but the video is only captured at 30 frames per second. Washington -> Oregon -> Nevada -> Arizona. Grand Canyon. Zoom out to see the entire US. The jagged edges are due to the map data ending there.

25 Graphics Hardware Friendly
Can be implemented in hardware Clipmap levels as high-precision textures Subdivision and normal calculation [Losasso et al 03] Morphing already done in hardware Noise from Noise() or from texture Uploaded on-demand Decompressed terrain Geometry Clipmaps can be implemented in hardware. Clipmap levels can be stored as high-precision textures The subdivision and normal calculations can be performed on the GPU as demonstrated by us in 2003 The morphing of geometry and textures is already done in hardware, And adding the noise can be done either through a hardware noise function or by pre-computing and storing it in a texture The only aspect that can currently not be performed by the hardware is the decompression, but this could present an interesting avenue for future work.

26 Limitations Statistical error analysis Unnecessarily many triangles
Assumes bounded spectral density Unnecessarily many triangles Assumes uniformly detailed terrain but, allows for optimal rendering throughput As I mentioned earlier, we perform statistical analysis of the error, which assumes that the spectral density of the rendered terrain is uniform everywhere. We also render nested uniform grids, which means that it is not sensitive to the data being rendered. This means that we may render unnecessarily many triangles (especially in flat areas). In a sense, we are optimizing for the worst case, and handling the easier cases in a uniform manner. Since computer technology has reached a stage in which we can afford to render a lot of triangles, we still achieve 60 frames per second.

27 Advantages Simplicity Optimal rendering throughput Visual continuity
Steady rendering Graceful degradation Compression Synthesis To Summarize, here are the advantages of the geometry Clipmaps method: The method is simple. It allows us to achieve optimal rendering throughput Visual continuity is handled efficiently Steady rendering is guaranteed regardless of user input In the event of excessive update load, the method provides for graceful degradation And finally, we provide two new advantages, Very efficient compression And finally terrain synthesis

Download ppt "Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids"

Similar presentations

Ads by Google