24
Honours Graphics 2008 Session 6

Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Embed Size (px)

Citation preview

Page 1: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Honours Graphics 2008

Session 6

Page 2: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Today’s focus

• Terrain rendering

• Heightfield generation

• Level-of-detail for terrain

Page 3: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Terrain

Page 4: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Terrain, cont.

• Typically only requires a 2D data set (height field) for rendering purposes

• Height fields often generated randomly, or pertubed from basic design

• Rendered using block or continuous level-of-detail algorithms

Page 5: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Height fields

Page 6: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Height field generation

• Different approaches to height field generation

• Includes algorithms that are based on recursive faults, circular alevation, midpoint displacement

• Often followed by a post-processing step to create a sense of erosion

Page 7: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Midpoint displacement

Page 8: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Heightfield post-processing• Simulated erosion, eliminate artifacts, etc.

Page 9: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Terrain rendering

• Terrain data sets can exceed gigabytes of data, covering millions of data points

• The large volume of data requires effective level-of-detail handling to reduce to manageable subsets

• Comes in block or continuous LOD variants

Page 10: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Terrain rendering, cont.

Page 11: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Block LOD

Page 12: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Block LOD, cont.

Page 13: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Block LOD, cont.

Page 14: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

LOD metrics

• For a LOD scheme it is necessary to define some metric by which the required detail level can be determined

• Simplest LOD metric: things that are further away require less detail

Page 15: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

LOD metrics, cont.

• Typical basic LOD metric considers distance, as well as variance of the underlying structure

• Variance describes the structural complexity – flat surfaces have a low variance; while complex, articulated surfaces have a high variance

Page 16: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

LOD metrics, cont.

• Any number of additional metrics can be considered, for example:

• FOV metric• Silhouette metric• Line of Sight metric• Actor / entity metric• PVS metric

Page 17: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Continuous LOD

• A number of algorithms exist that can create continuously varying level of detail meshes on a per-frame basis

• In literature sometimes known as TINs (triangulated irregular networks)

• Includes among others work by Lindstrom, Röttger, and Duchaineau

Page 18: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Continuous LOD, cont.

• Duchaineau, famously, created ROAM• Functions by imposing a triangular binary tree

on the terrain data and performing split and merge operations on the tree

Page 19: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Continuous LOD, cont.

• ROAM is a frame-coherent algorithm

• Results from the prior frame can be incrementally changed for the current frame

• Requires little change in view from prior frame – but reduces computational overhead to 2 to 5% of full computation

Page 20: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Continuous LOD, cont.

• Diamond terrain algorithm, by Hakl• Improves on ROAM by changing the underlying

structure from a triangle binary tree to a triangle quadtree

Page 21: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Continuous LOD, cont.

• Improves hardware friendliness through generating a mesh that is more tri-strip friendly

• Requires half the split / merge operations to achieve the same detail level as ROAM

Page 22: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain
Page 23: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Homework

• Implement a random heightfield generator and display it at various degrees of refinement using a quadtree

• Due for session 7

• …and… project

Page 24: Honours Graphics 2008 Session 6. Today’s focus Terrain rendering Heightfield generation Level-of-detail for terrain

Project

• Primary project for the course

• 40% of final mark

• Implement a traversable terrain renderer, should be able to do the following:• LOD scheme• FOV culling• Sky

• Due for last session of course