CS559: Computer Graphics Lecture 20: Project 2 Review and Texture mapping Li Zhang Spring 2010 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys,

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Advertisements

9.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 9 Adding Realism Through Texture.
Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Computer Graphics Bing-Yu Chen National Taiwan University.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Texture Mapping CPSC /24/03 Abhijeet Ghosh.
HCI 530 – Seminar in Advanced Topics 10/8/2004Damian Schofield1 Texturing Based on 3D Rendering, Humphreys, G., University of Virginia, 2004.
Computer Graphics (Spring 2008) COMS 4160, Lecture 19: Texture Mapping Many slides from Greg Humphreys, UVA and Rosalee.
(conventional Cartesian reference system)
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Adv. Computer Graphics CS6500, Spring 2003.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 18: Shading & Texture Mapping Many slides from Greg.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008.
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
1 Texturing. 2 What is Texturing? 3 Texture Mapping Definition: mapping a function onto a surface; function can be:  1, 2, or 3D  sampled (image) or.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Antialiasing, Texture Mapping.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
1 Adding charts anywhere Assume a cow is a sphere Cindy Grimm and John Hughes, “Parameterizing n-holed tori”, Mathematics of Surfaces X, 2003 Cindy Grimm,
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam October 30, 2003 Shading 1/35 CIS 736 Computer Graphics Lecture 17 of 42 Illumination.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
CS559: Computer Graphics Lecture 23: Project 2 Review Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
CS559: Computer Graphics Lecture 8: Warping, Morphing, 3D Transformation Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Texture Mapping CAP4730: Computational Structures in Computer Graphics.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
CS559: Computer Graphics Lecture 27: Texture Mapping Li Zhang Spring 2008 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee.
Lecture 6 Rasterisation, Antialiasing, Texture Mapping,
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
CS559: Computer Graphics Lecture 21: Subdivision, Bspline, and Texture mapping Li Zhang Spring 2008.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
In the last several lessons, you have described translations using coordinates. You have also developed strategies for determining where an object started.
CPSC 314 TEXTURE MAPPING UGRAD.CS.UBC.CA/~cs314 Glen Berseth (Based of Mikhail Bessmeltsev and Dinesh Pai)
Texturing CMSC 435/ What is Texturing? 2 Texture Mapping Definition: mapping a function onto a surface; function can be: – 1, 2, or 3D – sampled.
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
- Introduction - Graphics Pipeline
CSE 167 [Win 17], Lecture 18: Texture Mapping Ravi Ramamoorthi
CENG 477 Introduction to Computer Graphics
ATEC Procedural Animation
ATCM 3310 Procedural Animation
3D Graphics Rendering PPT By Ricardo Veguilla.
Texture Mapping COMP575/COMP770.
CS451Real-time Rendering Pipeline
So Far We have assumed that we know: The point The surface normal
© University of Wisconsin, CS559 Fall 2004
Lecture 13 Clipping & Scan Conversion
Lecture 21: Texture mapping Li Zhang Spring 2010
Procedural Animation Lecture 6: Mapping
ATCM 6317 Procedural Animation
CS-378: Game Technology Lecture #4: Texture and Other Maps
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics (Fall 2003)
Advanced Computer Graphics: Texture
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Texture Mapping Jung Lee.
Presentation transcript:

CS559: Computer Graphics Lecture 20: Project 2 Review and Texture mapping Li Zhang Spring 2010 Many slides from Ravi Ramamoorthi, Columbia Univ, Greg Humphreys, UVA and Rosalee Wolfe, DePaul tutorial teaching texture mapping visually

Sample Code by Chi Man Liu

Other basic features How to change speed? – Add a slider with a callback to change timePerFrame How to orient a car? How to draw trees? – A triangle + a rectangle – A cone + a cylinder Using gluQuadrics

Piecewise Cubics P1 P4 P3 P2

Piecewise Cubics Task1: draw the whole curve DrawCubic(P4,P1,P2,P3); DrawCubic(P1,P2,P3,P4); DrawCubic(P2,P3,P4,P1); DrawCubic(P3,P4,P1,P2); DrawCubic(Q1,Q2,Q3,Q4) For (t=0; t < 0.1; t+=0.01) { A=computePoint(Q1,Q2,Q3,Q4,t); B=computePoint(Q1,Q2,Q3,Q4,t+0.01); drawLine(A,B); } Task1: draw the whole curve DrawCubic(P4,P1,P2,P3); DrawCubic(P1,P2,P3,P4); DrawCubic(P2,P3,P4,P1); DrawCubic(P3,P4,P1,P2); DrawCubic(Q1,Q2,Q3,Q4) For (t=0; t < 0.1; t+=0.01) { A=computePoint(Q1,Q2,Q3,Q4,t); B=computePoint(Q1,Q2,Q3,Q4,t+0.01); drawLine(A,B); } Task 2: find where the train is at time t: If (0<=t<1) return computePoint(P4,P1,P2,P3,t) If (1<=t<2) return computePoint(P1,P2,P3,P4,t-1); If (2<=t<3) return computePoint(P2,P3,P4,P1,t-2); If (3<=t<4) return computePoint(P3,P4,P1,P2,t-3); Task 2: find where the train is at time t: If (0<=t<1) return computePoint(P4,P1,P2,P3,t) If (1<=t<2) return computePoint(P1,P2,P3,P4,t-1); If (2<=t<3) return computePoint(P2,P3,P4,P1,t-2); If (3<=t<4) return computePoint(P3,P4,P1,P2,t-3); Fine with Hermite, Catmull-Ron, Cardinal How about Bezier?

Arc-Length Parameterization Arbitrary curves? P1 P4 P3 P2

Arc-length parameterization Freeform x y 0 1 t 0 L s Arc-length parameterization

Correct Orientation in 3D Define and interpolate up vector

Implement simple physics Energy conservation

Multiple Cars Each has its own parameter t, assuming arc- length parameterization

Hack Shadow (XL,YL,ZL) (x,y,z)

Train smoke? Balls moving upward and dissipating

Texture Mapping Important topic: nearly all objects textured – Wood grain, faces, bricks and so on – Adds visual detail to scenes Polygonal model With surface texture

Adding Visual Detail Basic idea: use images instead of more polygons to represent fine scale color variation

Parameterization geometry + = image texture map Q: How do we decide where on the geometry each color from the image should go?

Option: Varieties of mappings [Paul Bourke]

Option: unfold the surface [Piponi2000]

Option: make an atlas [Sander2001] chartsatlassurface

Outline Types of mappings Interpolating texture coordinates Broader use of textures

How to map object to texture? To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t) So texture fits “nicely” over object

Implementing texture mapping A texture lives in it own abstract image coordinates paramaterized by (u,v) in the range ([0..1], [0..1]): It can be wrapped around many different surfaces: Note: if the surface moves/deforms, the texture goes with it.

How to map object to texture? To each vertex (x,y,z in object coordinates), must associate 2D texture coordinates (s,t) So texture fits “nicely” over object

Planar mapping Like projections, drop z coord (u,v) = (x/W,y/H) Problems: what happens near silhouettes?

Cylindrical Mapping Cylinder: r, θ, z with (u,v) = (θ/(2π),z) – Note seams when wrapping around (θ = 0 or 2π)

Basic procedure First, map (square) texture to basic map shape Then, map basic map shape to object – Or vice versa: Object to map shape, map shape to square Usually, this is straightforward – Maps from square to cylinder, plane, … – Maps from object to these are simply coordinate transform

Spherical Mapping Convert to spherical coordinates: use latitude/long. – Singularities at north and south poles

Cube Mapping

Piecewise Mapping From Steve Marschner

Slides from Leonard Mcmillan

Outline Types of projections Interpolating texture coordinates Broader use of textures

1 st idea: Gouraud interp. of texcoords Using barycentric Coordinates

1 st idea: Gouraud interp. of texcoords Scan line

Artifacts McMillan’s demo of this is at Another example What artifacts do you see? Why? Hint: problem is in interpolating parameters

Interpolating Parameters The problem turns out to be fundamental to interpolating parameters in screen-space – Uniform steps in screen space  uniform steps in world space Texture image