Professional Documents
Culture Documents
Simtexture Mapping - New2016
Simtexture Mapping - New2016
Simtexture Mapping - New2016
CS 010 703 CG
Module-5
What adds visual realism?
Geometry only
Phong shading
Phong shading +
Texture maps
Texture Mapping
Limited ability to generate complex surfaces with geometry.
Images can convey the illusion of geometry.
To model the objects with surface details (brick walls, gravel
roads etc) need surface texture.
A common method of adding surface detail is to map texture
patterns onto object surfaces (Images painted onto polygons to
enhance the visual effect of a scene) and is called texture
mapping or pattern mapping.
They are defined in a rectangular array or as a procedure that
modifies surface intensity values.
Texture Mapping
T V
S U
Texture Mapping
(s,t) to (u,v) mapping can be explicitly set at vertices by
storing texture coordinates with each vertex
computing (s,t) to (u,v) mapping for in-between points:
Watch for aliasing
Watch for many to one mappings
Watch for perspective foreshortening effects and linear
interpolation
Texture Interpolation
The actual texture mapping computations take place
at the scan conversion and pixel rendering stages of
the graphics pipeline
During scan conversion, while looping through the
pixels of a triangle, the txty texture coordinates are
interpolated in a similar way as interpolating the rgb
color and z depth values
As with all other interpolated values, must
precompute the slopes of each coordinate as they
vary across the image pixels in x and y
After interpolating texture coordinates, look up that
pixel in the texture map and use it to color the pixel
Example Texture Map
Example Texture Map
Texture Coordinates
Every polygon has object coordinates and texture
coordinates
Object coordinates describe where polygon
vertices are on the screen
Texture coordinates describe texel coordinates of
each vertex (usually 0 -> 1)
Texture coordinates are interpolated along
vertex-vertex edges
Non-parametric texture
mapping
T(a,b) T[i x , j y ]
(1 x )(1 y )T[i, j] x (1 y )T[i 1, j]
(1 x ) y T[i, j 1] x y T[i 1, j 1]
Solid textures
Q: What kinds of artifacts might you see from using a
marble veneer instead of real marble?
University of Texas at
Austin CS384G -
Bump mapping example
Texture #1 Texture #2
Rendered Image
(diffuse color) (bump map)
University of Texas at
Austin CS384G -
Displacement vs. bump mapping
(cont'd)