Terrain
Terrain
Scientific Visualization
Terrain Rendering
Christian Dick
[email protected]
•Tile-based multiresolution
Tile-based mesh
multiresolution representation
mesh representation
– Rendering Massive Terrains using Chunked Level of Detail Control
[Ulrich, 2002]
Nested
•Nested regular
regular grids
grids
– Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids
[Losasso and Hoppe, 2004]
•Ray-casting ofof
Ray-casting the height
the field
height field (no mesh)
– GPU Ray-Casting for Scalable Terrain Rendering
[Dick et al., 2009]
Level 2 Level 3
Level 4 Level 5
Dynamic Remeshing – ROAM
• Remeshing is done by exploiting frame-to-
frame coherence
– Mesh refinement: Split triangles using
diamond splits to avoid T-vertices
– Mesh coarsening: Merge diamonds T-vertex
Split
Merge
Dynamic Remeshing – ROAM
• Diamond splitting rule leads to forced splits
Dynamic Remeshing – ROAM
• Remeshing is driven by two priority queues
– Priority = Screen space error
– Split Queue: Force-split triangles with highest
priority
– Merge Queue: Merge diamonds with lowest
priority
– Uses view-independent, precomputed world-space
error bounds for the triangles in the bintree
– View-dependent priorities are obtained from these
error bounds by projection into screen-space
(Priorities have to be updated when view position changes)
Avoiding Popping Artifacts
• Geomorphs (vertex morphing)
– Linear interpolation of the height of the center vertex
z vC
z(vC)
LC RC z t 1 t zT vC t z vC ,
zT(vC) t 0, 1
T
Viewer Position
Nested Regular Grids
• Advantages:
– Height field can be compressed using image
compression methods
– Simple memory management
• Disadvantages:
– No exact screen space error control
– Extremely high number of triangles
GPU-based Terrain Ray-Casting
• Ray-casting of the terrain height field
• GPU Ray-Casting for Scalable Terrain
Rendering [Dick et al., 2009]
BoxExit
BoxEntry
View Plane
Eye
Dir = BoxExit - Eye
GPU-based Terrain Ray-Casting
• Advantages:
– Performance fully independent of the complexity
of terrain
– Higher performance and lower GPU memory
consumption than triangle-based rendering for
high-resolution height fields
• Disadvantages:
– For coarse-resolution height fields, triangle-based
rendering is faster and requires less GPU memory
Data Compression
• Benefits:
– Reduces memory capacity requirements
– Reduces bandwidth requirements
• Favor schemes that can be decoded on the GPU
– Reduces CPU load
– Reduces CPU-GPU traffic
• Encoding generally not time-critical
– Performed in a (time-consuming) preprocess
Texture Compression – S3TC
• S3 Texture Compression, here: DXT1, no alpha
[US Patent 6658146]
– Asymmetric, lossy block truncation code
– Standard compression scheme (DirectX, OpenGL)
– GPU renders directly from compressed data
– Divides textures into 4x4 blocks
– Assigns a fixed rate of 64 bits per block (4 bpp)
– Compression ratio 6:1 (R8G8B8)
– Use the Squish library by Simon Brown for
compression; Available with source code at
http://code.google.com/p/libsquish/
Geometry Compression
• Compression scheme for bintree meshes
supporting GPU-based decoding
– Efficient Geometry Compression for GPU-based
Decoding in Realtime Terrain Rendering
[Dick et al., 2009]
– Underlying 2D Mesh: Lossless compression based
on a generalized triangle strip representation
– Height values: Lossy compression based on
uniform quantization
– Compression rate 8-9
(wrt triangle list representation, 32 bits per vertex)
Geometry Compression
• Generalized Triangle Strip
– Store only one vertex per triangle
1 3 5 1 3 4 5
7
0 2
4 0 2 6
Regular Triangle Strip Generalized Triangle Strip
(0-1-2, 2-1-3, 2-3-4, 4-3-5, …)
5
0 3
Start
1 2 4
Geometry Compression
• Classify triangles by
– Type of the entering/leaving edge (A, B, C)
– Winding of the path (L, R)
Type A: Type B: Type C:
Cathetus to cathetus Cathetus to hypotenuse Hypotenuse to cathetus
Geometry Compression
• Construct path during diamond splitting
– Initial Mesh
Geometry Compression
• Construct path during diamond splitting
– Replacement System
Geometry Compression
Geometry Compression – Encoding
• For each triangle
– Store type (A,B,C) New vertex