Last Time Level of Detail 101403 CS 679

  • Slides: 41
Download presentation
Last Time • Level of Detail 10/14/03 CS 679 - Fall 2003 - Copyright

Last Time • Level of Detail 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Today • LOD Error Metrics • Progressive LOD • View Dependent LOD 10/14/03 CS

Today • LOD Error Metrics • Progressive LOD • View Dependent LOD 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Edge Contraction • Single edge contraction (v 1, v 2) v’ is performed by

Edge Contraction • Single edge contraction (v 1, v 2) v’ is performed by – moving v 1 and v 2 to position v’ – replacing all occurrences of v 2 with v 1 – removing v 2 and all degenerate triangles v 1 v 2 v’ Slide courtesy Michael Garland, http: //graphics. uiuc. edu/~garland 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Vertex Pair Contraction • Can also easily contract any pair of vertices – fundamental

Vertex Pair Contraction • Can also easily contract any pair of vertices – fundamental operation is exactly the same – joins previously unconnected areas – can be used to achieve topological simplification Slide courtesy Michael Garland, http: //graphics. uiuc. edu/~garland 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Operations to Algorithms • A single operation doesn’t reduce a mesh! • Most common

Operations to Algorithms • A single operation doesn’t reduce a mesh! • Most common approach is a greedy algorithm built on edge contractions (iterative edge contractions): – Rank each possible edge contraction according to how much error it would introduce – Contract edge that introduces the least error – Repeat until done 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Error Metrics • The error metric measures the error introduced by contracting an edge

Error Metrics • The error metric measures the error introduced by contracting an edge – Should be low for edges whose removal leaves mesh nearly unchanged • What is an example of an edge that can be removed without introducing any error? • Issues: – How well does it measure changes in appearance? – How easy is it to compute? • Subtle point: Error should be measured with respect to original mesh, which can pose problems – Can it handle color and other non-geometric attributes? 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Measuring Error With Planes • An edge contraction moves two vertices to a single

Measuring Error With Planes • An edge contraction moves two vertices to a single new location • Measure how far this location is from the planes of the original faces • 2 D examples (planes are lines): Low error High error 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Which Planes? • Each vertex has a (conceptual) set of planes – Error sum

Which Planes? • Each vertex has a (conceptual) set of planes – Error sum of squared distances to planes in set – Each plane given by normal, ni, and distance to origin, di • Initialize with planes of incident faces – Consequently, all initial errors are 0 • When contracting pair, use plane set union – planes(v’) = planes(v 1) planes(v 2) 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

The Quadric Error Metric • Given a plane, we can define a quadric Q

The Quadric Error Metric • Given a plane, we can define a quadric Q measure squared distance to the plane as 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

The Quadric Error Metric • Sum of quadrics represents set of planes • Each

The Quadric Error Metric • Sum of quadrics represents set of planes • Each vertex has an associated quadric – Error(vi) = Qi (vi) – Sum quadrics when contracting (vi, vj) v’ – Error introduced by contraction is Q(v’) 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Where Does v’ Belong? • Choose the location for v’ that will minimize the

Where Does v’ Belong? • Choose the location for v’ that will minimize the error introduced • Alternative is to use fixed placement: – – Select v 1 or v 2 Fixed placement is faster but lower quality But it also gives smaller progressive meshes (more later) Fallback to fixed placement if A is non-invertible • When is A non-invertible (hard!)? 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Visualizing Quadrics in 3 -D • Quadric isosurfaces – Contain all the vertex locations

Visualizing Quadrics in 3 -D • Quadric isosurfaces – Contain all the vertex locations that are within a given distance of the face planes – Are ellipsoids (maybe degenerate) – Centered around vertices – Characterize shape – Stretch in least-curved directions 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Sample Model: Dental Mold 50 sec 424, 376 faces 10/14/03 60, 000 faces CS

Sample Model: Dental Mold 50 sec 424, 376 faces 10/14/03 60, 000 faces CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Sample Model: Dental Mold 55 sec 424, 376 faces 10/14/03 8000 faces CS 679

Sample Model: Dental Mold 55 sec 424, 376 faces 10/14/03 8000 faces CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Sample Model: Dental Mold 56 sec 424, 376 faces 10/14/03 1000 faces CS 679

Sample Model: Dental Mold 56 sec 424, 376 faces 10/14/03 1000 faces CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Must Also Consider Attributes Mesh for solution 10/14/03 Radiosity solution CS 679 - Fall

Must Also Consider Attributes Mesh for solution 10/14/03 Radiosity solution CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Must Also Consider Attributes • Add extra terms to plane equations for color information

Must Also Consider Attributes • Add extra terms to plane equations for color information (or texture coords) • Makes matrices and vectors bigger, but doesn’t change overall approach 50, 761 faces 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin 10, 000 faces

Limitations of Static Models • The LOD schemes we have discussed assume a fixed

Limitations of Static Models • The LOD schemes we have discussed assume a fixed set of models • There are reasons to improve upon this: – Objects that are both near and far at the same time, such as terrain, must have varying LOD over a single surface – Static representations waste resolution on back-facing polygons they are view-independent – Different machines have different processing power - hard to adjust LOD switching appropriately • We desire models that adapt to context: – Viewer location, viewer direction, machine load, … 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Progressive Meshes (PMs) • Store more than just final approximations – Sequence of contractions

Progressive Meshes (PMs) • Store more than just final approximations – Sequence of contractions – Implicitly, corresponding intermediate approximations • Re-encode as progressive mesh (PM) [Hoppe] – Start with the final approximation – Reverse of contraction sequence is split sequence • A single vertex is split into two, and triangles are created – Can reconstruct any intermediate model – Allow for progressive transmission & compression 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

PM Details • Modification to contraction operation: – Make a record of which vertices

PM Details • Modification to contraction operation: – Make a record of which vertices were contracted – Record information to reverse the contraction • Original vertex locations, where the edges go, normals, … • Store final approximation and the sequence of contraction records • Implicitly have a many meshes as there were contractions • At run time, perform contractions until target number of triangles, or until error bound is met • Various optimizations to reduce storage cost – For example, always contract to one of the original vertices 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Improving PMs • Progressive meshes fix the order of contractions – Still a fixed

Improving PMs • Progressive meshes fix the order of contractions – Still a fixed sequence of meshes – Based on an error metric that ignored runtime context • We would like to be able to vary the contraction order – If we have a view dependent error metric we will want a different collapse sequence depending on the view • Want less error at silhouettes, more in front facing, don’t care about back facing – For terrain, we want to contract distant edges first - care about how big error appears on screen 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Structure Induced on Surface • Every vertex on approximation corresponds to – A connected

Structure Induced on Surface • Every vertex on approximation corresponds to – A connected set of vertices on the original - all the vertices belonging to edges collapsed to this vertex – Hence a region on the surface: the union of neighborhoods • Initial conditions – every vertex set is a singleton, every region a neighborhood 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Structure Induced on Surface • A contraction merges corresponding vertex sets – remaining vertex

Structure Induced on Surface • A contraction merges corresponding vertex sets – remaining vertex accumulates larger surface region • When merging regions, can link them by mesh edge – as shown on left hand side 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Structure Induced on Surface • Links within single region form spanning tree – links

Structure Induced on Surface • Links within single region form spanning tree – links within all regions form spanning forest – any contraction order within regions is (topologically) valid • Regions always completely partition original surface 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Structure Induced on Surface • Pair-wise merging forms hierarchy – binary tree of vertices

Structure Induced on Surface • Pair-wise merging forms hierarchy – binary tree of vertices – also a binary tree of surface regions 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Example: Initial Vertex Neighborhoods 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of

Example: Initial Vertex Neighborhoods 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Example: 99% of vertices removed Regions of constant color contain vertices that have all

Example: 99% of vertices removed Regions of constant color contain vertices that have all been contracted to a single vertex 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Example: 99. 9% of vertices removed 10/14/03 CS 679 - Fall 2003 - Copyright

Example: 99. 9% of vertices removed 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Vertex Hierarchies • After the entire mesh has been contracted down to a single

Vertex Hierarchies • After the entire mesh has been contracted down to a single point, all the vertices lie in a tree • Generally, stop sooner and get a forest – A set of trees, one per final vertex • We can talk about a cut through the tree – A curve that never crosses a descendent of an edge it’s already crossed 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Cuts and Valid Models • If we contract every edge below a cut, we

Cuts and Valid Models • If we contract every edge below a cut, we get a valid approximation – Vertices just above the cut are said to be active – Different cuts give different approximations • The vertex hierarchy encodes dependencies – Better than PMs, because there is no fixed order to perform the contractions – Each sub-tree can be treated independently, because no collapses in one sub-tree depend on collapses in other sub-trees • But have to be careful of mesh folding over itself 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

View-Dependent Refinement • Use an error metric that depends on the viewing direction •

View-Dependent Refinement • Use an error metric that depends on the viewing direction • Use a cut through the vertex hierarchy as the approximation – incrementally move the cut between frames [Xia-Varshney, Hoppe, Luebke-Erickson] – move up/down where less/more detail needed – relies on frame-to-frame coherence - best approximation probably doesn’t change much from one frame to next – can accommodate geomorphing [Hoppe] • More flexibility than discrete LOD, but more overhead – Have to re-assess approximation at every frame, figuring out where to add detail and where to remove it 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

View Dependent Example 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

View Dependent Example 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

View Dependent Addendum • The entire world can be one vertex tree – Good

View Dependent Addendum • The entire world can be one vertex tree – Good for very large models such as stadiums • Can build strips out of the vertices as the cut is moved – Speeds rendering • Also works for error metrics involving lighting reproduction – Don’t want to simplify near specularities, for instance • Not used in games (to my knowledge) except for terrain – Too slow, and mesh changes on every frame, so hard to utilize vertex arrays and other speed optimizations 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

More On Error Metrics • Always include a geometric component: – – Vertex-Vertex distance

More On Error Metrics • Always include a geometric component: – – Vertex-Vertex distance Vertex-Plane Distance Point-Surface Distance Surface-Surface Distance • May include attribute metrics – Aim to preserve pixel colors – Components for normal vectors, texture coordinates… 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Vertex-Vertex Distance v 3 • E=max(||v 3 -v 1||, ||v 3 -v 2||) •

Vertex-Vertex Distance v 3 • E=max(||v 3 -v 1||, ||v 3 -v 2||) • Works during topological changes v 1 v 2 – Vertex clustering, Vertex pair – Rossignac and Borrel 93, Luebke and Erikson 97 • A loose metric for collapse type operations – Vertices don’t move very far, but surface deviation may be high 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Vertex-Plane Distance a b c • Store a set of planes with each vertex

Vertex-Plane Distance a b c • Store a set of planes with each vertex – Error based on distance from the vertex to the planes – Merge the plane sets when vertices are merged – Tries to keep vertices near original surface • Ronfard and Rossignac 96 – Store planes, use max distance • Error Quadrics – Garland Heckbert 96 – Quadratic form instead of planes, use sum of square distances 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Point-Surface Distance • Measure the distance from a set of points to the simplified

Point-Surface Distance • Measure the distance from a set of points to the simplified surface – Point set representative of original surface – Use sum of squares distances • Hoppe 93 and 96 • Approximation to surface-surface distance • Expensive to compute 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Surface-Surface Distance • Bounds the maximum distance between the input and simplified surfaces –

Surface-Surface Distance • Bounds the maximum distance between the input and simplified surfaces – – Tolerance volumes – Gueziec 96 Simplification Envelopes – Cohen/Varshey 96 Hausdorf Distance – Klein 96 Mapping Distance – Bajaj/Schikore 96, Cohen et. al. 97 • Arguably best measures, but most expensive to compute 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Error Metric Notes • A good metric allows you to transform error in object

Error Metric Notes • A good metric allows you to transform error in object space into error in screen space – Simplifies decision of which model to display • Note that the metrics can be very different – – Consider an edge-swap: E=0 at verts and edges E 0 everywhere else Metrics that look only at vertices or edges will give this a zero error • Run-time metrics may take view into account 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Project Stage 3 • Focus on modeling and efficient rendering • Terrain and terrain

Project Stage 3 • Focus on modeling and efficient rendering • Terrain and terrain LOD or tiling – Quadtrees, octrees, … – Generation of terrain • Visibility – Occlusion culling? – Frustum culling (far clip plane and fog)? • LOD for objects – Probably just use off-the-shelf solution • Other modeling issues … 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin

Todo • By Monday, Oct 20, Stage 3 goals • By Monday, Nov 3,

Todo • By Monday, Oct 20, Stage 3 goals • By Monday, Nov 3, Stage 3 demo 10/14/03 CS 679 - Fall 2003 - Copyright Univ. of Wisconsin