Presentation is loading. Please wait.

Presentation is loading. Please wait.

Advanced Texture Mapping May 10, 2007. Today’s Topics Mip Mapping Projective Texture Shadow Map.

Similar presentations


Presentation on theme: "Advanced Texture Mapping May 10, 2007. Today’s Topics Mip Mapping Projective Texture Shadow Map."— Presentation transcript:

1 Advanced Texture Mapping May 10, 2007

2 Today’s Topics Mip Mapping Projective Texture Shadow Map

3 Texture Resolution One size does not fit all: –For example: an NxN texture may be OK for a polygon about the same size on screen, but not for a much smaller or much larger polygon. –Polygon too large  blurry texture –Polygon too small  wasted texture memory.

4 Mip Map For an NxN texture, also build textures of N/2 x N/2, N/4 x N/4, … etc. Total memory required: 4/3 NxN –1+1/4+1/16+… = 4/3

5 Which Level to Use? Naïve answer: pick the closest size. Note that we don’t pick a fixed mip-map level for the whole polygon. We will pick a different level for each drawn pixel. Also, the level does not need to be an integer  In-between levels.

6 Filtering Here, we only consider individual pixels of a scan-converted polygon (on the screen) Texture coords=(u, v); u, v: real number. Bi-linear: Find the closest mip-map level, fetch (  u ,  v  ), (  u ,  v  ), (  u ,  v  ), (  u ,  v  ). Tri-linear: Also interpolated between two mip-map levels.

7 Anisotropic Filtering Bilinear (and tri-linear) filtering assumes that a screen picture is mapped to a circle on the texture, which is actually incorrect. An ellipse (not necessary axis aligned) should be used instead. Next slide: EWA = Ellipse Weighted Average.

8 EWA for Texture Mapping Paul Heckbert, “Survey of Texture Mapping” IEEE CG&A, Nov. 1986. (Figures)Survey of Texture MappingFigures Green & Heckbert, “Creating Raster Omnimax Images from Multiple Perspective Views Using The Elliptical Weighted Average Filter” IEEE CG&A, 6(6), pp. 21-27, June 1986.Creating Raster Omnimax Images from Multiple Perspective Views Using The Elliptical Weighted Average Filter

9 Projective Texture Mark Segal, et al., “Fast shadows and lighting effects using texture mapping”. SIGGRAPH 92Fast shadows and lighting effects using texture mapping Cass Everitt, “Projective Texture Mapping” NVIDIA SDK White Paper.Projective Texture Mapping Figure 1. Two different views of a smiley face texture projected onto the scene.

10 Assigning Texture Coordinates to Vertices The basic idea: 1. Move the camera to the projector location. 2. Overlay the produced photo on top of the texture. (i.e. the pixel location becomes the texture coordinates) “Projective Texture Mapping” by Cass Everitt describes how to use OpenGL texgen to achieve that.Projective Texture Mapping

11 In a Nutshell Tools available for generating texture coordinates: glTexGen() and texture transformation matrix. (See today’s handout.) Use glTexGen() to get: Then set texture matrix to:

12 Shadow Map Similar to projective texture: –But this time, we will project the depth, instead of the slide image. With ShadowsWithout Shadows

13 Basic Steps of Shadow Maps Render the scene from the light’s point of view, Use the light’s depth buffer as a texture (shadow map), Projectively texture the shadow map onto the scene, Use “texture color” (comparison result) in fragment shading.

14 Image Source: Cass Everitt et al., “Hardware Shadow Mapping” NVIDIA SDK White PaperHardware Shadow Mapping Eye’s ViewLight’s ViewDepth/Shadow Map

15 Food for Thought Why is texture mapping so powerful, useful, magical, …etc.? (Hint: a lot of hardware design effort) Why are global illumination effects possible now, even though we still process one primitive at a time?


Download ppt "Advanced Texture Mapping May 10, 2007. Today’s Topics Mip Mapping Projective Texture Shadow Map."

Similar presentations


Ads by Google