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

Similar documents
Curves and Surfaces Computer Graphics I Lecture 9

Curves and Surfaces Computer Graphics I Lecture 10

Information Coding / Computer Graphics, ISY, LiTH. Splines

CHAPTER 1 Graphics Systems and Models 3

Curve and Surface Basics

Bezier Curves, B-Splines, NURBS

Curves. Computer Graphics CSE 167 Lecture 11

Intro to Curves Week 4, Lecture 7

Computergrafik. Matthias Zwicker. Herbst 2010

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

2D Spline Curves. CS 4620 Lecture 13

Intro to Curves Week 1, Lecture 2

Lecture IV Bézier Curves

Design considerations

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

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

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

2D Spline Curves. CS 4620 Lecture 18

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Curves and Surfaces 1

Computer Graphics I Lecture 11

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

B-spline Curves. Smoother than other curve forms

Central issues in modelling

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

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Curved PN Triangles. Alex Vlachos Jörg Peters

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

Curves and Surfaces. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd

INF3320 Computer Graphics and Discrete Geometry

Sung-Eui Yoon ( 윤성의 )

Computer Graphics Curves and Surfaces. Matthias Teschner

Parametric curves. Brian Curless CSE 457 Spring 2016

Direct Rendering of Trimmed NURBS Surfaces

Curves D.A. Forsyth, with slides from John Hart

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

3D Modeling Parametric Curves & Surfaces

Introduction to Computer Graphics

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

3D Modeling: Surfaces

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

TSBK03 Screen-Space Ambient Occlusion

Computer Graphics CS 543 Lecture 1 (Part I) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Introduction to Geometry. Computer Graphics CMU /15-662

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

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

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

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Chapter 4-3D Modeling

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

COMP3421. Global Lighting Part 2: Radiosity

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

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Splines. Connecting the Dots

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

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

Review of Tuesday. ECS 175 Chapter 3: Object Representation

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

Computer Graphics Fundamentals. Jon Macey

ECE 600, Dr. Farag, Summer 09

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

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

08 - Designing Approximating Curves

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

CS-184: Computer Graphics

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

CS 130 Exam I. Fall 2015

CS559 Computer Graphics Fall 2015

Problem Max. Points Total 80

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

Ray Casting of Trimmed NURBS Surfaces on the GPU

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

Pipeline Operations. CS 4620 Lecture 14

Curves and Surface I. Angel Ch.10

Curves and Surfaces 2

Painter s HSR Algorithm

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

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Modeling 3D Objects: Part 2

CS452/552; EE465/505. Clipping & Scan Conversion

Outline. Properties of Piecewise Linear Interpolations. The de Casteljau Algorithm. Recall: Linear Interpolation

Know it. Control points. B Spline surfaces. Implicit surfaces

Representing Curves Part II. Foley & Van Dam, Chapter 11

Intro to Modeling Modeling in 3D

Dgp _ lecture 2. Curves

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

The Free-form Surface Modelling System

Reading. Parametric surfaces. Surfaces of revolution. Mathematical surface representations. Required:

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Transcription:

Computer Graphics CS 54 Lecture 1a Curves, Tesselation/Geometry Shaders & Level of Detail Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI)

So Far Dealt with straight lines and flat surfaces Real world objects include curves Need to develop: Representations of curves Tools to render curves

Curve Representation: Explicit One variable expressed in terms of another Example: z f ( x, y) Works if one x-value for each y value Example: does not work for a sphere z x y Rarely used in CG because of this limitation

Curve Representation: Implicit Represent D curve or D surface as zeros of a formula Example: sphere representation x y z 1 0 May limit classes of functions used Polynomial: function which can be expressed as linear combination of integer powers of x, y, z Degree of algebraic function: highest power in function Example: mx 4 has degree of 4

Curve Representation: Parametric Represent D curve as functions, 1 parameter D surface as functions, parameters Example: parametric sphere ( x( u), y( u)) ( x( u, v), y( u, v), z( u, v)) x(, ) y(, ) z(, ) cos cos cos sin sin

Choosing Representations Different representation suitable for different applications Implicit representations good for: Computing ray intersection with surface Determing if point is inside/outside a surface Parametric representation good for: Dividing surface into small polygonal elements for rendering Subdivide into smaller patches Sometimes possible to convert one representation into another

Continuity Consider parametric curve P ( u) ( x( u), y( u), z( u)) T We would like smoothest curves possible Mathematically express smoothness as continuity (no jumps) Defn: if kth derivatives exist, and are continuous, curve has kth order parametric continuity denoted C k

Continuity 0 th order means curve is continuous 1 st order means curve tangent vectors vary continuously, etc

Interactive Curve Design Mathematical formula unsuitable for designers Prefer to interactively give sequence of points (control points) Write procedure: Input: sequence of points Output: parametric representation of curve

Interactive Curve Design 1 approach: curves pass through control points (interpolate) Example: Lagrangian Interpolating Polynomial Difficulty with this approach: Polynomials always have wiggles For straight lines wiggling is a problem Our approach: approximate control points (Bezier, B-Splines) called De Casteljau s algorithm

De Casteljau Algorithm Consider smooth curve that approximates sequence of control points [p0,p1,.] p( u) up (1 u) p0 1 0 u 1 Blending functions: u and (1 u) are non-negative and sum to one

De Casteljau Algorithm Now consider points line segments, P0 to P1 and P1 to P p 01 ( u) (1 u) p0 up1 p11 ( u) (1 u) p1 up

De Casteljau Algorithm Substituting known values of p ( ) and p ( ) 11 u 01 u p( u) (1 u) p01 up11( u) ( 1u) p0 (u(1 u)) p1 u p b 0( u ) b ( ) 1 u b ( u) Blending functions for degree Bezier curve b 0 ( u) (1 u) b1( u) u(1 u) b u) ( u Note: blending functions, non-negative, sum to 1

De Casteljau Algorithm Extend to 4 control points P0, P1, P, P p ( u) (1 u) p0 (u(1 u) ) p1 (u (1 u)) p u b ( u) b ( u) b ( u 0 1 ) b ( u ) Final result above is Bezier curve of degree

De Casteljau Algorithm p ( u) (1 u) p0 (u(1 u) ) p1 (u (1 u)) p u b ( u) b ( u) b ( u 0 1 ) b ( u ) Blending functions are polynomial functions called Bernstein s polynomials b b b b 0 1 ( u) ( u) ( u) ( u) (1 u) u u u(1 u) (1 u)

De Casteljau Algorithm p ( u) (1 u) p0 (u(1 u) ) p1 (u (1 u)) p u 1 1 Writing coefficient of blending functions gives Pascal s triangle 1 1 1 1 1 1 1 control points 4 control points 1 4 6 4 1 5 control points

De Casteljau Algorithm In general, blending function for k Bezier curve has form k ki i bik ( u) (1 u) u i Example b 0 0 0 0 ( u) (1 u) u (1 u)

De Casteljau Algorithm Can express cubic parametric curve in matrix form 1 0 ],, [1, ) ( p p p p M u u u u p B where 1 1 0 6 0 0 0 0 0 1 M B

Subdividing Bezier Curves OpenGL renders flat objects To render curves, approximate with small linear segments Subdivide surface to polygonal patches Bezier curves useful for elegant, recursive subdivision

Subdividing Bezier Curves Let (P0 P) denote original sequence of control points Recursively interpolate with u = ½ as below Sequences (P00,P01,P0,P0) and (P0,P1,P1,0) define Bezier curves also Bezier Curves can either be straightened or curved recursively in this way

Bezier Surfaces Bezier surfaces: interpolate in two dimensions This called Bilinear interpolation Example: 4 control points, P00, P01, P10, P11, parameters u and v Interpolate between P00 and P01 using u P10 and P11 using u P00 and P10 using v P01 and P11 using v p( u, v) (1 v)((1 u) p00 up01) v((1 u) p10 up11)

Bezier Surfaces Expressing in terms of blending functions p( u, v) b p 01 ( v) b01( u) p00 b01( v) b11b01( u) p01 b11( v) b11( u) 11 Generalizing p( u, v) i0 j0 b i, ( v) bj,( u) p i, j

Problems with Bezier Curves Bezier curves are elegant but too many control points To achieve smoother curve = more control points = higher order polynomial = more calculations Global support problem: All blending functions are non-zero for all values of u All control points contribute to all parts of the curve Means after modelling complex surface (e.g. a ship), if one control point is moves, recalculate everything!

B-spline blending functions, order B-Splines B-splines designed to address Bezier shortcomings B-Spline given by blending control points Local support: Each spline contributes in limited range Only non-zero splines contribute in a given range of u p( u) m i0 B ( u) i p i

NURBS Encompasses both Bezier curves/surfaces and B-splines Non-uniform Rational B-splines (NURBS) Rational function is ratio of two polynomials Some curves can be expressed as rational functions but not as simple polynomials No known exact polynomial for circle Rational parametrization of unit circle on xy-plane: 1 u x( u) 1 u u y( u) 1 u z( u) 0

NURBS We can apply homogeneous coordinates to bring in w Useful property of NURBS: preserved under transformation E.g. Rotate sphere defined as NURBS, still a sphere 1 ) ( 0 ) ( ) ( 1 ) ( u w u u z u u y u u x

Tesselation tesselation Far = Less detailed mesh Near = More detailed mesh Simplification Previously: Pre-generate mesh versions offline Tesselation shader unit new to GPU in DirectX 10 (007) Subdivide faces to yield finer detail, generate new vertices, primitives Mesh simplification/tesselation on GPU = Real time LoD Tesselation: Demo

Tessellation Shaders Can subdivide curves, surfaces on the GPU

Where Does Tesselation Shader Fit? Fixed number of vertices in/out Can change number of vertices

Geometry Shader After Tesselation shader. Can Handle whole primitives Generate new primitives Generate no primitives (cull)

Level of Detail Use simpler versions of objects if they make smaller contributions to the image LOD algorithms have three parts: Generation: Models of different details are generated Selection: Chooses which model should be used depending on criteria Switching: Changing from one model to another Can be used for models, textures, shading and more

Level of Detail

LOD Switching Discrete Geometry LODs LOD is switched suddenly from one frame to the next Blend LODs Two LODs are blended together over time New LOD is faded by increasing alpha value from 0 to 1 More expensive than rendering one LOD Faded LODs are drawn last to avoid distant objects drawing over the faded LOD

LOD Switching (cont.) Alpha LOD Alpha value of object is lowered as distance increases Experience is more continuous Performance is only felt when object disappears Requires sorting of scene based on transparency

LOD Selection Determining which LOD to render and which to blend Range-Based: LOD choice based on distance

Time-Critical LOD Rendering Using LOD to ensure constant frame rates Predictive algorithm Selects the LOD based on which objects are visible Heuristics: Maximize Constraint:

References Hill and Kelley, chapter 11 Angel and Shreiner, Interactive Computer Graphics, 6 th edition, Chapter 10 Shreiner, OpenGL Programming Guide, 8 th edition