The Modeling-Rendering Paradigm

Modeler: Renderer: EECS 487: Interactive Modeling complex shapes Vertex data

• no equation for a chair, face, etc. Fixed function transform and Vertex • instead, achieve complexity using lighting simple pieces • , parametric surfaces, or Clip, homogeneous divide and viewport Lecture 36: implicit surfaces scene graph Rasterize • Polygonal mesh simplification • with arbitrary precision, in principle Texture stages Fragment shader

Fragment merging: stencil, depth

3D Geometry Representations 2D: Range Image Represent different kinds of information: Image with depth information point data, surface data, volumetric data • acquired from range scanner, incl. Microsoft Kinect and Google Tango Points Solids • not a complete 3D description: does not include • 2D: range image • Constructive Solid Geometry part of object occluded from viewpoint • 3D: point cloud •

Surfaces Procedural • Polygonal mesh • • Parametric surfaces • Spring-mass system Cyberware • Subdivision surfaces • Fractals • Implicit surfaces Curless Range image Tessellation Range surface Funkhouser Funkhouser, Ramamoorthi 3D: Point Cloud Surfaces Unstructured set of 3D Boundary representation (B-reps) point samples • sometimes we only care about the surface, e.g., when Acquired from range finder rendering opaque objects and performing geometric computations Disadvantage: no structural info • adjacency/connectivity have to use e.g., k-nearest neighbors to compute Increasingly hot topic in graphics/vision today 3D surface

Microscribe3D Funkhouser, Ramamoorthi,Ohtake Chenney, Lozano

Solid Modeling Choosing a Representation Some representations are best thought of as Efficiency for different tasks: defining the space filled • creation/acquisition: by hand, procedurally, • medical data with information attached to the space by fitting to measurements • transparent objects with internal structure • interaction/manipulation: simplification, • taking cuts out of an object, compression, local control of shape for “What will I see if I break this object?” modeling, animation, etc. • geometric computation: distance, intersection, vectors, smoothness and continuity, ability to evaluate derivatives, curvature, similarity comparisons, indexing, search • storage and transmission: compactness • 3D volume volume element rendering, e.g., with hardware accelerator: “” convert to

Chenney, Lozano Funkhouser, Chenney Advantages of Representations What do People Use?

Manipulation: meshes most widely used • splines easiest originally, but now Subdivision surfaces used a lot in movies many algorithms for polygon meshes Acquisition and modeling: Spline patches used by modeling programs • splines, CSG originally used for modeling Constructive Solid Geometry (CSG) used for • but increasingly complex meshes, range images, modeling machine parts and point cloud acquired from real world Volume data used in medical imaging Simplicity: meshes Range images used in image-based rendering Efficient hardware rendering: meshes Point clouds becoming increasingly relevant, especially with computer vision

Ramamoorthi Ramamoorthi

Comparison of B-Reps Polygonal Mesh Features Polygonal Implicit Parametric Subdivision Mesh Surface Surface Surface Accurate ✗ ✔ ✔ ✔ Introduction to five topics: Compact ✗ ✔ ✔ ✔ 1. how to draw good looking meshes? Intuitive ✗ ✗ ✔ ✗ 2. mesh simplification Local ✔ ✗ ✔ ✔ 3. level of detail Affine ✔ ✔ ✔ ✔ 4. mesh representation Real objects ✔ ✔ ✗ ✔ 5. error checking and mesh processing Continuity ✗ ✔ ✔ ✔ Parameterization ✗ ✗ ✔ ✗ Rendering ✔ ✗ ✔ ✔ Intersections ✗ ✔ ✗ ✗

Funkhouser Delaunay Dual Meshes and How to create a “good looking” from a set of points? The dual of a mesh exchanges its faces and vertices • place new vertices at centroid of faces • minimum vertices and triangles • fewer, larger triangles Edges in dual cross original edges • no sliver • at right angles A triangulation is Delaunay iff for • at midpoints • (but might not actually “cross” each edge the circumcircle of an if new vertex is at original edge) adjacent triangle does not contain the opposite vertex Dual of a Delaunay Triangulation Among all possible triangulations, the Delaunay is a Voronoi Diagram triangulation maximizes the smallest angle • a Voronoi face denotes a region closer to a given Delaunay (original) vertex than to Rhymes with “baloney” any other Delaunay vertex

[Hart,Bischoff&Kobbelt] Hart,van Laerhoven

Mesh Simplification Mesh Simplification More polygons increases model accuracy, but requires more space and processing/rendering time Reduce polygon count: Desired properties: • need for accuracy depends on the application • less storage • generality in • game vs. medical imaging • faster rendering • efficiency and scalability • approximate solutions vs. final simulations • simpler manipulation • quality of approximation • screen resolution or viewing distance • visual may not call for a very accurate model Simplification algorithms: • geometric: topological modifications • vertex clustering • control of approximation quality • continuous LoD Acquisition systems (e.g., 3D scanner) • mesh retiling • smooth transitions between models often produce huge models • mesh decimation • more detailed than necessary • mesh optimization • millions of polygons per object are common • billions of polygons per object are starting to happen • 300 million faces = 3.7 GB after gzip compression

Yu Funkhouser Vertex Clustering Mesh Retiling Method: Resample mesh with • partition space into cells “uniformly spaced” • grids, spheres, octrees, ... random vertices: • merge all vertices within the same cell • generate random • triangles with multiple vertices in one cell vertices on surface degenerate into lines or points • spread them uniformly Properties: using diffusion/repulsion • general and robust • triangulate vertices • allows topological changes Properties: • not best quality • slow • blurs sharp features

Hart,Funkhouser Funkhouser, Turk

Mesh Decimation Manifold Surface Simplification algorithm: Let M be a surface in 3D • each operation simplifies the model by a small amount M is a manifold iff a neighborhood • apply many operations in an iterative, greedy fashion to gradually reduce complexity of mesh: of any point p in M is topologically 1. measure error introduced by potential decimation operations equivalent to the unit open disk good 2. place operations in a priority queue sorted by error (interior of a unit circle) 3. perform operations in queue successively 4. after each operation, re-evaluate error metrics Topological equivalence (or Types of operations: homeomorphism) allows bad • vertex remove deformation that does not rip, • edge collapse tear, or poke holes • vertex cluster (virtual edge collapse) part of On a manifold surface: manifold First, some topological properties of meshes . . . • every edge is shared by exactly 2 faces surface • around each vertex exists a closed loop of faces TP3,Funkhouser Hart,TP3 Manifolds with Boundary Piecewise Linear Manifolds M’ is a manifold with boundary iff a neighborhood of any point p in M’ is homeomorphic to a half disk Closed mesh No dangling faces On a manifold with a boundary: • edges on the boundary belong to Edges only bound two faces exactly one face non-manifold edge dangling • around vertices on the boundary Watertight face the loop of faces is open • no holes in the surface a manifold surface • no boundary A 3D surface that is a manifold surface with boundary non-manifold • orientable boundary vertex without boundary is a closed surface

TP3 Hart,TP3

Orientable Surface Vertex Remove Method Orientable surface has 2 sides, • remove vertex and adjacent faces like a piece of paper • fill hole with new triangles (2 less triangles) By convention, the normal of a closed orientable surface points “outwards”

The Möbius strip and Klein bottle are non-orientable surfaces:

Properties • requires manifold surface around vertex • preserves local topological structure • filing hole well may not be easy TP3,EscherKarcher,Chu-Carroll, Hart,Funkhouser,Ramamoothi Edge Collapse Virtual Edge Collapse Method A.k.a. vertex-pair contraction or vertex cluster • merge two edge vertices into one • joins previously unconnected areas • delete two degenerate triangles • allows topological simplification • usually limited to small distance vertex split to avoid O(N2) virtual edges

• not best quality

edge collapse

Properties • requires manifold surface around vertex • preserves local topological structure • allows smooth transition

Hart,Funkhouser Hart,Manocha

Iterative Edge Collapse Simplicial Complex Surface Properties • well-defined for any simplicial A surface is simplicial complex iff complex surfaces • polygons meet only along their edges • induces hierarchy on the surface: • edges intersect only at their endpoints allows smooth transition (geomorph) • currently most popular technique (standard feature in )

yes not

TP3 Hart,Funkhouser,Watt00 Error Metrics for Simplification Level of Detail (LoD) Pyramid Single resolution not enough Used to rank edges during simplification • application context dictates required detail • reflects amount of geometric error introduced • context varies over time (and space) • main differentiating feature among algorithms Level of detail: • replace each object in the scene graph with a hierarchy Must address two interrelated problems of objects at differing resolutions • what is the best contraction to perform? • choose the model appropriate for current context: collision detection vs. rendering, frame rate vs. quality • what is the best position v’ for remaining vertex? • can just choose one of the endpoints • but can often do better by optimizing position of v’

See TP3 §6.5 for details J

Hart RTR, Hodgins

Discrete LoD Continuous LoD Given a model, build a set of approximations Need for multi-resolution meshes: • can be produced by any simplification system • to reduce “popping” when switching models, • at run time, simply select which to render geometric morph between two LoDs • fairly efficient • sometimes cannot choose a single LOD, may need different • storage required < 2x original amounts of details on the same surface (see next slide) • cost of changing level of detail while rendering not significant • image pyramids (mip-maps) a good example • progressive transmission (detail increases over time)

Inter-frame switching causes “popping” • can smooth transition with image blending • or geometry blending (requires continuous LoD)

Supported by several scenegraphs: • RenderMan, Open Inventor, IRIS Performer, ...

Hart Funkhouser,Certain et al. Progressive Meshing Progressive Meshing

Iteratively decimate a mesh using edge collapse Rather than a few discrete LODs we have a full range Store the inverse vertex split for each collapse • vertex split does not require much storage The most simplified mesh (base mesh) and • the meshes are flexible and easily reversible vertex split records form the progressive mesh: • requires original positions to be kept with each edge collapse

ecol ecol ecol n-1 i 0 Support for selective refinement M = M n … M 175 … M 1 M 0 • requires more info on adjacent vertices 13,546 3478 500 152 150 and faces of each collapsed edge

Can geomorph smoothly between LODs • minimizes “popping” M n … M i … M 175 … M 1 M 0 = M

vspln-1 vspli-1 vpsl0 Hoppe96,Manocha,Funkhouse Manocha,TP3 r

View-Dependent Simplification Commonly used for terrain generation Polygonal Mesh Terrain close to viewer is shown with a greater LoD Introduction to five topics: Preserve: 1. how to draw good looking meshes? • silhouette cluster • specular highlights 2. mesh simplification 3. level of detail 4. mesh representation 5. error checking and mesh processing

Manocha, Hoppe Polygonal Mesh Representation Polygonal Mesh Representation Extension: more topology information: in addition How would you represent a polygonal mesh? to a list of vertices, each face also • points to its adjacent faces (x , y , z ) (x , y , z ) Three alternatives: 3 3 3 4 4 4 • and for each adjacent face, the index of the shared edge 1. explicit mesh (face list) 2. vertex list Especially convenient for subdivision and multiresolution 3. edge list hierarchies

(x1, y1, z1) (x2, y2, z2) Important properties: • efficient traversal of topology (for drawing, e.g.) • efficient use of memory (compactness) • efficient updates (UI, vertex removal, computing per- vertex normals)

[Zorin, Bischoff&Kobbelt]

Polygonal Mesh Representation Polygonal Mesh Representation

Adjacency operations important in mesh Explicit mesh or “polygonal soup” model: simplification and many other applications: a list of polygonal faces • given face, find its vertices • given vertex, find faces touching it Example: P = {P1, P2, P3, …, Pn} • given face, find neighboring faces P1= ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3)), • given vertex, find neighboring vertices P2= ((x3, y3, z3), (x2, y2, z2), (x4, y4, z4)) • given edge, find vertices and faces it touches Problems: • shared vertices are duplicated • no topology information (e.g., which vertices and edges are shared), must search the whole list to modify a vertex • round off errors: cracks and failure to match vertices

Ramamoorthi Polygonal Mesh Representation Polygonal Mesh Representation Vertex list or “indexed face set”: Edge list:

Example: V = {(x1, y1, z1), (x2, y2, z2), Example: V = {(x1, y1, z1), (x2, y2, z2), (x , y , z ), (x , y , z )}, (x , y , z ), (x , y , z )}, 3 3 3 4 4 4 Used in 3 3 3 4 4 4 P1 = (v1, v2, v3), P2 = (v3, v2, v4) 3dsmax, E1 = (v1, v2, P1, ø), Characteristics: OBJ E2 = (v2, v3, P1, P2), • shared vertices are stored only once file format E3 = (v3, v1, P1, ø), • but still no topology information: P1 = (E1, E2, E3), P2 = (E2, E4, E5) finding shared edges still requires a search Extension “winged edge”: • each edge points to: Extension: triangle neighbor list: • two endpoint vertices • vertex points to a single neighboring triangle • two faces that share edge • triangle points to its three neighboring triangles • four edges emanating from its endpoints • can enumerate triangles around a vertex • faces, vertices contain pointer to one edge Marschner Marschner

Polygon Mesh Error Checking Polygon Mesh Processing

Polygon mesh can arrive in error Topological fixups: fix holes, cracks, self-intersection due to human errors or scanner limitations

Things to check: • every vertex is an end point to at least two edges • every edge is part of at least one polygon • every polygon is closed • every polygon has at least one shared edge

Other checks: • vertex normal • normal to the plane • plane’s implicit function • convex or not • holes? surface water tight?

Podolak Borodin Funkhouser The Problems with Polygons Not a very compact representation • needs a lot of flat elements to represent smooth or highly detailed surfaces • accuracy: exactness of representation can only be approximated by increasing the number of polygons • if image is enlarged, planar surfaces again become obvious Intersection test? Inside/outside test? Hard to edit • creating polygonal objects is straightforward … though laborious and tedious • how do you edit a polygonal-mesh surface? • don’t want to move individual vertices … • difficult to deform object: a region of low curvature, represented with low polygon count, cannot be deformed into a high curvature region • it is more a machine representation than a convenient user representation