RealTime Rendering TEXTURING Lecture 02 Marina Gavrilova Brief
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova
Brief Outline n n n n Basic Concept Texture Wrapping Magnification filter Minification filter Multi-Texturing Dynamic Texture mapping methods
Concept of Texture n n n Texture: Variation of surface diffusion, color, glossiness and other reflective photometry The heart of today’s computer graphics Texture Pixel = Texel Polygon is filled using texel values. Texture coordinate associates a screen pixel with a texel
Texturing a surface
Texture mapping
Texture mapping in computer games Color texture Environment mapping Alpha mapping Bump mapping Multi-texturing
Basic Texturing concept n n n Modify the value used in the lighting equation Basic Texture = per pixel object color Steps: n n Assign UV texture coordinates to vertices of a polygon (i. e. triangle) Interpolate texture UV coordinate for each fill pixel during rasterization of the triangle Lookup texel value from texture using UV coord. Use texel value in lighting equation
Texture Method n n n Texture pipeline used in rendering platforms to use hardware accelerations U, V [0, 1] scaled texel coordinate Texture resolution is a power of 2 (i. e. 256 x 256 texels)
Texture Pipeline n n n Compute object space location Use projector function to find (u, v) Use corresponding functions to find texel Apply value transform function Modify illumination equation value
Texture Rendering
Texture modes n n n When UV value goes beyond the range [0, 1] i. e. uv= (-1, -1) (2, 2) (see below) Allow simple and small textures to render large complex objects Tile Mirror Clamp Border
Three dimensional texture coordinate (u, v, w) n n n 2 D texture wrapping can be difficult for complex object 3 D texture mapping use (u, v, w) coordinate for texture address Result is uniform texture distribution on a surface
Texture magnification n When 1 texel = n pixels (n>1) Visual Pixelation effect prominent Solution: apply magnification filter Bilinear No Filter
Bilinear Filtering n n Four pixel linear Interpolation (2 x 2) Fast but low quality
Bicubic n n Not yet used in realtime graphics Up to 4 x 4 pixel interpolation Good quality Slow
Minification filter n n When n texel = 1 pixel Aliasing distortion is present Annoying artifact during animation Solution: MIP mapping, min-filters
Min filters n Nearest n MIP n Summed area
MIP Mapping (Base Concept) n n n Have multiple copy of a texture with reduced resolution (factor of 2) I. e. (256 x 256), (128, 128), (64, 64), …(1, 1) Determine LOD from neighboring pixel UV difference (spacing)
Anisotropic Filtering Trilinear MIP-MAPPING Anisotropic Filtering
Texture caching and compression n n Complex scene require large amount of texture Texture Memory is limited Texture management: Load only smaller LODs for distant objects Use Clip-maps: load a small segment of high LOD texture S 3 TC (6: 1) compression Direct. X standard n n n Use two colors for a 4 color ramp Represent 16 pixels using 4 colors 2 bit per pixel, 16 bit per color Average 4 bit per pixel
Multi-pass rendering n n n Rendering the same geometry several times Integrate different photometric components I. e. Quake III has 10 rendering passes
Multi-texturing n n n Combine two or more textures Could be performed in one rendering pass Pixel value is computed using values from different texture stages
Multi-texture & Pixel-shader
Texture Effects Variety of realistic 3 D effects can be created by manipulating textures of a 3 D geometry
Texture Animation n Dynamic animated texture UV=(0. 25, 0. 25) n n Store combined static frames as 1 image Use different UVs to animate frames UV=(0. 5, 0. 5) Frame 5
Transparency Alpha mapping + =
Billboarding n n n Create complex objects using texture and simple geometry Used extensively in particle rendering systems Use faceted quads normal of the quad equals camera direction n Used frequently in games n High performance
Multi Textured Gloss Mapping
Reflection/Environment mapping Blinn & Newells method:
Other environment mapping Cube Mapping
Bump Mapping n n Per-pixel normal Use cubemaps for normal
Bump mapping n n Use cubemap and multitexture pass Or use High level shading Language (HLSL) in nvidia
Other texture teqniques n n n n Detail Textures (i. e. flight simulator) Procedural Texture Anti-aliasing Motion blur Realistic shading Volumetric Texture Image processing using texture passes Exposure control (Dynamic Range)
End of Lecture 02 Questions?
- Slides: 36