Presentation is loading. Please wait.

Presentation is loading. Please wait.

(c) University of Wisconsin

Similar presentations


Presentation on theme: "(c) University of Wisconsin"— Presentation transcript:

1 (c) University of Wisconsin
Last Time B-splines Recall a property of B-spline surfaces – the control point grid must be rectangular Clarification: For non-uniform B-splines, there is one control point for every n-d knots, regardless of whether the knot values are equal 0,0,0,1,2,2,2 requires 7 – 3 = 4 control points for a cubic B-spline 12/03/02 (c) University of Wisconsin

2 (c) University of Wisconsin
Today Subdivision schemes Introduction to Global Illumination 12/03/02 (c) University of Wisconsin

3 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 do simple cases like a sphere: You can’t wrap a sphere is a rectangular sheet without singularities 12/03/02 (c) University of Wisconsin

4 (c) University of Wisconsin
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 Subdivision for fractal surfaces Subdivision for B-spline patches General subdivision surfaces 12/03/02 (c) University of Wisconsin

5 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

6 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

7 (c) University of Wisconsin
The First Stage Each new vertex is degree 6, original vertices are degree 4 Each face gets split into 4: 12/03/02 (c) University of Wisconsin

8 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 12/03/02 (c) University of Wisconsin

9 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

10 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

11 Fractal Terrain Example
A mountainside 12/03/02 (c) University of Wisconsin

12 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” 12/03/02 (c) University of Wisconsin

13 (c) University of Wisconsin
Fractal Terrains 12/03/02 (c) University of Wisconsin

14 (c) University of Wisconsin
Terrain, clouds generated using procedural textures and Perlin noise tool is called Terragen 12/03/02 (c) University of Wisconsin

15 (c) University of Wisconsin
Terrain, clouds generated using procedural textures and Perlin noise tool is called Terragen 12/03/02 (c) University of Wisconsin

16 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 12/03/02 (c) University of Wisconsin

17 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 12/03/02 (c) University of Wisconsin

18 (c) University of Wisconsin
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? 12/03/02 (c) University of Wisconsin

19 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… 12/03/02 (c) University of Wisconsin

20 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

21 (c) University of Wisconsin
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 12/03/02 (c) University of Wisconsin

22 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 12/03/02 (c) University of Wisconsin

23 Modified Butterfly Scheme
v eN-1 eN-3 eN-2 12/03/02 (c) University of Wisconsin

24 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 12/03/02 (c) University of Wisconsin

25 (c) University of Wisconsin
Shading Revisited Some applications are intended to produce pictures that look photorealistic, or close to it The image should look like a photograph A better metric is perceptual: the image should generate a target set of perceptions Applications include: Film special effects, Training simulations, Computer games, Architectural visualizations, Psychology experiments, … To achieve the goal of photorealism, we must think carefully about light and how it interacts with surfaces What you should take away: The various aspects of light interaction and how algorithms capture or ignore them 12/03/02 (c) University of Wisconsin

26 (c) University of Wisconsin
Light Transport Light transport problems are concerned with how much light arrives at any surface, and from what direction The physical quantity of interest is radiance: How much light (power) is traveling along a line in space per unit foreshortened area per unit solid angle We will not go into the theory - it takes 3 hours just to give the definitions and equations CS779 will cover this material in detail Similar problems arise in radiated heat transport (i.e. satellites), where some of the technology was originally developed 12/03/02 (c) University of Wisconsin

27 (c) University of Wisconsin
Light Transport Which surface gets more light? Why? How much light reaches point “a”? If the walls are black? If the walls are mirrors? a a b 12/03/02 (c) University of Wisconsin

28 (c) University of Wisconsin
Reflectance Modeling Reflectance modeling is concerned with the way in which light reflects off surfaces Clearly important to deciding what surfaces look like Also important in solving the light transport problem Physical quantity is BRDF: Bidirectional Reflectance Distribution Function A function of a point on the surface, an incoming light direction, and an outgoing light direction Tells you how much of the light that comes in from one direction goes out in another direction General BRDFs are difficult to work with, so simplifications are made 12/03/02 (c) University of Wisconsin

29 (c) University of Wisconsin
Simple BRDFs Diffuse surfaces: Uniformly reflect all the light they receive Sum up all the light that is arriving: Irradiance Send it back out in all directions A reasonable approximation for matte paints, soot, carpet Perfectly specular surfaces: Reflect incoming light only in the mirror direction Rough specular surfaces: Reflect incoming light around the mirror direction Diffuse + Specular: A diffuse component and a specular component 12/03/02 (c) University of Wisconsin

30 (c) University of Wisconsin
Light Sources Sources emit light: exitance Different light sources are defined by how they emit light: How much they emit in each direction from each point on their surface For some algorithms, “point” lights cannot exist For other algorithms, only “point” light can exist 12/03/02 (c) University of Wisconsin

31 Global Illumination Equation
The total light leaving a point is given by the sum of two major terms: Exitance from the point Incoming light from other sources reflected at the point Exitance Sum BRDF Incoming light Light leaving Incoming light reflected at the point 12/03/02 (c) University of Wisconsin

32 Photorealistic Lighting
Photorealistic lighting requires solving the equation! Not possible in the general case with today’s technology Light transport is concerned with the “incoming light” part of the equation Notice the chicken and egg problem To know how much light leaves a point, you need to know how much light reaches it To know how much light reaches a point, you need to know light leaves every other point Reflectance modeling is concerned with the BRDF Hard because BRDFs are high dimensional functions that tend to change as surfaces change over time 12/03/02 (c) University of Wisconsin


Download ppt "(c) University of Wisconsin"

Similar presentations


Ads by Google