Advanced Computer Graphics

Similar documents
Subdivision Surfaces. Course Syllabus. Course Syllabus. Modeling. Equivalence of Representations. 3D Object Representations

Optimisation. CS7GV3 Real-time Rendering

Physically-Based Modeling and Animation. University of Missouri at Columbia

CGT 581 G Geometric Modeling Surfaces (part I)

Subdivision Surfaces

Subdivision Surfaces

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Level of Details in Computer Rendering

INF3320 Computer Graphics and Discrete Geometry

Curves and Surfaces 2

Lecture 3 Mesh. Dr. Shuang LIANG. School of Software Engineering Tongji University Spring 2013

and Recent Extensions Progressive Meshes Progressive Meshes Multiresolution Surface Modeling Multiresolution Surface Modeling Hugues Hoppe

CHAPTER 1 Graphics Systems and Models 3

Multiresolution Meshes. COS 526 Tom Funkhouser, Fall 2016 Slides by Guskov, Praun, Sweldens, etc.

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

3D Modeling techniques

CS-184: Computer Graphics

Subdivision Surfaces

Computergrafik. Matthias Zwicker. Herbst 2010

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Subdivision overview

Subdivision Curves and Surfaces

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

CS 283: Assignment 1 Geometric Modeling and Mesh Simplification

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Computer Graphics Fundamentals. Jon Macey

CS-184: Computer Graphics. Today

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Shape modeling Modeling technique Shape representation! 3D Graphics Modeling Techniques

Free-Form Deformation and Other Deformation Techniques

A Developer s Survey of Polygonal Simplification algorithms. CS 563 Advanced Topics in Computer Graphics Fan Wu Mar. 31, 2005

Rendering Subdivision Surfaces Efficiently on the GPU

Complexity Reduction of Catmull-Clark/Loop Subdivision Surfaces

Mesh Repairing and Simplification. Gianpaolo Palma

CS354 Computer Graphics Surface Representation III. Qixing Huang March 5th 2018

Parametric description

LOD and Occlusion Christian Miller CS Fall 2011

Subdivision. Outline. Key Questions. Subdivision Surfaces. Advanced Computer Graphics (Spring 2013) Video: Geri s Game (outside link)

Subdivision Surfaces. Homework 1: Questions/Comments?

Curve Corner Cutting

Adaptive Tessellation for Trimmed NURBS Surface

Subdivision Curves and Surfaces: An Introduction

EECS 487: Interactive Computer Graphics

Computer Graphics Introduction. Taku Komura

Modeling. Simulating the Everyday World

Subdivision Surfaces. Homework 1: Questions on Homework? Last Time? Today. Tensor Product. What s an illegal edge collapse?

Computer Graphics I Lecture 11

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Real-Time Graphics Architecture

Overview of 3D Object Representations

Geometric Modeling. Bing-Yu Chen National Taiwan University The University of Tokyo

Graphics and Interaction Rendering pipeline & object modelling

Advanced Graphics

Object representation

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

CSE 163: Assignment 2 Geometric Modeling and Mesh Simplification

Subdivision Surfaces. Homework 1: Last Time? Today. Bilinear Patch. Tensor Product. Spline Surfaces / Patches

4: Polygons and pixels

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

Introduction to OpenGL

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Intro to Modeling Modeling in 3D

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Ray Casting of Trimmed NURBS Surfaces on the GPU

CS 465 Program 4: Modeller

CS 563 Advanced Topics in Computer Graphics Polygonal Techniques. by Linna Ma

Information Coding / Computer Graphics, ISY, LiTH. Splines

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

1. Introduction. 2. Parametrization of General CCSSs. 3. One-Piece through Interpolation. 4. One-Piece through Boolean Operations

CS354 Computer Graphics Surface Representation IV. Qixing Huang March 7th 2018

polygon meshes polygon meshes representation

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

11/1/13. Polygon Meshes and Implicit Surfaces. Shape Representations. Polygon Models in OpenGL. Modeling Complex Shapes

2D Spline Curves. CS 4620 Lecture 18

Mesh Representations & Geometry Processing

Mesh Simplification. Mesh Simplification. Mesh Simplification Goals. Mesh Simplification Motivation. Vertex Clustering. Mesh Simplification Overview

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Lecturer Athanasios Nikolaidis

LODESTAR: An Octree-Based Level Of Detail Generator For VRML

3D Modeling Parametric Curves & Surfaces

3D Modeling: Surfaces

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Triangle meshes I. CS 4620 Lecture Kavita Bala (with previous instructor Marschner) Cornell CS4620 Fall 2015 Lecture 2

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

08 - Designing Approximating Curves

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

UNIVERSITY OF CALGARY. Subdivision Surfaces. Advanced Geometric Modeling Faramarz Samavati

G 2 Interpolation for Polar Surfaces

Near-Optimum Adaptive Tessellation of General Catmull-Clark Subdivision Surfaces

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Spline Surfaces, Subdivision Surfaces

Introduction to Computer Graphics

Dgp _ lecture 2. Curves

12.3 Subdivision Surfaces. What is subdivision based representation? Subdivision Surfaces

An Algorithm of 3D Mesh Reconstructing Based on the Rendering Pipeline

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Transcription:

Advanced Computer Graphics Lecture 2: Modeling (1): Polygon Meshes Bernhard Jung TU-BAF, Summer 2007 Overview Computer Graphics Icon: Utah teapot Polygon Meshes Subdivision Polygon Mesh Optimization high-level: Level-of-detail, Progressive meshes low-level: Polygon strips & fans Further reading A. Watt. 3D Computer Graphics. 3rd edition Addison-Wesley. 2000. Chapter 2. T. Akenine-Möller & E. Haines. Real-Time Rendering. AK Peters. 2002. Chapter 11,12 H. Hoppe. Progressive meshes. Proceedings ACM SIGGRAPH 1996, 99-108. 1

Surfaces Polygon Meshes Classical and ubiquitous in CG Creating polygonal objects is straightforward Visually efficient algorithms exist to produce shaded images. A machine representation, converted from other user representations such as parametric/implicit surfaces, CSG/volume Difficulties of polygonal mesh geometric accuracy shape manipulation Surfaces Polygon Meshes 2

Surfaces - Polygon Meshes Polygons A polygon is a many-sided planar figure composed of vertices and edges. Vertices are represented by points (x,y). Edges are represented as line segments which connect two points, (x1,y1) and (x2,y2). P = { (x i, y i ) } i=1,n (x1,y1) E1 (x2,y2) E3 E2 (x3,y3) Surfaces - Polygon Meshes Convex and Concave Polygons Convex Polygon - For any two points P1, P2 inside the polygon, all points on the line segment which connects P1 and P2 are inside the polygon. All points P = up1 + (1-u)P2, u in [0,1] are inside the polygon provided that P1 and P2 are inside the polygon. Concave Polygon - A polygon which is not convex. 3

Surfaces - Polygon Meshes Simple and non simple Polygons Simple Polygons Polygons whose edges do not cross. Non simple Polygons Polygons whose edges cross. Two different OpenGL implementations may render non simple polygons differently. OpenGL does not check if polygons are simple. Triangle polygon guaranteed to be convex and simple Surfaces Polygon Meshes Mesh Representations Independent Faces Vertex and Face Table Adjacency Lists (Winged Edge) 4

Surfaces - Polygon Meshes Mesh Representation Independent Faces Each face lists vertex coordinates Redundant vertices No topology information Surfaces - Polygon Meshes Mesh Representation Vertex and Face Tables Each face lists vertex references Shared vertices, more compact representation Still no topology information VRML: IndexedFaceSet 5

Surfaces - Polygon Meshes Mesh Representation Adjacency Lists Store all vertex, edge, and face adjacencies Efficient topology traversal Extra storage Advanced Mesh Rep: Winged Edge Stores only some adjacency relationships; can derive others on demand Little extra storage (fixed records) Surfaces Subdivision Properties Accurate Local support Affine invariant Arbitrary topology Guaranteed continuity Efficient display used e.g. in animated movies Pixar: Geri s Game 6

Surfaces Subdivision How do you make a smooth curve? Keep cutting the corners of the polyline until you end up with something that has no corners anymore, i.e., is smooth! Surfaces Subdivision Coarse mesh & subdivision rule Define smooth surface as limit of sequence of refinements 7

Surfaces Subdivision e.g. loop subdivision rule refine each triangle into 4 triangles by splitting each edge and connecting new vertices Surfaces Subdivision Different refinement rules 8

Surfaces Subdivision face split All subdivision schemes have 2 steps: 1. Splitting or refinement step topological rule which introduces new vertices and modifies connectivity 2. Averaging or smoothing step geometric rule which computes the positions for new or all vertices by weighted averages vertex split Surfaces Subdivision Computer Graphics Icon: Ivan Sutherland's Volkswagen, Utah, late 1970ies Quadrilateral subdivision 9

Surfaces Subdivision Subdivision in 3DS Max, tessellate modifier original 1 iteration 2 iterations 4 iterations Surfaces Subdivision loop subdivision example adaptive approximation: surface is subdivided only where topology of the surface requires more detail selection of critical mesh areas (vertices) usually by hand 10

Surfaces Polygonal Models vs Subdivision From 3DS Max Help: You create a subdivision surface by applying a modifier to an object. Two kinds of subdivision surfaces are supported: The HSDS modifier provides hierarchical subdivision surfaces [i.e. at multiple levels of detail] The MeshSmooth modifier provides smoothing. Both these modifiers work best as finishing tools for models. The HSDS modifier implements Hierarchical SubDivision Surfaces. It is intended primarily as a finishing tool rather than as a modeling tool. For best results, perform most of your modeling using low-polygon methods, and then use HSDS to add detail and adaptively refine the model. Surfaces Parametric Surfaces Generalization of parametric curves bi-polynomial, e.g. bi-cubic parametric surfaces piecewise parametric surfaces e.g. Bézier surface, NURBS-surface, C1-continuity requires aligning boundary curves and derivatives (difficult; a reason to prefer subdivision surfaces) 11

Surfaces Summary Polygon meshes games Subdivision surfaces movies Parametric Surfaces CAD/CAM increased accuracy slower rendering Polygon mesh optimization Main disadvantage of polygon meshes: often high polygon count to synthesize an object for a high quality rendition Quote from 1976 It makes no sense to use 500 polygons in describing an object if it covers only 20 raster units on the display For example, when we view the human body from a very large distance, we might need to present only specks for the eyes, or perhaps a block for the head, totally eliminating the eyes from consideration (James H. Clark, 1976) today: objects composed of > 1000000 polygons 12

Polygon mesh optimization Mesh Simplification Reduce polygons to a level that is adequate for the quality required Application: Level of detail approximation [Clark76, Funkhouser93] VRML: LOD node distance from distance from viewer? viewer? close far 10,000 2,000 1,000 500 250 problem: may "pop" Polygon mesh optimization Progressive meshes [Hoppe, 96] Idea: apply sequence of edge collapses v t edge collapse v l v r v l v s v r v s to build hierarchy of meshes: 13,546 500 152 150 M=M ^ n ecol n-1 M 175 M 1 175 ecol ecol i 0 M 0 13

Polygon mesh optimization Progressive meshes [Hoppe, 96] Which edges to select? simple heuristic: edges connecting close polygons with similar orientation or more complex heuristics edge collapse is invertible! inverse operation: vertex split can store required vertex information in coarser mesh lossless v l v t v s edge collapse v r vertex split v l v s v r Applications continuous level of detail progressive transmission selective refinement, e.g. viewer dependent mesh compression Polygon mesh optimization continuous level of detail A multi-resolution model obtained by simplification of the original model (in the top left corner). The number of triangles are respectively 96966, 13334, 3334 and 668. http://gts.sourceforge.net/ Animation of a continuous Level Of Detail model of the horse. The initial number of vertices is 32 and is increased to 10,000. 14

Triangle strips Without strips: 8 triangles * 3 vertices = 24 vertices With strips: use 1 vertex per triangle instead of 3! v 0 v 2 v 4 v 6 v 8 T0 T1 T2 T3 T4 T5 T6 T7 v 1 v 3 What we send to graphics hardware: Startup cost: v 0, v 1 then v 2 (T0), v 3 (T1), v 4 (T2), v 5 (T3), v 6 (T4), v 7 (T5), v 8 (T6), v 9 (T7). 9 vertices 100*9/24= 37.5% or 9/8=1.125 verts/tri v 5 v 7 v 9 Triangle strips 9 vertices instead of 24 100*9/24= 37.5% of data 9/8=1.125 vertices/tri I.e., we can expect the geometry stage to run almost 3 times faster! Definition of triangle strip makes orientation change between neighboring triangles in strip Internally, counterclockwise order is kept consistent by traversing vertices 0-1-2, 1-3-2, 2-3-4, 3-5-4, v 0 v 2 v 4 v 6 v 8 T0 T1 T2 T3 T4 T5 T6 T7 v 1 v 3 v 5 v 7 v 9 15

Triangle strips OpenGL: glbegin(gl_triangle_strip); glend() Swaps in triangle strips Whatcanwedofor this case? (T 3 = v 2 v 4 v 5 ) v 0 v 2 v 5 v 6 T 4 T 3 v 4 T 0 T 1 T 2 Implement a swap! Startup cost: v 0, v 1 then v 2 (T0) v 3 (T1) v 2, v 4 (T2) v 5 (T3), v 6 (T4) Degenerate triangle (0-area): v 2, v 3, v 2 v 1 v 3 16

Swaps (v0, v1, v2, v3, swap, v4, v5, v6) implemented by sending v 0 (v0, v1, v2, v3, v2, v4, v5, v6) cost of degenerate triangle: 1 extra vertex still cheaper than restarting triangle strip T 0 v 1 v 5 v 6 T 3 v 2 v 4 T 1 T 2 v 3 T 4 this example: 8 sent vertices / 5 triangles = 1.6 vertices/triangle restarting triangle strip costs more: 4 vertices (2 triangles) + 5 vertices (3 triangles) Swaps also, hardware determines degenerate triangles efficiently and skips these can use swaps to connect non-connected triangles too the idea is to avoid API call overhead hardware needs caches for this to be efficient v 0 v 2 v 4 v 6 T0 T1 T2 T3 Generates 4 degenerate triangles v 1 v 3 v 5 send these vertices: 0,1,2,3, 3,4, 4,5,6,7 10 vertices (sending as 2 strips: 8 vertices) if 3 and 4 are cached, then 8 vertices v 7 17

How to create triangle strips from a 3D model? manually only doable for small models, and not fun NVIDIA Tri Strip Library http://developer.nvidia.com/object/nvtristrip_library.html or make your own program need to know triangle s adjacencies SGI stripping algorithm 1. Choose a starting triangle 2. Build 3 different triangle strips; one for each edge of the triangle 3. Extend these triangle strips in the opposite direction 4. Choose the longest of these 3 strips 5. Repeat Step 1 until all triangles are included in a strip greedy algorithm; linear time if appropriate data structures are used choice of starting triangle: original algorithm: a triangle with smallest number of neighbors (at least 1) in practice, arbitrary choice produces almost equally good results Triangle fans v 6 v 5 analysis - same as for strips: without fans: 6 triangles * 3 vertices = 18 vertices with fans: use 1 vertex per triangle instead of 3! in practice: harder to find long fans than strips smaller benefit than strips easy to convert arbitrary polygons to triangle fans can convert every triangle fan to a triangle strip (with many swaps) - but not vice versa v 0 v 1 v 2 v 3 v 4 18

Vertex arrays / buffers Idea: most efficient to transform a vertex only once (using strips or fans a vertex will be transformed once for each strip / fan the vertex is contained in) Specifiy each vertex (position, normal, diffuse color, specular color, texture coordinates, etc.) once & send to buffer Then send (e.g., 16 bit) indices to identify vertices in buffer Example: make a buffer of 100 unique vertices A triangle is sent as 3 indices into this buffer: 97, 5, 32 This method mimimizes coyping from main memory to graphics card OpenGL vertex arrays, DirectX vertex bufffers Triangle strips and vertex buffers are (often) fastest way to send triangles today Summary 3D object representation properties Accuracy Accuracy vs. data volume Ease of editing Optimization potential data volume, network transmission, rendering 19