1Texture MappingThomas FunkhouserPrinceton UniversityC0S 426, Fall 20003D Rendering Pipeline (for direct illumination)3D PrimitivesModelingTransformationModelingTransformationProjectionTransformationProjectionTransformationClippingClippingLightingLightingImageViewportTransformationViewportTransformationScanConversionScanConversion2D Image Coordinates3D Modeling Coordinates3D World Coordinates3D Camera Coordinates2D Screen Coordinates2D Screen CoordinatesViewingTransformationViewingTransformation3D World Coordinates2D Image CoordinatesTexture mapping2SurfaceImageTextureTextures• Describe color variation in interior of 3D polygonWhen scan converting a polygon, vary pixel colors accordingto values fetched from a textureAngel Figure 9.3Surface Textures• Add visual detail to surfaces of 3D objectsPolygonal modelWith surface texture3Overview• Texture mapping methodsMappingFiltering• Texture mapping applications Modulation texturesIllumination mappingBump mappingEnvironment mappingImage-based renderingNon-photorealistic renderingTexture Mapping• Steps:Define textureSpecify mapping from texture to surfaceLookup texture values during scan conversion(0,0)(1,0)(0,1)uvxyModelingCoordinateSystemImageCoordinateSystemstTextureCoordinateSystem4Texture Mapping• When scan convert, map from …image coordinate system (x,y) tomodeling coordinate system (u,v) totexture image (t,s)(0,0)(1,0)(1,1)(0,1)uvxyModelingCoordinateSystemImageCoordinateSystemstTextureCoordinateSystemTexture MappingChris Buehler & Leonard McMillan, MIT• Texture mapping is a 2D projective transformationtexture coordinate system: (t,s) toimage coordinate system (x,y)5Texture Mapping• Scan conversionInterpolate texture coordinates down/across scan linesDistortion due to bilinear interpolation approximation» Cut polygons into smaller ones, or» Perspective divide at each pixelTexture MappingLinear interpolationof texture coordinatesCorrect interpolationwith perspective divideHill Figure 8.426Overview• Texture mapping methodsMappingFiltering• Texture mapping applicationsModulation texturesIllumination mappingBump mappingEnvironment mappingImage-based renderingNon-photorealistic renderingTexture FilteringAngel Figure 9.4• Must sample texture to determine colorat each pixel in image7Texture FilteringAngel Figure 9.5• Aliasing is a problemPoint samplingArea filteringTexture Filtering• Ideally, use elliptically shaped convolution filtersIn practice, use rectangles8Texture FilteringAngel Figure 9.14• Size of filter depends on projective warpCan prefiltering images» Mip maps» Summed area tablesMagnification MinificationMip Maps• Keep textures prefiltered at multiple resolutionsFor each pixel, linearly interpolate betweentwo closest levels (e.g., trilinear filtering)Fast, easy for hardware9Overview• Texture mapping methodsMappingFiltering• Texture mapping applications Modulation textures!Illumination mapping"Bump mapping#Environment mapping$Image-based rendering%Non-photorealistic renderingModulation textures)))()(((),(SSTTLLLnSDAAEIKIKISRVKLNKIKItsTI ++•+•++=∑• Map texture values to scale factorWood textureTexturevalue10Illumination MappingSSTTLLLnSDAAEIKIKISRVKLNKIKII ++•+•++=∑))()((• Map texture values to surface material parameter&KA'KD(KS)KT*nKT = T(s,t)Bump Mapping• Map texture values to perturbations of surfacenormals11Bump MappingH&B Figure 14.100Environment Mapping• Map texture values to perturbations of surfacenormalsH&B Figure 14.9312Image-Based Rendering• Map photographic textures to provide details forcoarsely detailed polygonal modelNonphotorealistic Rendering13Art-MapsSummary• Texture mapping methods+Mapping,Filtering• Texture mapping applications-Modulation textures.Illumination mapping/Bump mapping0Environment mapping1Image-based rendering2Non-photorealistic
View Full Document