Presentation is loading. Please wait.

Presentation is loading. Please wait.

DPL3/9/2016 CS 551/651: Simplification Continued David Luebke

Similar presentations


Presentation on theme: "DPL3/9/2016 CS 551/651: Simplification Continued David Luebke"— Presentation transcript:

1 DPL3/9/2016 CS 551/651: Simplification Continued David Luebke cs551dl@cs.virginia.eduhttp://www.cs.virginia.edu/~cs551dl

2 DPL3/9/2016 Assignment 3 Issues Due Thursday morning (late week?) Due Thursday morning (late week?) Matrix inversion code Matrix inversion code The.poly files The.poly files –How many floats/vertex? –Max vertices/face? –What’s wrong with the horse model? Efficiently finding nearby vertices Efficiently finding nearby vertices Other questions? Other questions?

3 DPL3/9/2016 Administrivia Final: Test or Project Final: Test or Project –Likely test: ~1.5 hours –Likely project: particle-system OpenGL eye candy Opinions? Opinions? –Note: I reserve the right to ignore them

4 DPL3/9/2016 Lecture Outline Recap Quadric Error Metrics Recap Quadric Error Metrics Finish up QEM Finish up QEM Dynamic LOD Dynamic LOD

5 DPL3/9/2016 50 Vertices500 Vertices2000 Vertices Model courtesy of InfoGraphica Recap: Level of Detail

6 DPL3/9/2016 Recap: Creating LODs Creating LODs Creating LODs –Polygon elision mechanisms Sampling Sampling Decimation Decimation Vertex-merging (edge-collapsing) Vertex-merging (edge-collapsing) Adaptive subdivision Adaptive subdivision –What criteria to guide simplification? Visual/perceptual criteria are hard Visual/perceptual criteria are hard Geometric criteria are more common Geometric criteria are more common

7 DPL3/9/2016 Recap: Vertex Clustering Rossignac/Borrel: uniform 3D grid Rossignac/Borrel: uniform 3D grid –Rank vertices –Collapse all verts to most important –Filter out degenerate polygons Low-Tan: floating cell clustering Low-Tan: floating cell clustering –Center cells on most important vertices –Collapse to nearest containing cell –Rank slightly differently (cos  /2)

8 DPL3/9/2016 Recap: Decimation The algorithm: multiple passes over all model vertices The algorithm: multiple passes over all model vertices –Consider each vertex for deletion Characterize local geometry/topology Characterize local geometry/topology Evaluate criteria & possibly delete vertex with surrounding triangles Evaluate criteria & possibly delete vertex with surrounding triangles If deleted, triangulate resulting hole If deleted, triangulate resulting hole

9 DPL3/9/2016 Edge Collapse Algorithm V1V1 V2V2 V2V2 Collapse

10 DPL3/9/2016 Edge 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)

11 DPL3/9/2016 Vertex-Pair Merging Even better: vertex-pair merging merges two vertices that: Even better: vertex-pair merging merges two vertices that: –Share an edge, or –Are within some threshold distance t Allows holes to close and objects to merge Allows holes to close and objects to merge In Garland-Heckbert terms: the two vertices share a virtual edge In Garland-Heckbert terms: the two vertices share a virtual edge

12 DPL3/9/2016 Quadric Error Metric Minimize distance to all planes at a vertex Minimize distance to all planes at a vertex Plane equation for each face: Plane equation for each face: 0 :p  DCzByAx v           1 z y x DCBA T vp Distance to vertex v : Distance to vertex v :

13 DPL3/9/2016 Quadric Derivation (cont’d) pp T is simply the plane equation squared: pp T is simply the plane equation squared: The pp T sum at a vertex v is a matrix, Q: The pp T sum at a vertex v is a matrix, Q:  vQvv T  )(              2 2 2 2 DCDBDAD CDCBCAC BDBCBAB ADACABA pp T

14 DPL3/9/2016 Construct a quadric Q for every vertex Construct a quadric Q for every vertex Q1Q1 Q2Q2 v2v2 v1v1 Sort edges based on edge cost Sort edges based on edge cost –Suppose we contract to v new : Edge cost = V new T Q V new Edge cost = V new T Q V new –v 1 ’s new quadric is simply Q Q 21 QQQ  The edge quadric: Using Quadrics v new

15 DPL3/9/2016 Optimal Vertex Placement Each vertex has a quadric error metric Q associated with it 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 Minimize Q to calculate optimal coordinates for placing new vertex –Details in paper –Authors claim 40-50% less error

16 DPL3/9/2016 Q.E.M. Algorithm find candidate vertex pairs; sort pairs by edge cost; repeat merge lowest-cost vertex pair; replace with optimal vertex; remove degenerate triangles; adjust cost of affected pairs; re-sort pairs; until no pairs left or budget met

17 DPL3/9/2016 Boundary Preservation To preserve important boundaries, label edges as normal or discontinuity 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. 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. These planes are then converted into quadrics, and can be weighted more heavily with respect to error value.

18 DPL3/9/2016 Preventing Mesh Inversion Preventing foldovers: Preventing foldovers: Calculate the adjacent face normals, then test if they would flip after simplification Calculate the adjacent face normals, then test if they would flip after simplification If so, that simplification can be weighted heavier or disallowed. If so, that simplification can be weighted heavier or disallowed. 10 54 6 1 3 2 9 A 7 8 54 6 3 2 8 9 A merge

19 DPL3/9/2016 Quadric Error Metric Pros: Pros: –Fast! (bunny to 100 polygons: 15 sec) –Good fidelity even for drastic reduction –Robust -- handles non-manifold surfaces –Aggregation -- can merge objects

20 DPL3/9/2016 Quadric Error Metric Cons: Cons: –Introduces non-manifold surfaces (bug or feature?) –Tweak factor t is ugly Too large: O(n 2 ) running time Too large: O(n 2 ) running time Correct value varies with model density Correct value varies with model density –Needs further extension to handle color (7x7 matrices)

21 DPL3/9/2016 Dynamic LOD New topic: dynamic level of detail New topic: dynamic level of detail

22 DPL3/9/2016 Traditional Approach: Static Level of Detail Traditional LOD in a nutshell: Traditional LOD in a nutshell: –Create LODs for each object separately in a preprocess –At run-time, pick each object’s LOD according to the object’s distance (or similar criterion) Since LODs are created offline at fixed resolutions, I refer to this as Static LOD Since LODs are created offline at fixed resolutions, I refer to this as Static LOD

23 DPL3/9/2016 Advantages of Static LOD Simplest programming model; decouples simplification and rendering Simplest programming model; decouples simplification and rendering –LOD creation need not address real-time rendering constraints –Run-time rendering need only pick LODs Fits modern graphics hardware well Fits modern graphics hardware well –Can compile each LOD into triangle strips and display lists –These render much faster than unorganized polygons on today’s hardware

24 DPL3/9/2016 Dynamic Level of Detail A relatively recent departure from the traditional static approach: A relatively recent departure from the traditional static approach: –Static LOD: create individual LODs in a preprocess –Dynamic LOD: create data structure from which any desired level of detail can be extracted at run time.

25 DPL3/9/2016 Advantages of Dynamic LOD Better granularity  better fidelity Better granularity  better fidelity Better granularity  smoother transitions Better granularity  smoother transitions Supports progressive transmission Supports progressive transmission Supports view-dependent LOD Supports view-dependent LOD –Use current view parameters to select best representation for the current view –Single objects may thus span several levels of detail

26 DPL3/9/2016 View-Dependent LOD: Examples Show nearby portions of object at higher resolution than distant portions Show nearby portions of object at higher resolution than distant portions View from eyepoint Birds-eye view

27 DPL3/9/2016 View-Dependent LOD: Examples Show silhouette regions of object at higher resolution than interior regions Show silhouette regions of object at higher resolution than interior regions

28 DPL3/9/2016 Advantages of View-Dependent LOD Even better granularity Even better granularity Enables drastic simplification of very large objects Enables drastic simplification of very large objects –Example: stadium model –Example: terrain flyover

29 DPL3/9/2016 Drastic Simplification: The Problem With Large Objects

30 DPL3/9/2016 Dynamic LOD Algorithms Many good published algorithms: Many good published algorithms: –Progressive Meshes by Hoppe [SIGGRAPH 96, SIGGRAPH 97] –Merge Trees by Xia & Varshney [Visualization 96] –Hierarchical Dynamic Simplification by Luebke & Erikson [SIGGRAPH 97] –Others... I’ll mostly describe my own work I’ll mostly describe my own work

31 DPL3/9/2016 Overview: The Algorithm A preprocess builds the vertex tree, a hierarchical clustering of vertices A preprocess builds the vertex tree, a hierarchical clustering of vertices At run time, clusters appear to grow and shrink as the viewpoint moves At run time, clusters appear to grow and shrink as the viewpoint moves Clusters that become too small are collapsed, filtering out some triangles Clusters that become too small are collapsed, filtering out some triangles

32 DPL3/9/2016 Data Structures The vertex tree The vertex tree –Represents the entire model –Hierarchy of all vertices in model –Queried each frame for updated scene The active triangle list The active triangle list –Represents the current simplification –List of triangles to be displayed –We’ll come back to this later

33 DPL3/9/2016 The Vertex Tree Each vertex tree node contains: Each vertex tree node contains: –A subset of model vertices –A representative vertex or repvert Folding a node collapses its vertices to the repvert Folding a node collapses its vertices to the repvert Unfolding a node splits the repvert back into vertices Unfolding a node splits the repvert back into vertices

34 DPL3/9/2016 Vertex Tree Example 1 3 2 9 87 10 54 6 12745689 ABC I 3 II R Triangles in active list Vertex tree

35 DPL3/9/2016 Vertex Tree Example 3 1 2 9 87 10 54 6 12745689 ABC I 3 II R A Triangles in active list Vertex tree

36 DPL3/9/2016 Vertex Tree Example 9 8 10 54 6 12745689 BC I 3 II R A 3 A Triangles in active list Vertex tree

37 DPL3/9/2016 Vertex Tree Example 9 8 10 54 6 12745689 BC I 3 II R A 3 B A Triangles in active list Vertex tree

38 DPL3/9/2016 Vertex Tree Example 10 12745689 C I 3 II R A 3 B 8 9 AB Triangles in active list Vertex tree

39 DPL3/9/2016 Vertex Tree Example 10 12745689 C I 3 II R A 3 B C 8 9 AB Triangles in active list Vertex tree

40 DPL3/9/2016 Vertex Tree Example 10 12745689 I 3 II R A 3 B C ABC Triangles in active list Vertex tree

41 DPL3/9/2016 Vertex Tree Example II 10 12745689 I 3 R A 3 B C II ABC Triangles in active list Vertex tree

42 DPL3/9/2016 Vertex Tree Example 10 12745689 C I 3 R A B II AB Triangles in active list Vertex tree

43 DPL3/9/2016 Vertex Tree Example 12745689 C103 R B II I A 10 AB III Triangles in active list Vertex tree

44 DPL3/9/2016 Vertex Tree Example 12745689 AC103 R B II I B I Triangles in active list Vertex tree

45 DPL3/9/2016 Vertex Tree Example 12745689 AC103 R R B II I B I Triangles in active list Vertex tree

46 DPL3/9/2016 Vertex Tree Example 12745689 ABC10 I 3 II R R Triangles in active list Vertex tree

47 DPL3/9/2016 The Vertex Tree: Folding And Unfolding 3 1 2 9 87 10 54 6 A 9 8 54 6 A 3 Fold Node A Unfold Node A

48 DPL3/9/2016 The Vertex Tree: Tris and Subtris 3 1 2 9 87 10 54 6 9 8 54 6 A 3 Fold Node A Unfold Node A Node->Tris : triangles that change shape upon folding Node->Subtris : triangles that disappear completely

49 DPL3/9/2016 The Vertex Tree: Tris and Subtris Each node’s tris and subtris can be computed offline to be accessed very quickly at run time Each node’s tris and subtris can be computed offline to be accessed very quickly at run time This is the key observation behind dynamic simplification This is the key observation behind dynamic simplification

50 DPL3/9/2016 The Vertex Tree: Tris and Subtris Computing tris and subtris: Computing tris and subtris: –node->tris = triangles with exactly one corner vertex supported by node –node->subtris = triangles with: Two or three corners in different subnodes Two or three corners in different subnodes No two corners in the same subnode No two corners in the same subnode

51 DPL3/9/2016 The Vertex Tree: Tris and Subtris A Node Subnodes

52 DPL3/9/2016 The Vertex Tree: Tris and Subtris This is a tri of the node

53 DPL3/9/2016 The Vertex Tree: Tris and Subtris This is a subtri of the node

54 DPL3/9/2016 The Vertex Tree: Tris and Subtris This is neither. It is a subtri of a subnode

55 DPL3/9/2016 View-Dependent Simplification Any run-time criterion for folding and unfolding nodes may be used Any run-time criterion for folding and unfolding nodes may be used I’ve implemented three such criteria: I’ve implemented three such criteria: –Screenspace error threshold –Silhouette preservation –Triangle budget simplification

56 DPL3/9/2016 Screenspace Error Threshold Nodes chosen by projected area Nodes chosen by projected area –User sets screenspace size threshold –Nodes which grow larger than threshold are unfolded

57 DPL3/9/2016 Silhouette Preservation Retain more detail near silhouettes Retain more detail near silhouettes –A silhouette node supports triangles on the visual contour –Use tighter thresholds when examining silhouette nodes

58 DPL3/9/2016 Triangle Budget Simplification Minimize error within specified number of triangles Minimize error within specified number of triangles –Sort nodes by screenspace error –Unfold node with greatest error –Repeat until budget is reached

59 DPL3/9/2016 Other Possible View-Dependent Criteria Specular highlights: Xia describes a fast test to unfold likely nodes Specular highlights: Xia describes a fast test to unfold likely nodes Surface deviation: Hoppe uses an elegant surface deviation metric that combines silhouette preservation and screenspace error threshold Surface deviation: Hoppe uses an elegant surface deviation metric that combines silhouette preservation and screenspace error threshold Quadric error metrics: Can represent Garland’s Q.E.M.’s as ellipsoids, which map to ellipses on screen Quadric error metrics: Can represent Garland’s Q.E.M.’s as ellipsoids, which map to ellipses on screen

60 DPL3/9/2016 Optimizations Exploiting temporal coherence Exploiting temporal coherence –Scene changes slowly over time Asynchronous simplification Asynchronous simplification –Parallelize the algorithm

61 DPL3/9/2016 Exploiting Temporal Coherence Idea: frame-to-frame changes are small Idea: frame-to-frame changes are small Two examples: Two examples: –Active triangle list –Vertex tree

62 DPL3/9/2016 Exploiting Temporal Coherence Active triangle list Active triangle list –Few triangles are added or deleted each frame –Store current simplification, make only incremental changes –Simple implementation: doubly-linked list of triangles –Better: arrays with garbage collection

63 DPL3/9/2016 Unfolded Nodes Boundary Nodes Exploiting Temporal Coherence Vertex Tree Vertex Tree –Few nodes change per frame –Don’t traverse whole tree –Do local updates only at boundary nodes

64 DPL3/9/2016 Algorithm partitions into two tasks: Algorithm partitions into two tasks: Run them on separate processors Run them on separate processors Simplify Task Render Task Active Triangle List … Asynchronous Simplification Vertex Tree

65 DPL3/9/2016 Optimizations: Node  Tris Recall that node  tris is a list of triangles that change shape when node is folded or unfolded Recall that node  tris is a list of triangles that change shape when node is folded or unfolded Storing this list explicitly is an optimization of questionable value Storing this list explicitly is an optimization of questionable value –Speeds up folding & unfolding slightly –But requires considerably more storage Alternative: lazy evaluation Alternative: lazy evaluation –Update triangle shape at render time

66 DPL3/9/2016 Summary: Pros View-dependent; handles the Problem With Large Objects View-dependent; handles the Problem With Large Objects Hierarchical; handles the Problem With Small Objects Hierarchical; handles the Problem With Small Objects –Assuming vertices from different objects are merged in vertex tree Robust; does not require (or preserve) clean mesh topology Robust; does not require (or preserve) clean mesh topology  Supports drastic simplification!

67 DPL3/9/2016 Summary: Cons Currently nothing to prevent mesh foldovers: Currently nothing to prevent mesh foldovers: 10 54 6 1 3 7 2 8 9

68 DPL3/9/2016 10 54 6 1 3 2 9 A 7 Summary: Cons Currently nothing to prevent mesh foldovers: Currently nothing to prevent mesh foldovers: 8

69 DPL3/9/2016 Summary: Cons Currently nothing to prevent mesh foldovers: Currently nothing to prevent mesh foldovers: 10 54 6 3 2 8 9 A

70 DPL3/9/2016 Related Work Hoppe: Progressive Meshes (SIGGRAPH 96, 97) Hoppe: Progressive Meshes (SIGGRAPH 96, 97) –Edge collapse vs. vertex merging –Pros: Dynamic, view-dependent simplification Dynamic, view-dependent simplification Elegant scheme for mesh attributes Elegant scheme for mesh attributes –Cons: Requires clean mesh topology Requires clean mesh topology Slow preprocess Slow preprocess Still per-object LOD Still per-object LOD

71 DPL3/9/2016 Related Work Popovic: Progressive Simplicial Complexes Popovic: Progressive Simplicial Complexes –General vertex pair unification –Pros: Intelligently simplifies topology Intelligently simplifies topology Dynamic and hierarchical LOD Dynamic and hierarchical LOD –Cons: Extremely slow preprocess Extremely slow preprocess Doesn’t address view-dependent LOD Doesn’t address view-dependent LOD

72 DPL3/9/2016 Related Work: Static LOD Garland: Quadric Error Metrics Garland: Quadric Error Metrics –Leading (published) static LOD algorithm –Uses vertex pair merging –Pros: Very fast with good fidelity Very fast with good fidelity Doesn’t require clean topology Doesn’t require clean topology –Cons: Still static LOD Still static LOD “Tweak factor” picking distance threshold t “Tweak factor” picking distance threshold t

73 DPL3/9/2016 Dynamic Vs. Static LOD Dynamic LOD is superior to traditional static LOD when: Dynamic LOD is superior to traditional static LOD when: –Models contain very large individual objects (e.g., terrains) –Simplification must be completely automatic (e.g., CAD design reviews) –Experimenting with view-dependent simplification criteria –Progressive refinement is desirable

74 DPL3/9/2016 Dynamic Vs. Static LOD Static LOD is often the better choice: Static LOD is often the better choice: –Simplest programming model –Reduced run-time CPU load –Can capture LODs in display lists, which render much faster on most modern hardware

75 DPL3/9/2016 Dynamic Vs. Static LOD Summary: Summary: –Dynamic (and view-dependent) LOD Conceptually cleaner Conceptually cleaner Better fidelity for given polygon count Better fidelity for given polygon count –Static LOD Easier to do Easier to do Fits current hardware better Fits current hardware better

76 DPL3/9/2016 Dynamic Vs. Static LOD Applications that may want to use: Applications that may want to use: –Static LOD Video games Video games Simulators Simulators Many walkthrough-style demos Many walkthrough-style demos –Dynamic LOD CAD design review tools CAD design review tools Medical & scientific visualization toolkits Medical & scientific visualization toolkits Many terrain flyovers Many terrain flyovers


Download ppt "DPL3/9/2016 CS 551/651: Simplification Continued David Luebke"

Similar presentations


Ads by Google