250 likes | 371 Views
Texture Mapping. 고려대학교 컴퓨터 그래픽스 연구실. 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. 2 D Projection Coordinates.
E N D
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실 cgvr.korea.ac.kr
3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D ViewingCoordinates Projection Transformation 2D Projection Coordinates Clipping Texture Mapping 2D Projection Coordinates Viewport Transformation 2D Device Coordinates Scan Conversion 2D Device Coordinates Image cgvr.korea.ac.kr
Textures • 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 xs Texture Image Surface z cgvr.korea.ac.kr
Texture Surface • Add Visual Detail to Surfaces of 3D Objects With Surface Texture Polygonal Model cgvr.korea.ac.kr
Overview • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation textures • Illumination mapping • Bump mapping • Environment mapping • Image-based rendering • Non-photorealistic rendering cgvr.korea.ac.kr
Texture Mapping • Steps: • Define texture • Specify mapping from texture to surface • Lookup texture values during scan conversion (0,1) (1,0) s v y u t (0,0) x Texture Coordinate System Modeling Coordinate System Device Coordinate System cgvr.korea.ac.kr
Texture Mapping • When scan converting • Device coordinate system (x,y) • Modeling coordinate system (u,v) • Texture image (t,s) (0,1) (1,0) s v y u t (0,0) x Texture Coordinate System Modeling Coordinate System Device Coordinate System cgvr.korea.ac.kr
Texture Mapping • 2D projective transformation • Texture coordinate system (t,s) to • Device coordinate system (x,y) cgvr.korea.ac.kr
Texture Mapping • 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) cgvr.korea.ac.kr
Texture Mapping Corrected Interpolation with Perspective Divide Linear Interpolation of Texture Coordinate cgvr.korea.ac.kr
Texture Mapping • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation textures • Illumination mapping • Bump mapping • Environment mapping • Image-based rendering • Non-photorealistic rendering cgvr.korea.ac.kr
Texture Filtering • Must sample texture to determine color at each pixel in image y s ys x t xs z cgvr.korea.ac.kr
Texture Filtering • Aliasing is a problem Area Filtering Point Sampling cgvr.korea.ac.kr
Texture Filtering • Ideally, use elliptically shaped convolution filters • In practice, use rectangles Texture Screen cgvr.korea.ac.kr
Texture Filtering • Size of filter depends on projective warp • Prefiltering images • Mip maps • Summed area tables s ys s ys Texel Texel Pixel Pixel t xs t xs Magnification Minification cgvr.korea.ac.kr
MipMaps • Keep textures prefiltered at multiple resolutions • For each pixel, linearly interpolate between two closest levels (e.g., trilinear filtering) • Fast and easy for hardware cgvr.korea.ac.kr
Overview • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation textures • Illumination mapping • Bump mapping • Environment mapping • Image-based rendering • Non-photorealistic rendering cgvr.korea.ac.kr
Modulation Texture • Map Texture Values to Scale Factor Wood Texture Texture Value cgvr.korea.ac.kr
Illumination Mapping • Map Texture Values to Surface Material Parameter • KA • KD • KS • KT • n cgvr.korea.ac.kr
Bump Mapping • Map Texture Values to Perturbations of Surface Normals cgvr.korea.ac.kr
Bump Mapping cgvr.korea.ac.kr
Environmental Mapping • Map Texture Values to the Environment Map Surface Pixel Projection onto Environment Map Pixel Area Projection Reference Point cgvr.korea.ac.kr
Image-Based Rendering • Map Photographic Textures to Provide Details for Coarsely Detailed Polygonal Model cgvr.korea.ac.kr
Nonphotorealistic Rendering cgvr.korea.ac.kr
Summary • Texture mapping methods • Mapping • Filtering • Texture mapping applications • Modulation textures • Illumination mapping • Bump mapping • Environment mapping • Image-based rendering • Non-photorealistic rendering cgvr.korea.ac.kr