Title: Level of Detail: Choosing and Generating LODs
1Level of DetailChoosing and Generating LODs
- David Luebke
- University of Virginia
2Level of DetailTraditional LOD In A Nutshell
- Create levels of detail (LODs) of objects
69,451 polys
2,502 polys
251 polys
76 polys
Courtesy Stanford 3D Scanning Repository
3Level of DetailTraditional LOD In A Nutshell
- Distant objects use coarser LODs
4Review LOD Frameworks
- Discrete LOD
- Generate a handful of LODs for each object
- Continuous LOD (CLOD)
- Generate data structure for each object from
which a spectrum of detail can be extracted - View-dependent LOD
- Generate data structure from which an LOD
specialized to the current view parameters can be
generated on the fly. - One object may span multiple levels of detail
- Hierarchical LOD
- Aggregate objects into assemblies with their own
LODs
5Review LOD Run-Time Management
- Fundamental LOD issue where in the scene to
allocate detail? - For discrete LOD this equates to choosing which
LOD will represent each object - Run every frame on every object keep it fast
6Review Choosing LODs
- Describe a simple method for the system to choose
LODs - Assign each LOD a range of distances
- Calculate distance from viewer to object
- Use corresponding LOD
- How might we implement this in a scene-graph
based system? - Make a switch node that picks which of its
children to traverse based on LOD thresholds
7Review Choosing LODs
- Whats wrong with this simple approach?
- Visual pop when switching LODs can be
disconcerting - Doesnt maintain constant frame rate lots of
objects still means slow frame times - Requires someone to assign switching distances by
hand - Correct switching distance may vary with field of
view, resolution, etc. - What can we do about each of these?
8ReviewMaintaining constant frame rate
- One solution scale LOD switching distances by a
bias - Implement a feedback mechanism
- If last frame took too long, decrease bias
- If last frame took too little time, increase bias
- Dangers
- Oscillation caused by overly aggressive feedback
- Sudden change in rendering load can still cause
overly long frame times
9Choosing LODsMaintaining constant frame rate
- A better (but harder) solution predictive LOD
selection - For each LOD estimate
- Cost (rendering time)
- Benefit (importance to the image)
10Choosing LODsMaintaining constant frame rate
- A better (but harder) solution predictive LOD
selection - For each LOD estimate
- Cost (rendering time)
- of polygons
- How large on screen
- Vertex processing load (e.g., lighting) OR
- Fragment processing load (e.g., texturing)
- Benefit (importance to the image)
11Choosing LODsMaintaining constant frame rate
- A better (but harder) solution predictive LOD
selection - For each LOD estimate
- Cost (rendering time)
- Benefit (importance to the image)
- Size larger objects contribute more to image
- Accuracy no of verts/polys, shading model, etc.
- Priority account for inherent importance
- Eccentricity peripheral objects harder to see
- Velocity fast-moving objects harder to see
- Hysteresis avoid flicker use previous frame
state
12Choosing LODsFunkhouser Sequin, SIGGRAPH 93
- Given a fixed time budget, select LODs to
maximize benefit within a cost constraint - Variation of the knapsack problem
- What do you think the complexity is?
- A NP-Complete (like the 0-1 knapsack problem)
- In practice, use a greedy algorithm
- Sort objects by benefit/cost ratio, pick in
sorted order until budget is exceeded - Guaranteed to achieve at least 50 optimal soln
- Time O(n lg n)
- Can even use incremental alg to exploit coherence
13Generating LODs
- Next topic generating LODs
- Several subtopics
- Measuring error
- Hausdorff distance
- Quadrics
- Simplification operator (polygon elision mech)
- Cell collapse
- Vertex removal
- Edge collapse
- Simplification algorithm (high-level approach)
14Edge Collapse Algorithm
V2
V2
Collapse
V1
15Edge Collapse Algorithm
- Sort all edges (by some metric)
- repeat
- Collapse edge
- choose edge vertex (or compute optimal vertex)
- Fix-up topology
- until (no edges left)
16Edge Collapse Benefits
- Edge collapse operation is simple
- Supports non-manifold topology
17Edge Collapse vs. Vertex-Pair Merging
- Even better vertex-pair merging merges two
vertices that - Share an edge, or
- Are within some threshold distance t
- Q What does vertex-pair merging enable over edge
collapse?
18Quadric Error Metric
- Minimize distance to all planes at a vertex
- Plane equation for each face
v
0
p
D
Cz
By
Ax
ù
é
x
ú
ê
y
T
v
p
D
C
B
A
z
ú
ê
û
ë
1
19Squared Distance At a Vertex
20Quadric Derivation (contd)
- ppT is simply the plane equation squared
ù
é
2
AD
AC
AB
A
ú
ê
2
BD
BC
B
AB
ú
ê
T
pp
ú
ê
2
CD
C
BC
AC
ú
ê
2
D
CD
BD
AD
û
ë
- The ppT sum at a vertex v is a matrix, Q
21Using Quadrics
- Construct a quadric Q for every vertex
v2
v1
The edge quadric
Q2
Q1
Q
Q
Q
Q
2
1
- Sort edges based on edge cost
- Suppose we contract to v1
- v1s new quadric is simply
T
Qv
v
cost
edge
1
1
Q
22Optimal Vertex Placement
- Each vertex has a quadric error metric Q
associated with it - Error is zero for original vertices
- Error nonzero for vertices created by merge
operation(s) - Minimize Q to calculate optimal coordinates for
placing new vertex - Details in paper
- Authors claim 40-50 less error
23Boundary Preservation
- To preserve important boundaries, label edges as
normal or discontinuity - For each face with a discontinuity, a plane
perpendicular intersecting the discontinuous edge
is formed. - These planes are then converted into quadrics,
and can be weighted more heavily with respect to
error value.
24Preventing Mesh Inversion
- Preventing foldovers
- Calculate the adjacent face normals, then test if
they would flip after simplification - If so, that simplification can be weighted
heavier or disallowed.
7
8
2
10
A
6
9
3
merge
1
5
4
25Quadric Error Metric
- Pros
- Fast! (bunny to 100 polygons 15 sec)
- Good fidelity even for drastic reduction
- Robust -- handles non-manifold surfaces
- Aggregation -- can merge objects
26Quadric Error Metric
- Cons
- Introduces non-manifold surfaces(bug or
feature?) - Tweak factor t is ugly
- Too large O(n2) running time
- Correct value varies with model density
- Needs further extension to handle color (7x7
matrices)
27Measuring Error
- Most LOD algorithms measure error geometrically
- What is the distance between the original and
simplified surface? - What is the volume between the surfaces?
- Etc
- Really this is just an approximation to the
actual visual error, which includes - Color, normal, texture distortion
- Importance of silhouettes, background
illumination, semantic importance, etc etc etc
28Measuring Geometric Error
- Hausdorff distance
- Average distance
- Surface-surface vs vertex-surface vs
vertex-plane vsvertex-vertex - Quadric error metrics vertex-plane measure that
works well in practice