Last Time B-splines Project 3 was made available

Slides:



Advertisements
Similar presentations
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advertisements

Lecture Notes #11 Curves and Surfaces II
November 12, 2013Computer Vision Lecture 12: Texture 1Signature Another popular method of representing shape is called the signature. In order to compute.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 7: Quadric Error Metrics Ravi Ramamoorthi
Extended Gaussian Images
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 14: Review / Subdivision Ravi Ramamoorthi Slides courtesy.
Advanced Computer Graphics CSE 190 [Spring 2015], Lecture 10 Ravi Ramamoorthi
© University of Wisconsin, CS559 Spring 2004
B-Spline Blending Functions
On Triangle/Quad Subdivision Scott Schaefer and Joe Warren TOG 22(1) 28 – 36, 2005 Reporter: Chen zhonggui
Subdivision Curves & Surfaces and Fractal Mountains. CS184 – Spring 2011.
Surfaces Chiew-Lan Tai. Surfaces 2 Reading Required Hills Section Hearn & Baker, sections 8.11, 8.13 Recommended Sections 2.1.4, , 3D Computer.
Mesh Simplification Global and Local Methods:
Fractal Mountains, Splines, and Subdivision Surfaces Jordan Smith UC Berkeley CS184.
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
Content Subdivision First some basics (control point polygon, mesh)
Subdivision Primer CS426, 2000 Robert Osada [DeRose 2000]
11/08/00 Dinesh Manocha, COMP258 Subdivision Curves & Surfaces Work of G. de Rham on Corner Cutting in 40’s and 50’s Work of Catmull/Clark and Doo/Sabin.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
CS Subdivision I: The Univariate Setting Peter Schröder.
Introduction to Subdivision Surfaces. Subdivision Curves and Surfaces 4 Subdivision curves –The basic concepts of subdivision. 4 Subdivision surfaces.
Curve Modeling Bézier Curves
11/30/04© University of Wisconsin, CS559 Fall 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
10/21/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Terrain Dynamic LOD.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
Graphics Graphics Korea University cgvr.korea.ac.kr Creating Virtual World I 김 창 헌 Department of Computer Science Korea University
4/15/04© University of Wisconsin, CS559 Spring 2004 Last Time More modeling: –Hierarchical modeling –Instancing and Parametric Instancing –Constructive.
Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces for rendering –We have seen how subdivision may be used.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
GPH 338 Computer Animation Survey
CS418 Computer Graphics John C. Hart
Lee Byung-Gook Dongseo Univ.
1 Subdivision. 2 Subdivision for game Why? Large model require many memory for storage Need to dynamically tessellated during game play Make surface modeling.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Subdivision Surfaces Greg Humphreys University of Virginia CS 445, Fall 2003.
In the name of God Computer Graphics. Shortcomings So Far The representations we have looked at so far have various failings: –Meshes are large, difficult.
11/26/02(C) University of Wisconsin Last Time BSplines.
1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Subdivision surfaces.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Slide 1Lecture Fall ‘00 Surface Modeling Types: Polygon surfaces Curved surfaces Volumes Generating models: Interactive Procedural.
Subdivision Schemes. Center for Graphics and Geometric Computing, Technion What is Subdivision?  Subdivision is a process in which a poly-line/mesh is.
Introduction to Parametric Curve and Surface Modeling.
Tessellation Shaders.

COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
© University of Wisconsin, CS559 Spring 2004
CIS 781 Fractal Terrains.
Week 12 - Thursday CS361.
Constructing Objects in Computer Graphics
Introduction to Parametric Curve and Surface Modeling
Advanced Computer Graphics
Daniil Rodin for CAGD course, 2016
Lecture 33: Shape Modeling Li Zhang Spring 2008
Constructing Objects in Computer Graphics By Andries van Dam©
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
The Variety of Subdivision Schemes
© University of Wisconsin, CS559 Fall 2004
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
(c) University of Wisconsin
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Subdivision Surfaces 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr.
Introduction to Meshes
Presentation transcript:

Last Time B-splines Project 3 was made available Recall a property of B-spline surfaces – the control point grid must be rectangular Project 3 was made available

Today Subdivision schemes Homework 6 available

B-splines as Approximation B-splines were developed as approximation functions Given a set of points – the control points – the B-spline approximates them with a smooth curve or surface Ideally, we would like to be able to provide a polygonal mesh, and then smooth it out with a B-spline surface The 3D equivalent of smoothing a 2D poly-line with a B-spline But we can’t do this in general, because B-spline control meshes must be rectangular Can’t even to simple cases like a sphere

Subdivision Schemes Basic idea: Start with something coarse, and refine it into smaller pieces, smoothing along the way We have seen how subdivision may be used to render parametric curves and Bezier surfaces We will see how it can be used for modeling specific objects, and as a modeling scheme in itself In this lecture: Subdivision for tessellating a sphere, and implementation details Subdivision for fractal surfaces Subdivision for B-spline patches General subdivision surfaces

Tessellating a Sphere Spheres are best parameterized in polar coordinates: Note the singularity at the poles Tessellation: The process of approximating a surface with a polygon mesh One option for tessellating a sphere: Step around and up the sphere in constant steps of  and  Problem: Polygons are of wildly different sizes, and some vertices have very high degree

Subdivision Method Begin with a course approximation to the sphere, that uses only triangles Two good candidates are platonic solids with triangular faces: Octahedron, Isosahedron They have uniformly sized faces and uniform vertex degree Repeat the following process: Insert a new vertex in the middle of each edge Push the vertices out to the surface of the sphere Break each triangular face into 4 triangles using the new vertices Octahedron Isosahedron

The First Stage Each new vertex is degree 6, original vertices are degree 4 Each face gets split into 4:

Sphere Subdivision Advantages All the triangles at any given level are the same size Relies on the initial mesh having equal sized faces, and properties of the sphere The new vertices all have the same degree Mesh is uniform in newly generated areas This is a property we will see later in subdivision surfaces Makes it easier to analyze what happens to the surface The location and degree of existing vertices does not change The only extraordinary points lie on the initial mesh Extraordinary points are those with degree different to the uniform areas

Fractal Surfaces Fractals are objects that show self similarity The word is overloaded – it can also mean other things Landscapes and coastlines are considered fractal in nature Mountains have hills on them that have rocks on them and so on Continents have gulfs that have harbors that have bays and so on Subdivision is the natural way of building fractal surfaces Start with coarse features, Subdivide to finer features Different types of fractals come from different subdivision schemes and different parameters to those schemes

Fractal Terrain (1) Start with a coarse mesh Vertices on this mesh won’t move, so they can be used to set mountain peaks and valleys Also defines the boundary Mesh must not have dangling edges or vertices Every edge and every vertex must be part of a face Also define an “up” direction Then repeatedly: Add new vertices at the midpoint of each edge, and randomly push them up or down Split each face into four, as for the sphere

Fractal Terrain Example A mountainside

Fractal Terrain Details There are options for choosing where to move the new vertices Uniform random offset Normally distributed offset – small motions more likely Procedural rule – eg Perlin noise Scaling the offset of new points according to the subdivision level is essential For the subdivision to converge to a smooth surface, the offset must be reduced for each level Colors are frequently chosen based on “altitude”

Fractal Terrains http://members.aol.com/maksoy/vistfrac/sunset.htm

Terrain, clouds generated using procedural textures and Perlin noise http://www.planetside.co.uk/ -- tool is called Terragen

Terrain, clouds generated using procedural textures and Perlin noise http://www.planetside.co.uk/ -- tool is called Terragen

Fractal Terrain Algorithm The hard part is keeping track of all the indices and other data Same algorithm works for subdividing sphere Split_One_Level(struct Mesh terrain) Copy old vertices for all edges Create and store new vertex Create and store new edges for all faces Create new edges interior to face Create new faces Replace old vertices, edges and faces

Subdivision Operations Split an edge, create a new vertex and two new edges Each edge must be split exactly once Need to know endpoints of edge to create new vertex Split a face, creating new edges and new faces based on the old edges and the old and new vertices Require knowledge of which new edges to use Require knowledge of new vertex locations

Data Structure Issues We must represent a polygon mesh so that the subdivision operations are easy to perform Questions influencing the data structures: What information about faces, edges and vertices must we have, and how do we get at it? Should we store edges explicitly? Should faces know about their edges?

Edge Data (iteration 1) The mesh must store all the edges, because we need to loop over them to split them The edge must store its endpoints, because we need them to split the edge A flag to turn off vertex perturbation is useful for boundary edges struct Edge { int v_start; // Index of start vertex int v_end; // Index of end vertex bool no_perturb; }

Face Data Faces are triangles To split, a face must know its vertices or edges. Which? To split, the face needs to know where the new vertices and new edges are stored They were created when each edge was split Where do we store them so that the face can find them?

Face Data (iteration 1) When an edge is split, it makes sense to store the new vertex and new edges as part of the existing edge Faces can then store their edges, and access the information for splitting from the edges Each edge is stored once, so neighboring faces see the same information Edges may point “forwards” or “backwards” around a face, and we must store this struct Face { int edges[3]; bool forward[3]; }

Face Data When an edge is split, it makes sense to store the new vertex and new edges as part of the existing edge Faces can then store their edges, and access the information for splitting from the edges Each edge is stored once, so neighboring faces see the same information Edges may point “forwards” or “backwards” around a face, and we must store this struct Face { int edges[3]; bool forward[3]; float n[3]; }

Edge Data (iteration 2) Need to know endpoints, new vertex when split, and new edges when split Store as indexes into a list struct Edge { int v_start; // Index of start vertex int v_end; // Index of end vertex int v_new; // Index of new vertex int e_start; // Index of one sub-edge int e_end; // Index of other sub-edge bool boundary; }

Rendering To render, we must be able to find the vertices around a face We have these, as part of the edges around the face We also require vertex normals for smooth shading These can be computed by first computing face normals, then averaging to find vertex normals And we might require texture coordinates When an edge is split to create a new vertex, average the endpoint texture coordinates to get the coordinates for the new vertex

Computing Normals Can be done in two passes through the vertices, and one pass through the face Loop over vertices: Set the vertex normal to the zero vector and set a counter to zero Loop over faces: Compute the face normal, and add it to each vertex normal around the face, and increment the counter at each vertex Face normal comes from taking cross product of two edge directions and normalizing Loop over vertices: Divide the normal by the counter, and normalize

Vertex Data struct Vertex { float x[3]; float tex[2]; float norm[3]; int num_faces; }

Mesh Data Structure Mesh stores: Vertices, edges and faces The up direction for offsetting vertices struct Mesh { int num_vertices; struct Vertex *vertices; int num_edges; struct Edge *edges; int num_faces; struct Face *faces; float up[3]; }

General Subdivision Schemes Subdivision schemes can also be used where there is no “target” surface They aim to replace a polygonal mesh with a smooth surface that approximates the coarse mesh There are many schemes: Butterfly scheme (for triangular meshes) Catmull-Clark subdivision (for mostly rectangular meshes, converges to B-splines in uniform regions) Loop’s scheme (for triangular meshes) Modified butterfly scheme (for triangular meshes) Many more…

Butterfly Scheme Subdivides the same way we have been discussing Each edge is split Each face is split into four Rules are defined for computing the splitting vertex of each edge Basic rule for a uniform region Splitting an edge with endpoints that have degree 6 As before, all new interior vertices will have degree 6 Take a weighted sum of the neighboring vertices Weights define rules http://www.gamasutra.com/features/20000411/sharp_01.htm

Butterfly Scheme (1) c b c a a d d c b c Multiply each vertex by its weight and sum them up w is a control parameter – determines how closely the shape conforms to the original mesh

Modified Butterfly Scheme The butterfly scheme must be modified to deal with edges with an endpoint of degree  6 In that case, compute new vertex based only the neighbors of the extraordinary vertex If an edge has two extraordinary endpoints, average the results from each endpoint to get the new endpoint The modified butterfly scheme is provably continuous about extraordinary vertices Proof formulates subdivision as a matrix operator and does eigen-analysis of subdivision matrix

Modified Butterfly Scheme v eN-1 eN-3 eN-2

Modified Butterfly Example Notes: The mesh is uniform everywhere except the original vertices It interpolates the original vertices It has smoothed out the underlying mesh