R Real-Time Rendering l Ti R d i (Echtzeitgraphik) - - PowerPoint PPT Presentation

r real time rendering l ti r d i echtzeitgraphik
SMART_READER_LITE
LIVE PREVIEW

R Real-Time Rendering l Ti R d i (Echtzeitgraphik) - - PowerPoint PPT Presentation

R Real-Time Rendering l Ti R d i (Echtzeitgraphik) (Echtzeitgraphik) Dr. Michael Wimmer wimmer@cg tuwien ac at wimmer@cg.tuwien.ac.at Levels of Detail Basic Idea Problem: even after visibility, model may contain too many polygons


slide-1
SLIDE 1

R l Ti R d i Real-Time Rendering (Echtzeitgraphik) (Echtzeitgraphik)

  • Dr. Michael Wimmer

wimmer@cg tuwien ac at wimmer@cg.tuwien.ac.at

slide-2
SLIDE 2

Levels of Detail

slide-3
SLIDE 3

Basic Idea Problem: even after visibility, model may contain too many polygons contain too many polygons Idea: Simplify the amount of detail used to render small or distant objects Known as levels of detail (LOD) Known as levels of detail (LOD)

Multiresolution modeling, polygonal i lifi ti t i i lifi ti h simplification, geometric simplification, mesh reduction, decimation, multiresolution modeling, …

Vienna University of Technology 3

slide-4
SLIDE 4

Definition Polygonal simplification methods simplify the polygonal geometry of small or distant objects polygonal geometry of small or distant objects Does not change rasterization

Fragment count remains roughly identical

Note: Note:

Levels of detail, but: Level-of-detail rendering NOT: level of details! NOT: level of details!

Vienna University of Technology 4

slide-5
SLIDE 5

Traditional Approach Create levels of detail (LODs) for each object in a preprocess (or by hand): in a preprocess (or by hand):

l l l l

Vienna University of Technology 5

10,108 polys 1,383 polys 474 polys 46 polys

slide-6
SLIDE 6

Traditional Approach At runtime, distant objects use coarser LODs: LODs:

Vienna University of Technology 6

slide-7
SLIDE 7

LOD Issues

LOD generation

Simplification methods Simplification methods

How to reduce polygons

Error measures Error measures

Which polygons to reduce

R ti t Runtime system

LOD framework

Which LODs are eligible

LOD selection

Criteria for which LODs are selected

LOD switching

Vienna University of Technology 7

g

How to avoid artifacts

slide-8
SLIDE 8

Runtime system

LOD framework

Discrete Continuous (a.k.a. progressive) View-dependent e depe de t

LOD selection

Static (distance/projected area-based) Static (distance/projected area based) Reactive (react to last frames rendering time) Predictive (cost/benefit model) Predictive (cost/benefit model)

LOD switching

Hard switching (popping artifacts!) Hard switching (popping artifacts!) Blending (ill-defined because of z-buffer!) Geomorph

Vienna University of Technology 8

Geomorph

slide-9
SLIDE 9

Creating LODs Main topic of this lecture! Si lifi ti th d (“ t ”) Simplification methods (“operators”)

Geometry

Edge collapse …

Topology

What criteria to guide simplification?

Visual/perceptual criteria are hard Visual/perceptual criteria are hard Geometric criteria are more common

Vienna University of Technology 9

slide-10
SLIDE 10

Simplification Operators Local geometry simplification

Iteratively reduce number of geometric Iteratively reduce number of geometric primitives (vertices, edges, triangles)

Topology simplification

Reducing number of holes tunnels cavities Reducing number of holes, tunnels, cavities

Global geometry simplification

Vienna University of Technology 10

slide-11
SLIDE 11

Local Geometry Simplification Edge collapse Vertex-pair collapse Triangle collapse Triangle collapse Cell collapse Cell collapse Vertex removal General geometric replacement

Vienna University of Technology 11

slide-12
SLIDE 12

Edge Collapse

va v

Edge collapse

vb vnew

Vertexsplit p Hoppe, SIGGRAPH 96; Xia et al., Visualization 96; Hoppe, SIGGRAPH 97; Bajaj et al., Visualization 99; Gueziec et al., CG&A 99; …

Vienna University of Technology 12

slide-13
SLIDE 13

Half-Edge Collapse

Half-edge collapse

va va

Vertexsplit

vb

p

Vienna University of Technology 13

slide-14
SLIDE 14

Watch for Mesh Foldovers

Edge collapse va vc vnew vb vc vd vd

c

Calculate the adjacent face normals, then test if they would flip after simplification if they would flip after simplification If so, that simplification can be weighted heavier or disallowed

Vienna University of Technology 14

heavier or disallowed

slide-15
SLIDE 15

Implementation: Watch for Identical / Non- Manifold Tris

va v Edge collapse vb vnew

Vienna University of Technology 15

slide-16
SLIDE 16

Vertex-Pair Collapse

va v

Vertex pair collapse

vb vnew

Vertexsplit p Schroeder, Visualization 97; Garland & Heckbert, SIGGRAPH 97; Popovic & Hoppe, SIGGRAPH 97; El-Sana & Varshney, Eurographics 99; …

Vienna University of Technology 16

slide-17
SLIDE 17

Triangle Collapse

i l va v Triangle collapse vc vb vnew

c

Hamann, CAGD 94; Gieng et al., IEEE TVCG 98

Vienna University of Technology 17

slide-18
SLIDE 18

Cell Collapse

Grid based: Rossignac & Borrel, Modeling in Computer Graphics 93 g g p p Octree-based: Luebke & Erikson, SIGGRAPH 98

Vienna University of Technology 18

slide-19
SLIDE 19

Vertex Removal

Vertex removal Triangulation

va

va

Schroeder et al., SIGGRAPH 92; Kl i & K S i C f O C G hi 97

Vienna University of Technology 19

Klein & Kramer, Spring Conf. On Comp. Graphics 97

slide-20
SLIDE 20

General Geometric Replacement Replace a subset of adjacent triangles by a simplified set with same boundary simplified set with same boundary “Multi-triangulation” Fairly general: can encode edge collapses, vertex removals and edge flips vertex removals, and edge flips

Vienna University of Technology 20

slide-21
SLIDE 21

Discussion / Comparison

Edge collapse and triangle collapse:

Simplest to implement Support geometric morphing across levels of detail Support non-manifold geometry

Full edge vs half edge collapses: Full-edge vs. half-edge collapses:

Full edge represents better simplifications Half-edge is more efficient in incremental encoding Half edge is more efficient in incremental encoding

Cell collapse:

Simple, robust Varies with rotation/translation of grid

Vertex removal vs edge collapse

H l t i l ti i t i l d ll Hole retriangulation is not as simple as edge collapse Smaller number of triangles affected in vertex removal

Vienna University of Technology 21

slide-22
SLIDE 22

Simplifying Geometry vs Topology

Pure geometric simplification not enough

Vienna University of Technology 22

slide-23
SLIDE 23

Local Topology Simplification Collapsing vertex pairs (“pair contraction”) / virtual edges virtual edges

Schroeder, Visualization 97 Popovic and Hoppe, SIGGRAPH 97 Garland and Heckbert SIGGRAPH 97 Garland and Heckbert, SIGGRAPH 97

Collapsing primitives in a cell

Rossignac and Borrel, Modeling in Comp. Graphics 93 Luebke and Erikson, SIGGRAPH 97 Luebke and Erikson, SIGGRAPH 97

Vienna University of Technology 23

slide-24
SLIDE 24

Virtual Edge Collapse

Allow virtual edge collapses Limit no. of virtual edges (potentially O(n2) ) O(n2) ) Typical constraints: Typical constraints:

Delaunay edges Edges that span neighboring cells in a spatial subdivision: octree, grids, etc. subdivision: octree, grids, etc. Maximum edge length

Vienna University of Technology 24

slide-25
SLIDE 25

Global Geometry Simplification Sample and reconstruct Ad ti bdi i i Adaptive subdivision

Vienna University of Technology 25

slide-26
SLIDE 26

Sample and Reconstruct Scatter surface with sample points

Randomly Randomly Let them repel each other

Reduce sample points Reconstruct surface Reconstruct surface

Vienna University of Technology 26

slide-27
SLIDE 27

Adaptive Subdivision Create a very simple base model that represents the model represents the model Selectively subdivide faces of base model until fidelity criterion met (draw) Big potential application: multiresolution Big potential application: multiresolution modeling

Vienna University of Technology 27

slide-28
SLIDE 28

Example 1: Vertex Clustering Rossignac and Borrel, 1992 O t ll ll Operator: cell collapse A l if 3D id t th bj t Apply a uniform 3D grid to the object Collapse all vertices in each grid cell to p g single most important vertex, defined by:

Curvature (1 / maximum edge angle) Curvature (1 / maximum edge angle) Size of polygons (edge length)

Vienna University of Technology 28

Filter out degenerate polygons

slide-29
SLIDE 29

Example 1: Vertex Clustering A l if 3D id t th bj t Apply a uniform 3D grid to the object Collapse all vertices in each grid cell to p g single most important vertex, defined by:

Curvature (1 / maximum edge angle) Curvature (1 / maximum edge angle) Size of polygons (edge length)

Vienna University of Technology 29

Filter out degenerate polygons

slide-30
SLIDE 30

Vertex Clustering Resolution of grid determines degree of simplification simplification Representing degenerate triangles

Edges: OpenGL line primitive Edges: OpenGL line primitive Points: OpenGL point primitive

Vienna University of Technology 30

slide-31
SLIDE 31

Vertex Clustering Pros

Very fast Very fast Robust (topology-insensitive)

Cons

Difficult to specify simplification degree Difficult to specify simplification degree Low fidelity (topology-insensitive) Underlying grid creates sensitivity to model

  • rientation
  • e

a o

Vienna University of Technology 31

slide-32
SLIDE 32

Creating LODs: Error Measures

What criteria to guide simplification?

Visual/perceptual criteria are hard Visual/perceptual criteria are hard Geometric criteria are more common

E l Examples:

Vertex-vertex distance Vertex-plane distance Point-surface distance Surface-surface distance Image-driven Image driven

Issues:

Error propagation?

Vienna University of Technology 32

Error propagation? Need to include attributes (tex coords, …)

slide-33
SLIDE 33

Quadric Error Metric

Vertex-plane distance Minimize distance to all planes at a vertex Minimize distance to all planes at a vertex Plane equation for each face: v : p     D Cz By Ax  x Distance to vertex v :

 

          

1 z y x D C B A T v

p

Vienna University of Technology 33

 

1

slide-34
SLIDE 34

Squared Distance at a Vertex

2

) ( ) (

T

 

) ( 2

) ( ) (

v planes p T v

p v

) (

) )( (

v planes p T T

v p p v

) (

) (

v planes p T T

v pp v

) (v planes p

  v pp v

v planes p T T

        

 ) (

Vienna University of Technology 34

slide-35
SLIDE 35

Quadric Derivation (cont’d) ppT is simply the plane equation ppT is simply the plane equation squared:

 

2

AD AC AB A         

2 2 2

BD BC B AB AD AC AB A pp

T

     

2 2

D CD BD AD CD C BC AC pp

The ppT sum at a vertex v is a matrix, Q:

 

v Q v v

T

  ) (

Vienna University of Technology 35

slide-36
SLIDE 36

Using Quadrics

Construct a quadric Q for every vertex

v2 v v Q1 Q2 v2 v1 Q

The edge quadric:

vnew

Sort edges based on edge cost

2 1

Q Q Q  

Sort edges based on edge cost

Suppose we contract to vnew:

Edge cost = Vnew

T Q Vnew

V ’s new quadric is simply Q

Vienna University of Technology 36

Vnew s new quadric is simply Q

slide-37
SLIDE 37

Optimal Vertex Placement Each vertex has a quadric error metric Q associated with it associated with it

Error is zero for original vertices Error nonzero for vertices created by merge

  • peration(s)

p ( )

Minimize Q to calculate optimal coordinates for placing new vertex for placing new vertex

Details in paper Authors claim 40-50% less error

Vienna University of Technology 37

slide-38
SLIDE 38

Boundary Preservation To preserve important boundaries, label edges as normal or discontinuity edges as normal or discontinuity For each face with a discontinuity, a plane perpendicular intersecting the discontinuous edge is formed. g These planes are then converted into quadrics and can be weighted more heavily quadrics, and can be weighted more heavily with respect to error value.

Vienna University of Technology 38

slide-39
SLIDE 39

Quadric Error Metric Pros:

Fast! (bunny to 100 polygons: 15 sec) Fast! (bunny to 100 polygons: 15 sec) Good fidelity even for drastic reduction Robust -- handles non-manifold surfaces Aggregation can merge objects Aggregation -- can merge objects

Vienna University of Technology 39

slide-40
SLIDE 40

Quadric Error Metric Cons:

Introduces non manifold surfaces Introduces non-manifold surfaces Tweak factor t is ugly

Too large: O(n2) running time

  • o a ge O(

) u g t e Correct value varies with model density

Needs further extension to handle color (7x7 Needs further extension to handle color (7x7 matrices)

Vienna University of Technology 40

slide-41
SLIDE 41

Image-Driven Simplification

12 cameras used to capture quality of bunny simplification (Lindstrom/Turk 2000)

Measure error by rendering Measure error by rendering

Compare resulting images Lindstrom/Turk 2000 Lindstrom/Turk 2000

Captures attribute and shading error, as well as texture content

Vienna University of Technology 41

texture content

slide-42
SLIDE 42

Appearance-Preserving Simplification

Reduce drastically Si l t l t t i b Simulate lost geometry using bump maps NVIDIA/ATI tools available

  • riginal
  • riginal

simplification simplification normal normal-mapped mapped

Vienna University of Technology 42

  • riginal
  • riginal

simplification simplification normal normal mapped mapped 13.000 tris 13.000 tris 1700 tris 1700 tris 1700 tris 1700 tris

slide-43
SLIDE 43

Frameworks for LOD Three basic LOD frameworks:

Discrete LOD: the traditional approach Discrete LOD: the traditional approach Continuous LOD: encoding a continuous spectrum of detail from coarse to fine View-dependent LOD: adjusting detail across View dependent LOD: adjusting detail across the model in response to viewpoint

Vienna University of Technology 43

slide-44
SLIDE 44

Discrete LOD: Advantages Simplest programming model; decouples simplification and rendering simplification and rendering

LOD creation need not address real-time rendering constraints Run-time rendering engine need only pick g g y p LODs

Fits modern graphics hardware well Fits modern graphics hardware well

Easy to compile each LOD into triangle strips, cache-aware vertex arrays, etc. These render much faster than immediate-

Vienna University of Technology 44

mode triangles on today’s hardware

slide-45
SLIDE 45

Discrete LOD: Disadvantages So why use anything but discrete LOD?

Reason 1: sometimes discrete LOD not suited Reason 1: sometimes discrete LOD not suited for drastic simplification Reason 2: in theory, can get better fidelity/polygon with other approaches y p yg pp

Vienna University of Technology 45

slide-46
SLIDE 46

Continuous Level of Detail A departure from the traditional discrete approach: approach:

Discrete LOD: create individual levels of detail in a preprocess Continuous LOD: create data structure from which a desired level of detail can be extracted at run time. extracted at run time.

Vienna University of Technology 46

slide-47
SLIDE 47

Continuous LOD: Advantages Better granularity  better fidelity

LOD is specified exactly not chosen from a LOD is specified exactly, not chosen from a few pre-created options Thus objects use no more polygons than necessary, which frees up polygons for other y p p yg

  • bjects

Net result: better resource utilization leading Net result: better resource utilization, leading to better overall fidelity/polygon

Vienna University of Technology 47

slide-48
SLIDE 48

Continuous LOD: Advantages Better granularity  smoother transitions

Switching between traditional LODs can Switching between traditional LODs can introduce visual “popping” effect Continuous LOD can adjust detail gradually and incrementally, reducing visual pops y g p p

Can even geomorph the fine-grained simplification operations over several frames simplification operations over several frames to eliminate pops (e.g., w/ a vertex shader)

Vienna University of Technology 48

slide-49
SLIDE 49

Continuous LOD: Advantages Supports progressive transmission (streaming) (streaming)

Progressive Meshes [Hoppe 97] Progressive Forest Split Compression [Taubin 98] Progressive Forest Split Compression [Taubin 98]

Leads to view-dependent LOD

Use current view parameters to select best representation for the current view Single objects may thus span several levels

  • f detail
  • f detail

Vienna University of Technology 49

slide-50
SLIDE 50

Continuous LOD Algorithm

“Progressive meshes” Iteratively apply local simplification operator Iteratively apply local simplification operator

Until base mesh

E tit d t t i l Entity = edge or vertex or triangle … Sort all entities (by some metric) repeat repeat

Apply local simplification operator: remove entity remove entity Fix-up topology

Vienna University of Technology 50

until (no entities left)

slide-51
SLIDE 51

View-Dependent LOD: Examples Show nearby portions of object at higher resolution than distant portions resolution than distant portions

Vienna University of Technology 51

View from eyepoint Birds-eye view

slide-52
SLIDE 52

View-Dependent LOD: Examples Show silhouette regions of object at higher resolution than interior regions resolution than interior regions

Vienna University of Technology 52

slide-53
SLIDE 53

Advantages of View-Dependent LOD Even better granularity E bl d ti i lifi ti f Enables drastic simplification of very large objects

Example: stadium model Example: terrain flyover Example: terrain flyover

Vienna University of Technology 53

slide-54
SLIDE 54

Drastic Simplification:

The Problem With Large Objects The Problem With Large Objects

Vienna University of Technology 54

slide-55
SLIDE 55

Terrain LOD

Has been around for long (flight simulators, GIS, games …) g ) Geometry is more constrained

 Specialized solutions p

Properties Properties

Simultaneously very near and very far

 Requires progressive/view-dependent LOD!  Requires progressive/view dependent LOD!

Very large terrains  out-of-core

Problems: Problems:

Dynamic modification of terrain data Fast rotation

Vienna University of Technology 55

Fast rotation

slide-56
SLIDE 56

Regular Grids Uniform array of height values Uniform array of height values Simple to store and manipulate Easy to interpolate to find elevations Less disk/memory (only store z value) Less disk/memory (only store z value) Easy view culling and collision detection Used by most implementers

Vienna University of Technology 56

slide-57
SLIDE 57

TINs Triangulated Irregular Networks Triangulated Irregular Networks Fewer polygons needed to attain required accuracy Higher sampling in bumpy regions and Higher sampling in bumpy regions and coarser in flat ones C d l i i i id Can model maxima, minima, ridges, valleys, overhangs, caves

Vienna University of Technology 57

slide-58
SLIDE 58

LOD Hierarchy Structures

QuadTree Hierarchy

Vienna University of Technology 58

BinTree Hierarchy

slide-59
SLIDE 59

Quadtrees Each quad is actually two triangles Produces cracks and T-junctions Easy to implement Easy to implement Good for out-of-core operation

Vienna University of Technology 59

slide-60
SLIDE 60

Bintrees

Terminology

Binary triangle tree (bintree, bintritree, BTT) Right triangular irregular networks (RTIN) Longest edge bisection Longest edge bisection

Easier to avoid cracks and T-junctions Neighbor is never more than 1 level away Neighbor is never more than 1 level away Very popular “ROAM” algorithm

Vienna University of Technology 60

slide-61
SLIDE 61

Cracks and T-Junctions

Avoid cracks:

Force cracks into T-junctions / remove floating j g vertex Fill cracks with extra triangles

Avoid T-junctions:

Continue to simplify ...

Vienna University of Technology 61

slide-62
SLIDE 62

Avoiding T-junctions In bintrees:

Vienna University of Technology 62

slide-63
SLIDE 63

View-Dependent Terrain LOD Hoppe et al.

actual view actual view

  • verhead view
  • verhead view

Vienna University of Technology 63