Escolar Documentos
Profissional Documentos
Cultura Documentos
Computer Graphics
Dept of Computer Sc. & Engg.
IIT Delhi
Mesh
List of triangles
Each is a triplet of Vertices
Each is an array of attributes
Euler’s relation:
V + F -2 = E
Adjacency list
List of vertices
List of “pointers”
A vertex referred ~6 times (closed model)
Vertex & Topology
Vertex Attributes C
..A.. D
..B.. B
Topology
..C..
..D.. 015 E
..E.. 135 F
..F.. 123
534 A
654
056 G
What order should
we choose?
Post vertex shader cache
Triangle Strip
Vertex Attributes C
..A.. D
..B.. B
..C.. Topology
..D.. E
..E.. ABFDE
F
..F.. AFGE
BCD A
Can we do better?
Euler’s law: V + F = E + 2
V ~ 0.5F (E = 1.5F for closed model)
Structure of arrays x0 x1 x2 x3
Better shader locality
y0 y1 y2 y3
Half-Edge Data Structure
Vertex List Face List Edge List
..V0.. V0 V1, F0, E1 E2, E5
E0 E2 E1
..V1.. ..
E5 E4 E3
..V2.. V1 V0, F1, E3 E4, E0
.
..V3.. ..
.
.
. V1
E5 E3
E2
F1
F0
E0 E4
E1
V0
Winged-Edge Data Structure
Vertex List Face List Edge List
..V0.., E0 E0 V0 V1, F0 F1, E1 E2, E3 E4
..V1.., E0 E4 .
..V2.., E1 . .
..V3.., E4 .
.
V1
. E3
F1
Edge is oriented based on E2
F0 E0
one of its faces: left or right E4
E1
V0
Mesh Simplification
^
M=Mn M175 M1 M0
ecoln-1 ecoli ecol0
courtesy H. Hoppe
Inverse?
parameters
vspl(vs ,vl ,vr , vs’ ,vt’,…)
v’t
vl vr vl vr
vs
v’s
Reconstruction
M0 M1 M175 ^
Mn=M
vspl0 … vspli … vspln-1
courtesy H. Hoppe
Continuous LOD
From PM, extract Mi of any size
3,478 faces?
M0 vspl0 vspl1 vspli-1 vspln-1 3,478
Mi
M0 ^
Mn=M
Mi
courtesy H. Hoppe
Vertex Correspondence
Mf Mf-1 Mf-2 Mc
Mn v1 v1 v1 v1 M0
v2 v2 v2 v2
ecol ecol
v3 v3 v3 v3
v4 v4 v4
ecol
v5 v5 v5
v6 v6 v6
v7 v7
v8
courtesy H. Hoppe
Space Overhead
vspl(vs ,vl ,vr , v’s ,vt’,…)
Attrib deltas:
v’t vt -’ vs
vl vs vr vl vr vs -’ vs
v’s …
Topology:
Index of vs
Pair of index offsets
Selective Refinement
vs
vsplit
vt vu
Vertex Hierarchy
PM: M0 vspl0 vspl1 vspl2 vspl3 vspl4 vspl5
M0 v1 v2 v3
v10 v11 v4 v5 v8 v9
Mn v12 v13 v6 v7
v14 v15
[Xia & Varshney 96]
Selective Refinement
M0 vspl0 vspl1 vspl2 vspl3 vspl4 vspl5
M0 v1 v2 v3
v10 v11 v4 v5 v8 v9
v12 v13 v6 v7
vsplit
vl vr v’t
vs
vl vr
ecol v’s
vsplit legal if vs, vl , and vr present
M0 v1 v2 v3
v10 v11 v4 v5 v8 v9
v12 v13 v6 v7
dependency
previous mesh
v14 v15 new mesh
LOD Algorithms
Simplification operator
Where should it be applied
No optimization
e.g., uniform grid cells
Greedy optimization
Sort edge collapses by error
Re-insert modified edges after each step
Lazy optimization
Re-insert a modified edge only when in front
Local vs Global optimization
Error Metric
Preserve appearance:
Geometric shape
Scalar fields (e.g. color)
Discontinuity curves
E (e
face areas
shape escalars )dA (e disc
disc. edges
)dL
points
points
courtesy H. Hoppe
Measuring Error
Geometric error
Distance between the original and simplified surface?
Volume between the surfaces?
Visual error
Color, normal, & texture distortion
Silhouettes, background illumination
Semantics
Many others
Measuring Geometric Error
Surface-surface
Hausdorff distance
Vertex-surface vs
Vertex-plane
Vertex-vertex
Average distance or Max distance
Quadric Error
[Garland & Heckbert] 1998
Measure error by deviation from shape
Vertices are at intersection of planes
v’t
p planes ( v )
(v T T
p )( p v ) v T T
( pp )v v ppT
T
v
p planes ( v ) p planes ( v ) pplanes ( v )
Quadric Error (cont’d)
A2 AB AC AD
2
AB B BC BD
ppT
AC BC C2 CD
2
AD BD CD D
(v) v Qv
T
Quadrics Based Simplification
Maintain quadric Q for every vertex
v1 v2
Assign Edge Quadrics
Q1 Q Q1 Q2 Q2
Sort edges based on quadric error
Need position of resulting vertex
(v) vT Qv
1
q11 q12 q13 q14 0
q q 22 q 23 q 24 0
12
V
q13 q 23 q33 q34 0
0 0 0 1 1
Boundary Preservation
Label boundaries
Form boundary plane perpendicular to face
Convert planes into quadrics
Weighted sum of quadrics
Scale border plane quadric higher
Preventing Mesh Inversion
Preventing foldovers:
7
8 8
2 2
10 10
A 6 A 6
9 9
3 3
1 merge
4 5 4 5
Side effects:
Drastically simplifies invisible regions!
Image-Driven Simplification
Cons:
Very slow
Still many examples that breaks it:
Hard to know how many images is enough
Hard to know how to evaluate images (RMS vs
Bolin-Meyer)
Screen Space Error
Depends on location and orientation of error
vector
We don’t even store error vectors
Screen Space Error
y+ε sin θ ε θ
z+ε cos θ y,z
εs
y/z
Eye
LOD
d
viewing p
plane r d dr
p 2
z 2
2 z tan( )
eye 2
Appearance Preservation
Material Color
v2, c2, n2
Filters surface
position, colors, and
normals
v3, c3, n3 Must filter all three
v1, c1, n1 equally
v 1, t 1
v3, t3
normal map
v = vertex coordinate = (x,y,z) n2
t = texture coordinate = (u,v) n 3 n1
c = color = (r,g,b)
n = normal vector = (nx,ny,nz)
Decoupled Approach
Xi
Xi+1
x
ei,i+1(x) = || xi+1 - xi ||
P
Ei,i+1 = max ei,i+1(x)
2D texture domain xP
New Texture Coordinates
Texture Space
1
Ei ( X ) || X T0 (Ti ( X )) ||
APS Levels-of-detail
7,809 tris
488 tris
975 tris
1,951 tris
3,905 tris
courtesy J. Cohen
Terrains
Uniform array of height values
May encode in raster formats (DEM, GeoTIFF)
Store Z instead of color
QuadTree Hierarchy
BinTree Hierarchy
Quadtrees
Each quad is actually two triangles
Produces cracks and T-junctions
But simple
Bintrees
Avoid cracks:
Convert cracks into T-junctions
Fill cracks with extra triangles
Avoid T-junctions:
Continue to simplify ...
Bin-tree and T-junction
Terrain as a Pyramid
•Terrain as mipmap pyramid
•LOD using nested grids
Coarsest Level