Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.

Similar presentations


Presentation on theme: "CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi."— Presentation transcript:

1 CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi

2 Mesh List of triangles List of triangles Each is a triplet of Vertices Each is a triplet of Vertices Each is an array of attributes Each is an array of attributes Euler’s relation: Euler’s relation: V + F -2 = E V + F -2 = E Adjacency list Adjacency list List of vertices List of vertices List of “pointers” List of “pointers” A vertex referred ~6 times (closed model) A vertex referred ~6 times (closed model)

3 Vertex & Topology A G F B C D E..A....B....C....D....E....F.. Vertex Attributes Topology 0 1 5 1 3 5 1 2 3 5 3 4 6 5 4 0 5 6 What order should we choose? Post vertex shader cache

4 Triangle Strip A G F B C D E..A....B....C....D....E....F.. Vertex Attributes Topology ABFDE AFGE BCD Can we turn any given model into a single strip? Would that eliminate the need for storing topology?

5 Post Shader Cache Perfect Triangle Strip of n triangles => Perfect Triangle Strip of n triangles => 1 new vertex per triangle 1 new vertex per triangle n-2 cache misses n-2 cache misses Can we do better? Can we do better? Euler’s law: V + F = E + 2 Euler’s law: V + F = E + 2 V ~ 0.5F (E = 1.5F for closed model) V ~ 0.5F (E = 1.5F for closed model) Yes (Ideal: 0.5verts/triangle) Yes (Ideal: 0.5verts/triangle) [Chhugani & Kumar, I3D 2007] [Chhugani & Kumar, I3D 2007]

6 Vertex Arrays Array of structures Array of structures Better triangle locality Better triangle locality Structure of arrays Structure of arrays Better shader locality Better shader locality V0 x y z u v a b c x0 x1 x2 x3 V1 x y z u v a b c y0 y1 y2 y3

7 Half-Edge Data Structure Vertex List Face List Edge List..V0....V1....V2....V3... E0 E2 E1 E5 E4 E3. V0 V1, F0, E1 E2, E5.. V1 V0, F1, E3 E4, E0.. E0 E3 E4 E2 E1 V0 V1 F0 F1 E5

8 Winged-Edge Data Structure Vertex List Face List Edge List..V0.., E0..V1.., E0..V2.., E1..V3.., E4. E0 E4. V0 V1, F0 F1, E1 E2, E3 E4. E0 E3 E4 E2 E1 V0 V1 F0 F1 Edge is oriented based on one of its faces: left or right

9 Mesh Simplification courtesy H. Hoppe Ideally, the change is incremental

10 Nominal Framework Pre-processing Pre-processing Create and store levels in a data-structure Create and store levels in a data-structure Rendering time Rendering time Decide the appropriate detail Decide the appropriate detail Coarse or fine-grained Coarse or fine-grained Output count or approximation error Output count or approximation error Traverse DS to generate that detail Traverse DS to generate that detail Render Render

11 Competing Goals Computational Efficiency Computational Efficiency Some pre-processing Some pre-processing Storage Efficiency Storage Efficiency Quality Quality Error metrics Error metrics screen space vs object space screen space vs object space Geometry, attributes, appearance Geometry, attributes, appearance Global vs local optimization Global vs local optimization local may be faster local may be faster global may generate closer approximations global may generate closer approximations

12 Attributes Color Color Normal Vectors Normal Vectors Texture Coordinates Texture Coordinates Curvature Curvature Material Properties Material Properties

13 Topology Considerations Manifold vs non-manifold Manifold vs non-manifold Topology preservation Topology preservation important in some areas important in some areas if topology is changed, then we can: if topology is changed, then we can: close holes in objects close holes in objects join disconnected components join disconnected components Shape and attribute appearance more important than topology Shape and attribute appearance more important than topology

14 Possible Algorithm? Subdivide space into cells Subdivide space into cells Choose a vertex to represent each cell Choose a vertex to represent each cell For each pair of cells For each pair of cells If two vertices in two cells have an edge If two vertices in two cells have an edge Connect the representative vertices Connect the representative vertices Borel, Rossignac [1993] Borel, Rossignac [1993]

15 Reduce Geometry Count Remove a vertex Remove a vertex That leave a hole That leave a hole Retriangulate the hole Retriangulate the hole Schroeder et al., 1992

16 Simple Operation Collapse edges, one at a time Collapse edges, one at a time vlvlvlvl vrvrvrvr vtvtvtvt vsvsvsvs ecol(v s,v t, v s ) ’ vsvsvsvs vlvlvlvl vrvrvrvr ’

17 Simplification 13,546500152150 M0M0M0M0 M1M1M1M1 M 175 ecol 0 ecol i ecol n-1 M=M n ^ courtesy H. Hoppe

18 Inverse? vlvlvlvl vrvrvrvr v’ t v’ s vsvsvsvs vlvlvlvl vrvrvrvr vspl(v s,v l,v r, v s,v t,…) ’’ parameters

19 Reconstruction150 M0M0M0M0 M1M1M1M1 vspl 0 152 M 175 500 … vspl i … 13,546 vspl n-1 M n =M ^ Progressive Mesh (PM) representation M n =M ^ courtesy H. Hoppe

20 Continuous LOD From PM, extract M i of any size M0M0M0M0 vspl 0 vspl 1 vspl i-1 vspl n-1 MiMiMiMi 3,478 faces? 3,478 M0M0M0M0 M n =M ^ MiMiMiMi courtesy H. Hoppe

21 Vertex Correspondence MnMnMnMn M0M0M0M0 McMcMcMc MfMfMfMf v1v1v1v1 v2v2v2v2 v3v3v3v3 v4v4v4v4 v5v5v5v5 v6v6v6v6 v7v7v7v7 v8v8v8v8 v1v1v1v1 v2v2v2v2 v3v3v3v3 M f-1 v1v1v1v1 v2v2v2v2 v3v3v3v3 v4v4v4v4 v5v5v5v5 v6v6v6v6 v7v7v7v7 ecol M f-2 v1v1v1v1 v2v2v2v2 v3v3v3v3 v4v4v4v4 v5v5v5v5 v6v6v6v6 ecol ecol courtesy H. Hoppe

22 Space Overhead Attrib deltas: v t - v s v s - v s … ’ ’ vlvlvlvl vrvrvrvr v’ t v’ s vspl(v s,v l,v r, v s,v t,…) ’’ vsvsvsvs vlvlvlvl vrvrvrvr Topology: l Index of v s l Pair of index offsets

23 Selective Refinement M0M0M0M0 vspl 0 vspl 1 vspl i-1 vspl n-1 courtesy H. Hoppe What’s the problem?

24 Parent-Child Correspondence vsvsvsvs vtvtvtvt vuvuvuvu vsplit

25 v2v2v2v2 Vertex Hierarchy vspl 0 M0M0M0M0 vspl 1 vspl 2 vspl 3 vspl 4 vspl 5 v1v1v1v1 v3v3v3v3 M0M0M0M0 v 10 v 11 vspl 3 v1v1v1v1 v2v2v2v2 v4v4v4v4 v5v5v5v5 vspl 0 v8v8v8v8 v9v9v9v9 vspl 2 v3v3v3v3 v6v6v6v6 v7v7v7v7 vspl 1 v5v5v5v5 v 12 v 13 vspl 4 v 10 vspl 5 v 14 v 15 v6v6v6v6 PM: MnMnMnMn [Xia & Varshney 96] M0M0M0M0

26 vspl 2 v 11 v1v1v1v1 v2v2v2v2 v4v4v4v4 v8v8v8v8 v9v9v9v9 v3v3v3v3 v7v7v7v7 v5v5v5v5 v 12 v 13 v 10 v 14 v 15 v6v6v6v6 v2v2v2v2 Selective Refinement vspl 0 M0M0M0M0 vspl 1 vspl 3 vspl 4 vspl 5 v1v1v1v1 v3v3v3v3 M0M0M0M0 v 10 v 11 vspl 3 v1v1v1v1 v2v2v2v2 v4v4v4v4 v5v5v5v5 vspl 0 v6v6v6v6 v7v7v7v7 vspl 1 v5v5v5v5 v 12 v 13 vspl 4 v 10 selectively refined mesh v8v8v8v8 v9v9v9v9 vspl 2 v3v3v3v3 v8v8v8v8 v9v9v9v9 v3v3v3v3 Restrictions?

27 Dependencies vsplit ecol vsplit legal if v s, v l, and v r present vsplit legal if v s, v l, and v r present ecol legal if local neighbors present ecol legal if local neighbors present vlvlvlvl vrvrvrvr v’ t v’ s vsvsvsvs vlvlvlvl vrvrvrvr [Xia & Varshney 96]

28 Consistency vsplit ecol f n1 f n0 vsvsvsvs f n3 f n2 vsplit legal if: v s is active f n0,f n1,f n2,f n3 are active ecol legal if: v’ s,v’ t are active f n0,f n1,f n2,f n3 are adjacent f n1 f n0 v’ t f n3 f n2 v’ u [Hoppe 97]

29 Rendering Algorithm Start with the active front in previous frame. Start with the active front in previous frame. Exploits frame coherence Exploits frame coherence For each vertex, decided refine or coarsen For each vertex, decided refine or coarsen If legal, perform operation, otherwise: If legal, perform operation, otherwise: Make vertex split legal by generating necessary vertices Make vertex split legal by generating necessary vertices Leave Edge collapses alone Leave Edge collapses alone Amortize? Amortize? At each frame apply only a fraction of the eligible ops At each frame apply only a fraction of the eligible ops

30 previous mesh v5v5v5v5 v 10 v 11 v4v4v4v4 v8v8v8v8 v9v9v9v9 v7v7v7v7 v 12 v 13 v1v1v1v1 v2v2v2v2 v3v3v3v3 Rendering Algorithm M0M0M0M0 v6v6v6v6 v 14 v 15 v 12 v 13 v 12 v 10 v 11 v 10 v 11 v4v4v4v4 v4v4v4v4 v6v6v6v6 v 14 v 15 v6v6v6v6 v 14 v 15 v8v8v8v8 v9v9v9v9 v3v3v3v3 v7v7v7v7 v7v7v7v7 v8v8v8v8 v8v8v8v8 v9v9v9v9 v9v9v9v9 new mesh dependency v 11 v 10 v4v4v4v4 v 14 v 15 v7v7v7v7 v8v8v8v8 v9v9v9v9

31 LOD Algorithms Simplification operator Simplification operator Where should it be applied Where should it be applied No optimization No optimization e.g., uniform grid cells e.g., uniform grid cells Greedy optimization Greedy optimization Sort edge collapses by error Sort edge collapses by error Re-insert modified edges after each step Re-insert modified edges after each step Lazy optimization Lazy optimization Re-insert a modified edge only when in front Re-insert a modified edge only when in front Local vs Global optimization Local vs Global optimization

32 Error Metric Preserve appearance: Preserve appearance: Geometric shape Geometric shape Scalar fields (e.g. color) Scalar fields (e.g. color) Discontinuity curves Discontinuity curves  pointspoints courtesy H. Hoppe

33 Measuring Error Geometric error Geometric error Distance between the original and simplified surface? Distance between the original and simplified surface? Volume between the surfaces? Volume between the surfaces? Visual error Visual error Color, normal, & texture distortion Color, normal, & texture distortion Silhouettes, background illumination Silhouettes, background illumination Semantics Semantics Many others Many others

34 Measuring Geometric Error Surface-surface Surface-surface Hausdorff distance Hausdorff distance Vertex-surface vs Vertex-surface vs Vertex-plane Vertex-plane Vertex-vertex Vertex-vertex Average distance or Max distance Average distance or Max distance

35 Quadric Error [Garland & Heckbert] 1998 [Garland & Heckbert] 1998 Measure error by deviation from shape Measure error by deviation from shape Vertices are at intersection of planes Vertices are at intersection of planes Do not collapse edges Do not collapse edges Merge vertices Merge vertices v’ t v’ s

36 Quadric Error Metric Plane equation for a face: Plane equation for a face: 0 :p  DCzByAx            1 z y x DCBA T vp Distance to vertex v : Distance to vertex v :    )( 2 )()( vplanesp T vpv    )( ))(( vplanesp TT vppv    )( )( v p TT vppv v v vplanesp TT            )(

37 Quadric Error (cont’d) Sum over all planes intersecting at v Sum over all planes intersecting at v Call it Q, the quadric error Call it Q, the quadric error vQvv T  )(              2 2 2 2 DCDBDAD CDCBCAC BDBCBAB ADACABA pp T

38 Maintain quadric Q for every vertex Maintain quadric Q for every vertex Assign Edge Quadrics Assign Edge Quadrics Q1Q1 Q2Q2 v2v2 v1v1 Sort edges based on quadric error Sort edges based on quadric error Need position of resulting vertex Need position of resulting vertex One of original vertices or mid-point? One of original vertices or mid-point? 21 QQQ  Quadrics Based Simplification  vQvv T  )(

39 Optimal Vertex Placement Minimize Q to calculate optimal coordinates for placing new vertex Minimize Q to calculate optimal coordinates for placing new vertex

40 Boundary Preservation Label boundaries Label boundaries Form boundary plane perpendicular to face Form boundary plane perpendicular to face Convert planes into quadrics Convert planes into quadrics Weighted sum of quadrics Weighted sum of quadrics Scale border plane quadric higher Scale border plane quadric higher

41 Preventing Mesh Inversion Preventing foldovers: Preventing foldovers: Adjacent face normals should not flip Adjacent face normals should not flip Disallow foldover, or simply weight heavily Disallow foldover, or simply weight heavily 10 54 6 1 3 2 9 A 7 8 54 6 3 2 8 9 A merge

42 Quadric Error Metric Pros: Pros: Reasonably fast Reasonably fast Good fidelity even for drastic reduction Good fidelity even for drastic reduction Robust -- handles non-manifold surfaces Robust -- handles non-manifold surfaces Aggregation -- can merge objects Aggregation -- can merge objects Cons: Cons: Introduces non-manifold surfaces Introduces non-manifold surfaces User controls virtual-edge collapse threshold User controls virtual-edge collapse threshold Increased running time due to search for potential pairs Increased running time due to search for potential pairs Correct value varies with model density Correct value varies with model density Needs extension to handle color (7x7 matrices) Needs extension to handle color (7x7 matrices)

43 Result – Bunny Model 69,451 triangles1,000 triangles100 triangles 1.4% of original size0.14% of original size courtesy Garland, Heckbert

44 Result – Terrain Model 199,114 faces999 faces (46 secs) courtesy Garland, Heckbert

45 Method Comparison Original model Uniform Vertex Clustering Edge Contractions Pair Contractions (4,204 faces) (262 faces) (250 faces) courtesy Garland, Heckbert

46 Image-Driven Simplification [Lindstrom & Turk 2000] [Lindstrom & Turk 2000] Compare simplifications to original via images Compare simplifications to original via images Collapse edge Collapse edge Render from many views Render from many views Evaluate difference (need image metric) Evaluate difference (need image metric) “Unrender” and retry “Unrender” and retry Pick cheapest and apply Pick cheapest and apply

47 Image-Driven Simplification Pros: Pros: Preserves appearance Preserves appearance Does not need to trade off geometric error against attribute error Does not need to trade off geometric error against attribute error Shading artifacts accounted for Shading artifacts accounted for Side effects: Side effects: Drastically simplifies invisible regions! Drastically simplifies invisible regions!

48 Image-Driven Simplification Cons: Cons: Very slow Very slow Still many examples that breaks it: Still many examples that breaks it: Hard to know how many images is enough Hard to know how many images is enough Hard to know how to evaluate images (RMS vs Bolin-Meyer) Hard to know how to evaluate images (RMS vs Bolin-Meyer)

49 Screen Space Error Depends on location and orientation of error vector Depends on location and orientation of error vector We don’t even store error vectors We don’t even store error vectors

50 Screen Space Error θ y/z y,z y+ε sin θ z+ε cos θ ε εsεs y+ε sin θ z+ε cos θ y/z εs =εs = Eye Image Plane

51 Screen Space Error  r  LOD eye viewing plane p d

52 Appearance Preservation Preserve three appearance attributes: Preserve three appearance attributes: Surface Position Surface Position Surface Curvature Surface Curvature Material Color Material Color Each may require different sampling Each may require different sampling

53 Normals Undersampled 13,433 triangles 1,749 triangles 10 pixels of surface deviation

54 Normals Properly Sampled 13,433 triangles 1,749 triangles, 10 pixels of deviation

55 v 1, c 1, n 1 v = vertex coordinate = (x,y,z) c = color = (r,g,b) n = normal = (n x,n y,n z ) v 2, c 2, n 2 v 3, c 3, n 3 Recall Filters surface position, colors, and normals Filters surface position, colors, and normals Must filter all three equally Must filter all three equally

56 texture map normal map v 1, t 1 v 2, t 2 v 3, t 3 v = vertex coordinate = (x,y,z) t = texture coordinate = (u,v) c = color = (r,g,b) n = normal vector = (n x,n y,n z ) c1c1 c2c2 c3c3 n1n1 n2n2 n3n3 Decoupled Representation

57 Decoupled Approach Simplification filters surface position and texture coordinates Simplification filters surface position and texture coordinates Color and normal attributes filtered per-pixel (mip-mapping, etc.) Color and normal attributes filtered per-pixel (mip-mapping, etc.)

58 Sample Normal Map polygonal surface patchnormal map

59 x Texture Deviation Metric mesh M i mesh M i+1 2D texture domain (i+1) st edge collapse XiXiXiXi X i+1 e i,i+1 (x) = || x i+1 - x i || E i,i+1 = max e i,i+1 (x)  x  P P

60 New Texture Coordinates Invalid tex new Valid choices lie in convex kernel

61 Texture Deviation Error X Texture Space

62 APS Levels-of-detail courtesy J. Cohen 7,809 tris 3,905 tris 1,951 tris 975 tris 488 tris

63 Terrains Uniform array of height values Uniform array of height values May encode in raster formats (DEM, GeoTIFF) May encode in raster formats (DEM, GeoTIFF) Store Z instead of color Store Z instead of color Easy to interpolate to find elevations Easy to interpolate to find elevations Easy view culling Easy view culling There also are TINs There also are TINs Triangulated Irregular Networks Triangulated Irregular Networks

64 TINs Fewer polygons needed Fewer polygons needed Adaptively sampled Adaptively sampled Precisely model maxima, minima, ridges, valleys, overhangs, caves Precisely model maxima, minima, ridges, valleys, overhangs, caves

65 LOD Hierarchy Structures QuadTree Hierarchy BinTree Hierarchy

66 Quadtrees Each quad is actually two triangles Each quad is actually two triangles Produces cracks and T-junctions Produces cracks and T-junctions But simple But simple

67 Bintrees Binary Triangle tree Binary Triangle tree Right triangular irregular networks (RTIN) Right triangular irregular networks (RTIN) longest edge bisection longest edge bisection Easier to avoid cracks and T-junctions Easier to avoid cracks and T-junctions Neighbor must be at adjacent levels Neighbor must be at adjacent levels

68 Cracks and T-Junctions Avoid cracks: Avoid cracks: Convert cracks into T-junctions Convert cracks into T-junctions Fill cracks with extra triangles Fill cracks with extra triangles Avoid T-junctions: Avoid T-junctions: Continue to simplify... Continue to simplify...

69 Bin-tree and T-junction

70 Terrain as a Pyramid Coarsest Level Finest Level Terrain as mipmap pyramid LOD using nested grids Terrain as mipmap pyramid LOD using nested grids [Losasso & Hoppe 2005]

71 Geometry Clip Maps Transition region Transition region Insert “0 area” triangles Insert “0 area” triangles Damp refined vertices as they get close to the coarser level Damp refined vertices as they get close to the coarser level

72 Geometry Clip Maps Transition region Transition region Insert 0 area triangles Insert 0 area triangles Damp refined vertices as they get close to the coarser level Damp refined vertices as they get close to the coarser level

73 Texture Mapping PM [Sander et al, 2001] [Sander et al, 2001]


Download ppt "CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi."

Similar presentations


Ads by Google