Texture Mapping I


Texture Mapping I

Texture Mapping IWen-Chieh (Steve) LinDepartment of Computer Science &Institute of Multimedia EngineeringI-Chen Lin’CG Slides, Doug James’CG Slides,Shirley, Fundamentals of Computer Graphics, Chap 11Angel, Interactive Computer Graphics, Chap 9

Administration•Grading scheme–3 programming assignments (60%)–Midterm exam (20%)–Final exam (20%)–Class and recitation participation (10%)•Midterm exam on Nov 5?DCP4516 Introduction to Computer Graphics 2

Motivation for Texture Mapping•Phong lighting model coupled with a singlecolor across a broad surface–Produces boring objects–Very limited•Options to make things interesting:–No simple surfaces—use many tiny polygons•Expensive! Too much geometry.–Apply textures across the polygons•Less geometry, and the image looks almost asgood!DCP4516 Introduction to Computer Graphics 3

What is a texture?•The appearance and feel of a surface•An image used to define the characteristicsof a surface: 2D texture•A multidimensional image which is mappedto a multidimensional space: n-D textureDCP4516 Introduction to Computer Graphics 43D texture

3D texture vs. 2D texture•3D texture–Also called solid texture or volumetexture–Defined the color at a 3-D position:T(x,y,z)•2D texture–Also called image texture–Conventional meaning of “texture”in graphicsDCP4516 Introduction to Computer Graphics 5

Texture Mapping•The process that maps a pixel-based imageonto a surface ( Catmull 1975)•The mapping is called texture function•Classification of texture mapping–Dimensionality of texture function–Correspondences between surface and texture–Procedural or loop-upDCP4516 Introduction to Computer Graphics 6

Three Types of MappingTexture Mapping–Uses images to fill inside of polygons•Environment (reflection) mapping–Uses a picture of the environment for texture maps–Allows simulation of highly specular surfaces•Bump mapping–Emulates altering normal vectors during the renderingprocessDCP4516 Introduction to Computer Graphics 7

Texture Mapping ExampleDCP4516 Introduction to Computer Graphics 8

Texture Mapping Examplegeometric modeltexture mappedDCP4516 Introduction to Computer Graphics 9

Environment Mapping ExampleDCP4516 Introduction to Computer Graphics 10

Bump Mapping ExampleDCP4516 Introduction to Computer Graphics 11

Where Does Mapping Take Place?•Mapping techniques are implemented atthe end of the rendering pipelineverticesGeometricProcessingRasterizationDisplaypixelsPixelOperationsDCP4516 Introduction to Computer Graphics 12

2D Texture MappingBasic Concept•“Slap an image on a model.”•How do we map a two-dimensional imageto a surface in three dimensions?•Texture coordinates–2D coordinate (s,t) which maps to a location onthe image (typically s and t are over [0,1])DCP4516 Introduction to Computer Graphics 13

2D Texture Mapping (cont.)•Assign a texture coordinate to each vertex–Coordinates are determined by some function whichmaps a texture location to a vertex on the model inthree dimensions•Once a point on the surface of the model hasbeen mapped to a value in the texture, change itsRGB value (or something else!) accordingly•This is called parametric texture mapping•A single point in the texture is called a texelDCP4516 Introduction to Computer Graphics 14

Is it Simple?•Mapping an image to a surface involves 3or 4 coordinate systems2D image3D surfaceDCP4516 Introduction to Computer Graphics 15

Visual Overviewparametric coordinatestexture coordinatesworld coordinateswindow coordinatesDCP4516 Introduction to Computer Graphics 17

Coordinate Systems•Texture coordinates (s, t)–Used to identify points in the image to be mapped•Parametric coordinates (u, v)–May be used to model curves and surfaces•Object or World Coordinates (x, y, z)–Conceptually, where the mapping takes place•Window Coordinates–Where the final image is really producedDCP4516 Introduction to Computer Graphics 18

Mapping Functions•Basic problem is how to find the maps•Consider mapping from texture coordinates toa point a surface•Appear to need three functions–x = x(s,t)t(x, y, z)–y = y(s,t)–z = z(s,t)s•But we really want to go the other wayDCP4516 Introduction to Computer Graphics 19

Backward Mapping•We really want to go backwards•Make sure the color at each point of thesurface is filled•Need a map of the form–s = s(x, y, z)–t = t(x, y, z)DCP4516 Introduction to Computer Graphics 20

Tough problem!•Mapping onto complicated objects is difficult–Even simple objects can be hard—parameterizationalways distorts the textureDCP4516 Introduction to Computer Graphics 21

More magazines by this user
Similar magazines