300 likes | 463 Views
Adding Surface Detail. 고려대학교 컴퓨터 그래픽스 연구실. 3 D Rendering Pipeline. 3 D Primitives. 3 D Modeling Coordinates. Model Transformation. 3 D World Coordinates. Lighting. 3 D World Coordinates. Viewing Transformation. 3 D Viewing Coordinates. Projection Transformation. Surface details
E N D
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실
3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D ViewingCoordinates Projection Transformation Surface details can be added... 2D Projection Coordinates Clipping 2D Projection Coordinates Viewport Transformation 2D Device Coordinates Scan Conversion 2D Device Coordinates Image
Overview • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation texture • Bump mapping • Environment mapping
Texture Surface • Add visual detail to surfaces of 3D objects With Surface Texture Polygonal Model
Texture Mapping • 2D projective transformation • Texture coordinate system (s, t) to • Device coordinate system (x, y)
Textures • Color variation in interior of 3D polygon • When scan converting a polygon • Vary pixel colors according to values fetched from a texture y ys t Texture-Surface Transformation Viewing and Projection Transformation x s xs z Image Space Texture Space Object Space
Texture Mapping • Steps: • Define texture • Specify mapping from texture to surface • Lookup texture values during scan conversion (0, 1) (1, 0) t v y s u (0, 0) x Texture Coordinate System Modeling Coordinate System Device Coordinate System
(u1, v1) α β (u2, v2) (u3, v3) Texture Mapping • Scan conversion • Interpolate texture coordinates • Distortion due to the bilinear interpolation • Subdivide the polygon into smaller ones
Texture Mapping Linear Interpolation of Texture Coordinate Corrected Interpolation
Texture Sampling • To determine color at each pixel in image y ys t s x xs z
Texture Filtering • To avoid aliasing problem Corrected Result Point Sampling
Texture Filtering • Ideally, use elliptically shaped convolution filters • In practice, use rectangles Screen Space Texture Space
MipMaps • Keep textures prefiltered at multiple resolutions • For each pixel • Linearly interpolate between two closest levels • Trilinear filtering • Fast and easy for hardware
Overview • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation texture • Bump mapping • Environment mapping
Modulation Texture Texture Shaded Color Texture Value
Bump Mapping • Perturbate surface normals
Environment Mapping • Map texture values to the environment map Surface Pixel Projection onto Environment Map Pixel Area Projection Reference Point
Summary • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation textures • Bump mapping • Environment mapping