Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping II April 10, 2003.

Similar presentations


Presentation on theme: "CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping II April 10, 2003."— Presentation transcript:

1 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping II April 10, 2003

2 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Today’s Short Film Geri’s Game by Pixar

3 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Announcement Remaining paper presentations on and after April 29: –Please pick a date and select a topic from the reading list before April 17. Project proposal also due on April 17.

4 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Today’s Topics Mip Mapping Projective Texture Shadow Map

5 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

6 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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

7 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

8 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

9 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

10 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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

11 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

12 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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

13 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Shadow Map Similar to projective texture: –But this time, we will project the depth, instead of the slide image. With ShadowsWithout Shadows

14 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 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.

15 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Image Source: Cass Everitt et al., “Hardware Shadow Mapping” NVIDIA SDK White PaperHardware Shadow Mapping Eye’s ViewLight’s ViewDepth/Shadow Map

16 CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Food for Thought Why is texture mapping so powerful, useful, magical, …etc.? (Hint: a lot of hardware design effort)


Download ppt "CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Texture Mapping II April 10, 2003."

Similar presentations


Ads by Google