DOC PREVIEW
UVA CS 445 - Texture Mapping

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Greg HumphreysCS445: Intro GraphicsUniversity of Virginia, Fall 2003Texture MappingGreg HumphreysUniversity of VirginiaCS 445, Fall 2003SurfaceImageTextureTextures• Describe color variation in interior of 3D polygonD When scan converting a polygon, vary pixel colors according to values fetched from a textureAngel Figure 9.3“Texels”“Pixels”3D Rendering Pipeline (for direct illumination)3D PrimitivesModelingTransformationProjectionTransformationClippingLightingImageViewportTransformationScanConversion2D Image Coordinates3D Modeling Coordinates3D World Coordinates3D Camera Coordinates2D Screen Coordinates2D Screen CoordinatesViewingTransformation3D World Coordinates2D Image CoordinatesTexture mappingSurface Textures• Add visual detail to surfaces of 3D objectsPolygonal modelWith surface texture2Surface Textures• Add visual detail to surfaces of 3D objects[Daren Horley]Parameterizationgeometrygeometry++==imageimagetexture maptexture map• Q: How do we decide where on the geometryeach color from the image should go?Option: Varieties of projections[Paul Bourke][Paul Bourke]Option: unfold the surface[Piponi2000]3Option: make an atlas[Sander2001]charts atlas surfaceOption: it’s the artist’s problemOverview• Texture mapping methodsD ParameterizationD MappingD Filtering• Texture mapping applicationsD Modulation texturesD Illumination mappingD Bump mappingD Environment mappingD Image-based renderingD Volume texturesD Non-photorealistic renderingTexture Mapping• Steps:D Define textureD Specify mapping from texture to surfaceD Lookup texture values during scan conversion(0,0)(1,0)(0,1)uvxyModelingCoordinateSystemImageCoordinateSystemstTextureCoordinateSystem4Texture Mapping• When scan convert, map from …D image coordinate system (x,y) toD modeling coordinate system (u,v) toD texture image (t,s)(0,0)(1,0)(1,1)(0,1)uvxyModelingCoordinateSystemImageCoordinateSystemstTextureCoordinateSystemTexture MappingAllison Klein, Princeton• Texture mapping is a 2D projective transformationD texture coordinate system: (t,s) toD image coordinate system (x,y)Naïve Texture Mapping• A first cut at a texture-mapping rasterizer:D For each pixel:» Interpolate u & v down edges and across spans» Look up nearest texel in texture map» Color pixel according to texel color (possibly modulated by lighting calculations)D McMillan’s demo of this is at http://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide05.htmlD What artifacts do you see in this demo?Naïve Texturing Artifacts• Warping at edges of triangles• A more obvious example:http://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide06.html• Consider the geometry of interpolating parameters more carefully5Interpolating Parameters• The problem turns out to be fundamental to interpolating parameters in screen-spaceD Uniform steps in screen space ≠uniform steps in world spaceTexture MappingLinear interpolationof texture coordinatesCorrect interpolationwith perspective divideHill Figure 8.42Interpolating Parameters• Perspective foreshortening is not getting applied to our interpolated parametersD Parameters should be compressed with distanceD Linearly interpolating them in screen-space doesn’t do this • Is this a problem with Gouraud shading?• A: It can be, but we usually don’t notice (why?)D http://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide17.htmlPerspective-Correct Interpolation• Skipping a bit of math to make a long story short…D Rather than interpolating u and v directly, interpolate u/zand v/z» These do interpolate correctly in screen space» Also need to interpolate z and multiply per-pixelD Problem: we don’t know z anymoreD Solution: we do know w ∝ 1/zD So…interpolate uw and vw and w, and compute u = uw/w and v = vw/w for each pixel» This unfortunately involves a divide per pixel (Just 1?)D http://graphics.lcs.mit.edu/classes/6.837/F98/Lecture21/Slide14.html6Overview• Texture mapping methodsD ParameterizationD MappingD Filtering• Texture mapping applicationsD Modulation texturesD Illumination mappingD Bump mappingD Environment mappingD Image-based renderingD Non-photorealistic renderingTexture FilteringAngel Figure 9.4• Must sample texture to determine color at each pixel in imageTexture Map Aliasing• Naive texture mapping aliases badly • Look familiar?int uval = (int) (u * denom + 0.5f);int vval = (int) (v * denom + 0.5f);int pix = texture.getPixel(uval, vval);• Actually, each pixel maps to a region in textureD |PIX| < |TEX| » Easy: interpolate (bilinear) between texel values D |PIX| > |TEX|» Hard: average the contribution from multiple texelsD |PIX| ~ |TEX|» Still need interpolation!Texture FilteringAngel Figure 9.14• Size of filter depends on projective warpD Can prefilter images » Mip maps» Summed area tablesMagnification Minification7Mip Maps• Keep textures prefiltered at multiple resolutionsD For each pixel, linearly interpolate between two closest levels (e.g., trilinear filtering) D Fast, easy for hardware• Why “Mip” maps?MIP-map Example• No filtering:• MIP-map texturing:AAAAAAAGHMY EYES ARE BURNINGWhere are my glasses?Summed-area tables• At each texel keep sum of all values down & rightD To compute sum of all values within a rectangle,simply subtract two entriesD Better ability to capture very oblique projectionsD But, cannot store values in a single byteS1S2Summed-Area Tables• Mipmaps assume that each pixel projects to a square in the texture (which is a lie)• SAT can integrate texels covered by the pixel more exactly (but still quickly)• Example:MIP-map texturing Summed-area table texturing8Overview• Texture mapping methodsD ParameterizationD MappingD Filtering• Texture mapping applicationsD Modulation texturesD Illumination mappingD Bump mappingD Environment mappingD Image-based renderingD Non-photorealistic renderingModulation textures)))()(((),(SSTTLLLnSDAAEIKIKISRVKLNKIKItsTI ++•+•++=∑Map texture values to scale factorWood textureTexturevalueTexture Mapping Variations• A texture can modulate any parameter in the Phong lighting equationTexture asR,G,B:Texture asdiffuse lightingcoefficients:Bump Mapping• Texture = change in surface normal!Sphere w/ diffuse texture Swirly bump mapSphere w/ diffuse textureand swirly bump map9+=More Bump Mapping• How can you tell a bumped-mapped object from an object in which the geometry is explicitly modeled?Displacement MappingIllumination Maps• Quake introduced


View Full Document

UVA CS 445 - Texture Mapping

Documents in this Course
Lighting

Lighting

49 pages

Color

Color

20 pages

Clipping

Clipping

10 pages

Shadows

Shadows

95 pages

Color

Color

37 pages

Radiosity

Radiosity

49 pages

Clipping

Clipping

59 pages

Assign 3

Assign 3

28 pages

Splines

Splines

17 pages

Color

Color

17 pages

Load more
Download Texture Mapping
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Texture Mapping and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Texture Mapping 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?