3 D Model Simplification GATE540 Dr aatay NDEER

  • Slides: 72
Download presentation
3 D Model Simplification (GATE-540) Dr. Çağatay ÜNDEĞER Instructor Middle East Technical University, Game.

3 D Model Simplification (GATE-540) Dr. Çağatay ÜNDEĞER Instructor Middle East Technical University, Game. Technologies & General Manager Sim. BT Inc. e-mail : cagatay@undeger. com References: David P. Luebke, A Developer’s Survey of Polygonal Simplification Algorithms Mark Duchaineau et al. ROAMing Terrain: Real-Time Optimally Adapting Meshes GATE-540 Game Technologies Program – Middle East Technical University – Spring 2010 1

Outline • • GATE-540 Introduction to Simplification Algorithm Selection Criteria Kinds of Simplification Algorithms

Outline • • GATE-540 Introduction to Simplification Algorithm Selection Criteria Kinds of Simplification Algorithms Brief Description of Simplification Algorithms 2

Polygonal Models • Currently dominate interactive computer graphics because of – Their mathematical simplicity

Polygonal Models • Currently dominate interactive computer graphics because of – Their mathematical simplicity and – Their simple, regular rendering algorithms that embed well in hardware. GATE-540 3

Difficulties of Polygonal Models • Complexity of polygonal models are measured by the number

Difficulties of Polygonal Models • Complexity of polygonal models are measured by the number of polygons • Complexity of required models seems to grow faster than the ability of our graphics hardware to render them interactively. GATE-540 4

Polygonal Simplification • Offers one solution for developers to deal with these complex models.

Polygonal Simplification • Offers one solution for developers to deal with these complex models. GATE-540 5

Polygonal Simplification • Flight simulators have long used hand-crafted multi-resolution airplane models to guarantee

Polygonal Simplification • Flight simulators have long used hand-crafted multi-resolution airplane models to guarantee a constant frame rate. • In this course, we will deal with automated simplification of these models. GATE-540 6

Determining Appropriate Algorithm • Need to answer several questions: – Why do I need

Determining Appropriate Algorithm • Need to answer several questions: – Why do I need to simplify models? – What do my models seem like? – What is important to me the most? GATE-540 7

Why do I Need to Simplify? • Trying to eliminate redundant geometry? – e.

Why do I Need to Simplify? • Trying to eliminate redundant geometry? – e. g. Volumetric iso-surfaces generated by the marching cubes algorithm tile the model’s flat regions with many small, coplanar triangles? – After subdivision of a model for finiteelement analysis, a simplification algorithm is required to remove unnecessary geometry? GATE-540 8

Why do I Need to Simplify? • Trying to reduce model size? – Geometric

Why do I Need to Simplify? • Trying to reduce model size? – Geometric compression? – Creating a downloadable models for a Web site? – Minimizing storage requirements? GATE-540 9

Why do I Need to Simplify? • Trying to improve runtime performance? – Generating

Why do I Need to Simplify? • Trying to improve runtime performance? – Generating levels of detail (LODs) of the objects in a scene? – Simplifying the polygonal scene being rendered, • By representing distant objects with a lower LOD and nearby objects with a higher LOD? GATE-540 10

What do My Models Seem Like? • No algorithm today exists that simplifying all

What do My Models Seem Like? • No algorithm today exists that simplifying all models sucessully. • Organic forms with smooth curves. • Mechanical objects with sharp corners, flat faces, and regular curves. • Precomputed colors, lighting or texture that must be considered. GATE-540 11

What do My Models Seem Like? • A few large, high-complexity, individual objects (e.

What do My Models Seem Like? • A few large, high-complexity, individual objects (e. g. terrain data, medical data). • Multiple objects of moderate complexity. • Large assemblies of many small objects. GATE-540 12

What is Important to Me? • Preserve accuracy in the simplified models? – Control

What is Important to Me? • Preserve accuracy in the simplified models? – Control the Hausdorff distance of the simplified vertices / surface to the original – Bound the volumetric deviation of the simplified mesh from the original. . . • Just want high visual fidelity? – Perception is more difficult to quantify than geometry • Preserve model’s topological genus? GATE-540 13

What is Important to Me? • If run-time performance is crucial, – You may

What is Important to Me? • If run-time performance is crucial, – You may need an algorithm capable of drastic simplification. • A drastic simplification may require: – View-depended simplification – Topology-reduction simplification GATE-540 14

Kinds of Algorithms • Many approaches, each with strengths and weaknesses. – Treatment of

Kinds of Algorithms • Many approaches, each with strengths and weaknesses. – Treatment of mesh topology – Simplification mechanism – Static, dynamic, view-depended GATE-540 15

Treatment of Mesh Topology • Provides an important distinction • Topology: connected polygonal mesh

Treatment of Mesh Topology • Provides an important distinction • Topology: connected polygonal mesh structure • Genus: number of holes in the mesh surface Genus of zero Genus of one GATE-540 Genus of three 16

Treatment of Mesh Topology • The mesh forms a 2 D manifold – if

Treatment of Mesh Topology • The mesh forms a 2 D manifold – if the neighborhood of every feature consists of a connected ring of polygons forming a single surface. • In a triangulated manifold mesh: – Exactly two triangles share every edge, and – Every triangle shares an edge with exactly three neighboring triangles. (accept borders) GATE-540 17

Treatment of Mesh Topology • Manifold meshes result in well-behaved models. • Any simplification

Treatment of Mesh Topology • Manifold meshes result in well-behaved models. • Any simplification algorithm can successfully operate on any manifold object. • Some algorithms (e. g. marching-cubes) guarantee manifold output. • Some models have cracks, T-junctions, and nonmanifold points or edges. GATE-540 18

Treatment of Mesh Topology • A topology-preserving simplification algorithm: – Preserves manifold connectivity at

Treatment of Mesh Topology • A topology-preserving simplification algorithm: – Preserves manifold connectivity at every step. – Fidelity tends to be relatively good. – Can’t be simplified drastically. – Requires a mesh with manifold topology. • A topology tolerant simplification algorithm: – Ignores regions in the mesh with nonmanifold local topology, – Leaves those regions unsimplified. GATE-540 19

Treatment of Mesh Topology • A topology-modifying algorithm: – Don’t necessarily preserve manifold topology.

Treatment of Mesh Topology • A topology-modifying algorithm: – Don’t necessarily preserve manifold topology. – May close up holes in the model and aggregate separate objects into assemblies – Permitting drastic simplification beyond the scope of topology-preserving schemes. – Often provides poor visual fidelity. – Good at real-time visualization of complex scenes. GATE-540 20

Simplification Mechanism • Four basic polygon removal mechanisms: – Sampling, – Adaptive subdivision, –

Simplification Mechanism • Four basic polygon removal mechanisms: – Sampling, – Adaptive subdivision, – Decimation, and – Vertex merging. GATE-540 21

Sampling • Sample the initial model’s geometry: – With points on the model’s surface

Sampling • Sample the initial model’s geometry: – With points on the model’s surface or – With voxels superimposed on the model in a 3 D grid. • More elaborate and difficult to code approaches. • Trouble achieving high fidelity. • Work best on smooth organic forms with no sharp corners. GATE-540 22

Adaptive Subdivision • Finds a simple base mesh that can be recursively subdivided to

Adaptive Subdivision • Finds a simple base mesh that can be recursively subdivided to closely approximate the initial model. • Requires creating a base model that captures the original model’s important features, which can be tricky. • Preserve the surface topology, which may limit their capacity for drastic simplification. GATE-540 23

Decimation • Iteratively remove vertices or faces from the mesh, re-triangulating the resulting hole

Decimation • Iteratively remove vertices or faces from the mesh, re-triangulating the resulting hole after each step. • Relatively simple to code and can be very fast. • Use strictly local changes that tend to preserve the genus. • This restricts drastic simplification. GATE-540 24

Vertex Merge • Collapses two or more vertices of a triangulated model into a

Vertex Merge • Collapses two or more vertices of a triangulated model into a single vertex, – Which in turn can be merged with other vertices. GATE-540 25

Vertex Merge • A simple and easy-to-code mechanism. • Range from simple, fast, and

Vertex Merge • A simple and easy-to-code mechanism. • Range from simple, fast, and crude to complex, slow, and accurate. GATE-540 26

Static, Dynamic, and View. Dependent Simplification • Traditional static approach: – Polygonal simplification creates

Static, Dynamic, and View. Dependent Simplification • Traditional static approach: – Polygonal simplification creates several discrete versions of each object in a preprocess, each at a different LOD. – Decoupling simplification and rendering makes this the simplest model to code. – Each LOD can be converted during preprocessing to triangle strips and compiled as a separate display list. GATE-540 27

Static, Dynamic, and View. Dependent Simplification • Dynamic approach: – Creates a data structure,

Static, Dynamic, and View. Dependent Simplification • Dynamic approach: – Creates a data structure, which encodes a continuous spectrum of detail. – Desired LOD can be extracted from this structure at run-time. – Advantage: uses no more polygons than necessary. GATE-540 28

Static, Dynamic, and View. Dependent Simplification • View-dependent simplification: – Extends dynamic simplification by

Static, Dynamic, and View. Dependent Simplification • View-dependent simplification: – Extends dynamic simplification by using viewdependent criteria – Selects the most appropriate LOD for the current view. GATE-540 29

Brief Description of Some Simplification Algorithms • • • GATE-540 Triangle Mesh Decimation Vertex

Brief Description of Some Simplification Algorithms • • • GATE-540 Triangle Mesh Decimation Vertex Clustering Multiresolution Analysis of Arbitrary Meshes Voxel-Based Object Simplification Envelopes Appearance-Preserving Simplification Quadric-Error Metrics Image-Driven Simplification Progressive Meshes Real-Time Optimally Adapting Meshes (ROAM) 30

Triangle Mesh Decimation • By Schroeder, Zarge, and Lorenson • Simplify general polygonal models.

Triangle Mesh Decimation • By Schroeder, Zarge, and Lorenson • Simplify general polygonal models. • Term decimation for iterative removal of vertices. • Designed to operate on the output of the marching cubes algorithm. • Coplanar regions divided into many more polygons than necessary. GATE-540 31

Triangle Mesh Decimation • Multiple passes over all the vertices: – If the vertex

Triangle Mesh Decimation • Multiple passes over all the vertices: – If the vertex can be removed without violating the local topology, and – If resulting surface would lie within a user-specified distance of the unsimplified geometry, – Deletes vertex and all its associated triangles. – Hole in the mesh is re-triangulated. GATE-540 32

Triangle Mesh Decimation • Vertices of simplified model are a subset of the original

Triangle Mesh Decimation • Vertices of simplified model are a subset of the original model’s vertices. • Convenient for reusing normals and texture coordinates at the vertices. • Limit the fidelity of the simplifications. • Quite fast and topology tolerant. • Available as part of the Visualization Tool Kit at http: //www. kitware. com/vtk. html GATE-540 33

Vertex Clustering • By Rossignac and Borrel • Topology insensitive, neither requiring nor preserving

Vertex Clustering • By Rossignac and Borrel • Topology insensitive, neither requiring nor preserving valid topology. GATE-540 34

Vertex Clustering • Assigns an importance to each vertex. • More Important: – Vertices

Vertex Clustering • Assigns an importance to each vertex. • More Important: – Vertices attached to large faces and vertices of high curvature • Less Important: – Vertices attached to small faces and vertices of low curvature. GATE-540 35

Vertex Clustering • Overlays a 3 D grid on the model • Collapses all

Vertex Clustering • Overlays a 3 D grid on the model • Collapses all vertices within each cell of the grid to the single most important vertex in cell. GATE-540 36

Vertex Clustering • Grid’s resolution determines quality of simplification. • During the clustering process,

Vertex Clustering • Grid’s resolution determines quality of simplification. • During the clustering process, – Triangles whose corners are collapsed together become degenerate and disappear. GATE-540 37

Vertex Clustering • A unique feature in rendering merged corners. • Renders using the

Vertex Clustering • A unique feature in rendering merged corners. • Renders using the graphics hardware line and point primitives. – a triangle with two corners collapsed is a line – a triangle with three corners collapsed is a point GATE-540 38

Vertex Clustering • A different clustering approach called floatingcell clustering by Low and Tan.

Vertex Clustering • A different clustering approach called floatingcell clustering by Low and Tan. • Ranks vertices by importance. • A cell of user-specified size is centered on the most important vertex. • Collapses all vertices falling within the cell to the representative vertex. • The most important remaining vertex becomes the center of the next cell, • And the process repeats. GATE-540 39

Vertex Clustering • Extremely fast. • Run in O(n) time for n vertices. •

Vertex Clustering • Extremely fast. • Run in O(n) time for n vertices. • Since algorithm: – Don’t preserve topology, and – Don’t guarantee the amount of error introduced by the simplified surface, Often less pleasing visually than those of slower algorithms. GATE-540 40

Multiresolution Analysis of Arbitrary Meshes (MRA) • Adaptive subdivision algorithm by Eck et al.

Multiresolution Analysis of Arbitrary Meshes (MRA) • Adaptive subdivision algorithm by Eck et al. • Uses a compact wavelet representation to guide a recursive subdivision process. • Fast enough to do at runtime • Guarantee that the simplified surface lies within a userspecified distance of the original model. GATE-540 Wavelet series is a squre-integrable function. 41

Multiresolution Analysis of Arbitrary Meshes (MRA) • Provides a method for finding a simple

Multiresolution Analysis of Arbitrary Meshes (MRA) • Provides a method for finding a simple base mesh – That exhibits subdivision connectivity, – So that recursive subdivision will recover the original mesh. GATE-540 42

Multiresolution Analysis of Arbitrary Meshes (MRA) • Base mesh by growing Voronoi-like regions across

Multiresolution Analysis of Arbitrary Meshes (MRA) • Base mesh by growing Voronoi-like regions across the original surface’s triangles. • When these regions can’t grow anymore, – Voronoi sites form a Delaunay-like triangulation, and – The triangulation forms the base mesh. GATE-540 43

Multiresolution Analysis of Arbitrary Meshes (MRA) • Manifold topology is required in the input

Multiresolution Analysis of Arbitrary Meshes (MRA) • Manifold topology is required in the input model. • Strict topology-preserving approach. • Original object’s shape and genus limit the potential for drastic simplification. • Fidelity is quite high for smooth, organic forms. • Has difficulty capturing sharp features. GATE-540 44

Voxel-based Object Simplification • By He et al. • Simplify topology in a gradual

Voxel-based Object Simplification • By He et al. • Simplify topology in a gradual and controlled manner using a signal processing approach. • Sample a volumetric representation of the model • By Superimposing a 3 D grid of voxels over the polygonal geometry. GATE-540 45

Voxel-based Object Simplification • Aassigns each voxel a value of 1 or 0, –

Voxel-based Object Simplification • Aassigns each voxel a value of 1 or 0, – According to whether the sample point of that voxel lies inside or outside the object. • Resamples the volume with a lower resolution – To elliminate small, high-frequency features. • Applies marching cubes. • Uses topology-preserving algorithm as a postprocess to eliminate redundant geometry. GATE-540 46

Voxel-based Object Simplification • High-frequency details such as sharp edges and corners are lost.

Voxel-based Object Simplification • High-frequency details such as sharp edges and corners are lost. – Greatly restricts its usefulness on mechanical CAD models. • Isn’t topology tolerant, – Since deciding whether sample points lie inside or outside the object requires closedmesh objects. GATE-540 47

Simplification Envelopes • By Cohen et al. • Guarantee fidelity bounds – While enforcing

Simplification Envelopes • By Cohen et al. • Guarantee fidelity bounds – While enforcing global and local topology. • Two offset surfaces, no more than some distance ε from the original surface. ε -ε GATE-540 outher original inner 48

Simplification Envelopes • Outher envelope – Displaces each vertex of the original mesh along

Simplification Envelopes • Outher envelope – Displaces each vertex of the original mesh along its normal by ε, • Inner envelope: – Displaces each vertex by −ε. • Aren’t allowed to self-intersect. – If so, algorithm decreases ε in the local neighborhood. GATE-540 49

Simplification Envelopes • Envelopes can guide the simplification process. • Keeping simplified surface within

Simplification Envelopes • Envelopes can guide the simplification process. • Keeping simplified surface within envelopes • Iteratively remove triangles or vertices, and • Retriangulate the resulting holes. GATE-540 50

Simplification Envelopes • Surface never deviates by more than ε from the original model.

Simplification Envelopes • Surface never deviates by more than ε from the original model. • Resulting simplifications tend to have excellent fidelity. • Strict preservation of topology • Not good for drastic simplification. • Requires an orientable manifold. • implementation at http: //www. cs. unc. edu/~geom/envelope. html. GATE-540 51

Appearance-Preserving Simplification • By Cohen, Olano, and Manocha • Takes the error-bounding approach of

Appearance-Preserving Simplification • By Cohen, Olano, and Manocha • Takes the error-bounding approach of simplification envelopes a step further. • Provides the best guarantees on fidelity of any simplification algorithm. GATE-540 52

Appearance-Preserving Simplification • Fidelity is expressed in terms of maximum screenspace deviation. • Rendered

Appearance-Preserving Simplification • Fidelity is expressed in terms of maximum screenspace deviation. • Rendered image deviate from the original’s appearance by no more than a user-specified number of pixels. GATE-540 53

Appearance-Preserving Simplification • Attributes affecting appearance: – Surface position: the coordinates of the vertices.

Appearance-Preserving Simplification • Attributes affecting appearance: – Surface position: the coordinates of the vertices. – Surface color: the color field across the mesh. – Surface curvature: Field of normal vectors across the mesh. GATE-540 54

Appearance-Preserving Simplification • The simplification process uses edge collapses. • Edge collapses that cause

Appearance-Preserving Simplification • The simplification process uses edge collapses. • Edge collapses that cause surface color, normals, or position to shift by more than the maximum user-specified distance ε aren’t allowed. GATE-540 55

Appearance-Preserving Simplification GATE-540 56

Appearance-Preserving Simplification GATE-540 56

Quadric Error Metrics • A vertex-merging algorithm by Garland Heckbert • Perhaps has the

Quadric Error Metrics • A vertex-merging algorithm by Garland Heckbert • Perhaps has the best balance yet between speed, fidelity, and robustness. GATE-540 57

Quadric Error Metrics • Iteratively merging pairs of vertices ( which may not need

Quadric Error Metrics • Iteratively merging pairs of vertices ( which may not need be connected by an edge). • Candidate vertex pairs include: – All vertex pairs connected by an edge, – Plus all vertex pairs separated by less than a user-specified distance threshold t. GATE-540 58

Quadric Error Metrics • All candidate vertex pairs are sorted into a priority queue

Quadric Error Metrics • All candidate vertex pairs are sorted into a priority queue according to the quadric error metric calculated for merging them. • Removes vertex pair with the lowest merge error from the top of the queue and merges it. • Updates the errors of all vertex pairs involving the merged vertices and • Repeats the process. GATE-540 59

Quadric Error Metrics • A simple way to guide the simplification process. • Extremely

Quadric Error Metrics • A simple way to guide the simplification process. • Extremely fast. • Relatively minor storage costs. • Visual fidelity tends to be quite high. • Doesn’t require manifold topology. • Lets holes close and objects merge. • QSlim, available at http: //graphics. uiuc. edu/~garland/software/ qslim. html GATE-540 60

Image-Driven Simplification • By Lindstrom and Turk • First to address simplification directly in

Image-Driven Simplification • By Lindstrom and Turk • First to address simplification directly in terms of how the simplified model will look when rendered. • Occurs through a sequence of edge collapse operations using a priority queue. • Uses a purely image-based metric. GATE-540 61

Image-Driven Simplification • Determines the cost of an edge collapse operation by; – Performing

Image-Driven Simplification • Determines the cost of an edge collapse operation by; – Performing the collapse and – Rendering the model from multiple viewpoints. – Comparing rendered images to images of the original model and – Sums up the mean-square error in luminance across all pixels of all images. GATE-540 62

Image-Driven Simplification • Lindstrom and Turk used 20 viewpoints in their implementation. • Rendering

Image-Driven Simplification • Lindstrom and Turk used 20 viewpoints in their implementation. • Rendering the entire model for every edge and from many viewpoints is clearly an expensive step. • Optimization: – Edge collapse affects only a small region of the screen. – Only a small portion of the triangles need be rendered per image. GATE-540 63

Progressive Meshes • Represents polygonal models as a sequence of edge collapses. • First

Progressive Meshes • Represents polygonal models as a sequence of edge collapses. • First dynamic simplification algorithm for general polygonal manifolds. • Later extended them to support viewdependent simplification. GATE-540 64

Progressive Meshes • Consists of a simple base mesh created by: – A sequence

Progressive Meshes • Consists of a simple base mesh created by: – A sequence of edge collapse operations – A series of vertex split operations. • A vertex split is the dual of an edge collapse. GATE-540 65

Progressive Meshes • Each vertex split: – Replaces a vertex by two edge-connected vertices,

Progressive Meshes • Each vertex split: – Replaces a vertex by two edge-connected vertices, – Creating one additional vertex and two additional triangles. • Correspond to the dual of edge-collapse operations used to create the base mesh. • This will recapture the original model exactly. • Fast enough to perform in real-time. GATE-540 66

Progressive Meshes • Models mesh complexity and fidelity as an energy function to be

Progressive Meshes • Models mesh complexity and fidelity as an energy function to be minimized. • Sorts edges into a priority queue. • Energy function is minimized in a greedy fashion by performing edge collapse operations at the head of the queue. • Sequence of edge collapse operations performed becomes the hierarchy of vertex split operations. GATE-540 67

Progressive Meshes • 3 view-dependent simplification criteria: – A view frustum test – A

Progressive Meshes • 3 view-dependent simplification criteria: – A view frustum test – A backfacing test – A screenspace error threshold GATE-540 68

Progressive Meshes • Manifold topology is required. • Prevents holes from closing and objects

Progressive Meshes • Manifold topology is required. • Prevents holes from closing and objects from aggregating. • Hoppe’s energy-minimization approach – Produces high-fidelity simplifications – But is relatively slow. • Instead, any algorithm based on edge collapses can be used to generate a progressive mesh. GATE-540 69

Real-Time Optimaly Adapting Meshes (ROAM) • By Mark Duchaineau et al. • A view-dependent

Real-Time Optimaly Adapting Meshes (ROAM) • By Mark Duchaineau et al. • A view-dependent simplification algorithm. • Dynamic terrain and simple vertex morphing. GATE-540 70

Real-Time Optimaly Adapting Meshes (ROAM) • Uses: – A bintree. – 2 priority queues

Real-Time Optimaly Adapting Meshes (ROAM) • Uses: – A bintree. – 2 priority queues to drive triangle split and merge. GATE-540 71

Real-Time Optimaly Adapting Meshes (ROAM) • Originally developed for flight simulators. • Provides high

Real-Time Optimaly Adapting Meshes (ROAM) • Originally developed for flight simulators. • Provides high quality triangulations at high frame rates. GATE-540 72