Title: Terrain Rendering and LOD in Games
1Terrain Rendering and LOD in Games
2Outline
- overview of terrain algorithms
- optimization criteria
- Lindstrom algorithm
- progressive meshes
- ROAM
- performance
3Terrain Model
triangle mesh
texture image
4The Data
- Triangulated Irregular Networks (TIN)
- Regular Grid Height Field
5Simplify!
- We need to simplify our meshes!
- Go from
- Full Mesh -gt Simplified Mesh
6Simplify!
- Using view dependent metrics
actual view
overhead view
7Overview of Terrain Algorithms
8Overview of Terrain Algorithms
- Discrete LOD
- Continuous LOD
- grid-based
- continuous LOD rendering by Lindstrom
- Real-time Optimally Adapting Meshes (ROAM)
- TIN-based
- progressive meshes
9Terrain LOD vs Traditional LOD
- Easier
- Constrained geometry (generally)
- More specialized and simpler algorithms
- Harder
- Continuous and large models
- Simultaneously very close and far away
- Necessitates view-dependent LOD
10A Discrete LOD Approach
- View-Independent, camera location-dependent
- Still involves subdividing terrain
- Render closer subdivisions at higher resolution
- Popping
- Will get cracks and T-junctions
11Discrete LOD
- The End Result of what were achieving
- Low Detail Medium Detail Full Detail
12Terrain LOD Basics
- Cracks, T-junctions
- How do we solve this?
13Terrain LOD Basics 2
- What can you do?
- Ensure common vertices on edge of subdivision
- Draw a triangle to fill that spot
- Force a crack into a T-junction
- There must be an easier way
- Subdivide the terrain such that this is easier or
done for free
14Terrain LOD Basics 3
15Quadtrees
- Each quad is actually two triangles
- Still have cracks and T-junctions
16BinTrees (Binary Triangle Trees)
- Cracks and T-junctions are solved!
- Any two triangles differ by no more than one
resolution level
- A little harder to implement
- Forced Splitting
17Several Algorithms
- Lindstroms Continuous LOD
- Roettgers CLOAD Top-down version of Lindstrom
CLOAD - ROAM (Duchaineau)
- 3D Bounding Isosurfaces (Blow)
- Caching geometry (Vis2002)
- Visualization of Large Terrains Made Easy
- SOAR
18Optimization Criteria
- time required to achieve a given triangle count
- user specified view-dependent metrics
- simplicity
- strict frame rates
- dynamic terrain
- continuous changes
- etc.
19Continuous LOD for Height Fields
- Peter Lindstrom et al., 1996
- Used a binary vertex tree
- Frame-to-frame coherence
- Introduced user-controllable screen space error
threshold
20Continuous LOD by Lindstrom
- Quad tree
- bottom-up
- block-basedvs.vertex-based
21Progressive Meshes
- PM representation
- only single operationmerge (edge collapse)
- split (vertex split)
- view-dependent PM
22ROAM
- Real-Time Optimally Adapting Meshes
- Mark Duchaineau, 1997
- Binary Triangle Tree Structure
- No need to worry about cracks
- Can specify the desired number of triangles
- Probably the most popular algorithm today
23ROAM Main Concepts
- Split and Merge
- Two priority queues
- One for splits and one for merge
- Allows for frame-to-frame coherence
- Error Metrics for Splits and Merges
- Geomorphing introduced, but rarely needed
- Incremental triangle stripping introduced
24ROAM (1)
- triangle bintree
- top-downalgorithm
- 2 priority queues
- merge
- split
25Roam Structure
26Binary Triangle Tree
- Whats represented in each node of the tree
27ROAM (2)
- (mergeable) diamond
- forced split gt
- no effort to avoiddiscontinuities
28ROAM Splitting and Merging diamonds
29Splitting Nodes
30Managing Splitting
31ROAM Priority Queues
- One priority queue for splits, one for merges,
and use a greedy algorithm to triangulate - Priority error metric
- Nested world space bounds
- Geometric screen distortion
- Line of site
32What Cracks?
33ROAM Wedgies!
- Wedgie basically a bounding volume
- Covers the (x,y) extent of a triangle and extends
over the height range z-eT through zeT
34ROAM Splitting Algorithm
- Let T the base triangulation
- For all t in T, insert t into Q
- While T is too small or inaccurate
- Identify highest priority t in Q
- Force-split t
- Update split queue as follows
- Remove t and other split triangles from Q
- Add any new triangles to Q
Adapted from Duchaineaus original ROAMing
Terrain paper (96)
35ROAM Merging AND Splitting
- Splitting is straightforward, but so is merging
- Make two priority queues, Qs and Qm
- Add another check
- if T is too large or too accurate
- identify lowest priority elements T and TB in
Qm - Merge (T, TB)
- Update queues
- Remove all merged children from Qs
- Add merge parents T, TB to Qs
- Remove T, TB from Qm
- Add all newly-mergeable diamonds to Qm
36Comparison
Lindstrom ROAM PM
elementary operation complex,1 vertex reduction basic,1 vertex reduction complex,2 vertices reduction
triangles rigth-isosceles rigth-isosceles introduces slivers
complexity O(mesh size) O(triangle changes) O(mesh size)
37LOD for Games
- Bryan Turner, gamasutra.com
- Split-Only ROAM
- No frame to frame coherence, but still performs
very well - Seamus McNally, SMTerrain uses this same approach
- GDC 2003 Course Materials Many notes
- http//lodbook.com/course/2003/