14-texture
-
Upload
cristina-radu -
Category
Documents
-
view
218 -
download
0
Transcript of 14-texture
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 1/8
1
Greg Humphreys
CS445: Intro Graphics
University of Virginia, Fall 2004
Texture Mapping
Surface
ImageTexture
Textures
• Describe color variation in interior of 3D polygon When scan converting a polygon, vary pixel colors
according to values fetched from a texture
Angel Figure 9.3
“Texels”“Pixels”
3D Rendering Pipeline (for direct illumination)
3D Primitives
ModelingTransformation
ProjectionTransformation
Clipping
Lighting
Image
ViewportTransformation
Scan
Conversion
2D Image Coordinates
3D Modeling Coordinates
3D World Coordinates
3D Camera Coordinates
2D Screen Coordinates
2D Screen Coordinates
ViewingTransformation
3D World Coordinates
2D Image Coordinates
Texture mapping
Surface Textures
• Add visual detail to surfaces of 3D objects
Polygonal model
With surface texture
Surface Textures
• Add visual detail to surfaces of 3D objects
[Daren Horley]
Parameterization
geometrygeometry
++ ==
imageimage texture maptexture map
• Q: How do we decide where on the geometry
each color from the image should go?
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 2/8
2
Option: Varieties of projections
[Paul Bourke][Paul Bourke]
Option: unfold the surface
[Piponi2000]
Option: make an atlas
[Sander2001]
charts atlas surface
Option: it’s the artist’s problem
Overview
• Texture mapping methods Parameterization
Mapping
Filtering
• Texture mapping applications Modulation textures
Illumination mapping Bump mapping
Environment mapping
Image-based rendering
Volume textures
Non-photorealistic rendering
Texture Mapping
• Steps: Define texture
Specify mapping from texture to surface
Lookup texture values during scan conversion
(0,0)
(1,0)
(0,1)
u
v
x
y
ModelingCoordinate
System
ImageCoordinate
System
s
t
TextureCoordinate
System
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 3/8
3
Texture Mapping
• When scan convert, map from … image coordinate system (x,y) to
modeling coordinate system (u,v) to
texture image (t,s)
(0,0)
(1,0)
(1,1)
(0,1)
u
v
x
y
ModelingCoordinate
System
ImageCoordinate
System
s
t
TextureCoordinate
System
Texture Mapping
Allison Klein, Princeton
• Texture mapping is a 2D projective transformation texture coordinate system: (t,s) to
image coordinate system (x,y)
Naïve Texture Mapping
• A first cut at a texture-mapping rasterizer: For each pixel:
» Interpolate u & v down edges and across spans
» Look up nearest texel in texture map
» Color pixel according to texel color (possibly modulated
by lighting calculations)
McMillan’s demo of this is athttp://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide05.html
What artifacts do you see in this demo?
Naïve Texturing Artifacts
• Warping at edges of triangles
• A more obvious example:
http://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide06.html
• Consider the geometry of interpolating parameters
more carefully
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 Mapping
Linear interpolationof texture coordinates
Correct interpolationwith perspective divide
Hill Figure 8.42
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 4/8
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 5/8
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 6/8
6
Texture Mapping Variations
• A texture can modulate any parameter in the Phong
lighting equation
Texture as
R,G,B:
Texture as
diffuse lighting
coefficients:
Bump Mapping
• Texture = change in surface normal!
Sphere w/ di ffuse texture Swirly bump mapSphere w/ diffuse texture
and swirly bump map
+ =
More Bump Mapping
• How can you tell a bumped-mapped object from an
object in which the geometry is explicitly modeled?
Displacement Mapping
Illumination Maps
• Quake introduced illumination maps or light maps to
capture lighting effects in video games
Texture map:
Texture map
+ light map:
Light map
Environment Maps
Images from Illumination and Reflection Maps:Simulated Objects in Simulated and Real Environments
Gene Miller and C. Robert HoffmanSIGGRAPH 1984 “Advanced Computer Graphics Animation” Course Notes
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 7/8
7
Solid textures
Texture values indexed
by 3D location (x,y,z)• Expensive storage, or
• Compute on the fly,
e.g. Perlin noise
Procedural Texture
Procedural Texture Gallery
8/7/2019 14-texture
http://slidepdf.com/reader/full/14-texture 8/8
8