Graphics
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실
cgvr.korea.ac.kr
1
Graphics Lab @ Korea University
3D Rendering Pipeline 3D Primitives
CGVR
3D Modeling Coordinates
Model Model Transformation Transformation 3D World Coordinates Lighting Lighting 3D World Coordinates Viewing Viewing Transformation Transformation 3D Viewing Coordinates Projection Projection Transformation Transformation 2D Projection Coordinates Clipping Clipping 2D Projection Coordinates Viewport Viewport Transformation Transformation
Texture Mapping
2D Device Coordinates Scan Scan Conversion Conversion Image
2D Device Coordinates Graphics Lab @ Korea University
Textures
CGVR
Color variation in interior of 3D polygon
When scan converting a polygon
Vary pixel colors according to values fetched from a texture y
s
ys
x
t
Texture z
Surface
Image
xs
Graphics Lab @ Korea University
Texture Surface ď Ž
CGVR
Add Visual Detail to Surfaces of 3D Objects
With Surface Texture Polygonal Model Graphics Lab @ Korea University
Overview
Texture mapping methods
CGVR
Mapping Filtering
Texture mapping applications
Modulation textures Illumination mapping Bump mapping Environment mapping Image-based rendering Non-photorealistic rendering Graphics Lab @ Korea University
Texture Mapping
CGVR
Steps:
Define texture Specify mapping from texture to surface Lookup texture values during scan conversion (0,1)
s
(1,0)
v t
Texture Coordinate System
(0,0)
u
Modeling Coordinate System
y x
Device Coordinate System Graphics Lab @ Korea University
Texture Mapping
CGVR
When scan converting
Device coordinate system (x,y) Modeling coordinate system (u,v) Texture image (t,s) (0,1)
s
(1,0)
v t
Texture Coordinate System
(0,0)
u
Modeling Coordinate System
y x
Device Coordinate System Graphics Lab @ Korea University
Texture Mapping
CGVR
2D projective transformation
Texture coordinate system (t,s) to Device coordinate system (x,y)
Graphics Lab @ Korea University
Texture Mapping
CGVR
Scan conversion
Interpolate texture coordinates Distortion due to bilinear interpolation approximation
Cut polygons into smaller ones, or Perspectively divide at each pixel
(u1, v1) α γ β
(u2, v2)
(u3, v3) Graphics Lab @ Korea University
Texture Mapping
Linear Interpolation of Texture Coordinate
CGVR
Corrected Interpolation with Perspective Divide Graphics Lab @ Korea University
Texture Mapping
Texture mapping methods
CGVR
Mapping Filtering
Texture mapping applications
Modulation textures Illumination mapping Bump mapping Environment mapping Image-based rendering Non-photorealistic rendering Graphics Lab @ Korea University
Texture Filtering ď Ž
CGVR
Must sample texture to determine color at each pixel in image y
s
ys
x
t
xs z
Graphics Lab @ Korea University
Texture Filtering ď Ž
CGVR
Aliasing is a problem
Point Sampling
Area Filtering
Graphics Lab @ Korea University
Texture Filtering
CGVR
Ideally, use elliptically shaped convolution filters
In practice, use rectangles
Texture
Screen Graphics Lab @ Korea University
Texture Filtering
CGVR
Size of filter depends on projective warp
Prefiltering images
Mip maps Summed area tables
s
ys
s
Texel
ys Texel
Pixel t Magnification
Pixel xs
t
xs
Minification Graphics Lab @ Korea University
Mip Maps
CGVR
Keep textures prefiltered at multiple resolutions
For each pixel, linearly interpolate between two closest levels (e.g., trilinear filtering) Fast and easy for hardware
Graphics Lab @ Korea University
Overview
Texture mapping methods
CGVR
Mapping Filtering
Texture mapping applications
Modulation textures Illumination mapping Bump mapping Environment mapping Image-based rendering Non-photorealistic rendering Graphics Lab @ Korea University
Modulation Texture Map Texture Values to Scale Factor
Texture Value
er ut xe T doo W
CGVR
I = T ( t , s ) ( I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) ) S L I L + K S I R + KT IT ) n
Graphics Lab @ Korea University
Illumination Mapping
CGVR
Map Texture Values to Surface Material Parameter
KA
KD
KS
KT
n
KT = T ( t , s )
I = I E + K A I A + ∑L ( K D ( N ⋅ L ) + K S ( V ⋅ R ) )S L I L + K S I R + KT IT n
Graphics Lab @ Korea University
Bump Mapping ď Ž
CGVR
Map Texture Values to Perturbations of Surface Normals
Graphics Lab @ Korea University
Bump Mapping
CGVR
Graphics Lab @ Korea University
Environmental Mapping ď Ž
CGVR
Map Texture Values to the Environment Map Surface
Pixel Projection onto Environment Map
Pixel Area Projection Reference Point Graphics Lab @ Korea University
Image-Based Rendering ď Ž
CGVR
Map Photographic Textures to Provide Details for Coarsely Detailed Polygonal Model
Graphics Lab @ Korea University
Nonphotorealistic Rendering
CGVR
Graphics Lab @ Korea University
Summary
Texture mapping methods
CGVR
Mapping Filtering
Texture mapping applications
Modulation textures Illumination mapping Bump mapping Environment mapping Image-based rendering Non-photorealistic rendering Graphics Lab @ Korea University