Texture Mapping CS 6500 Adv Computer Graphics ChunFa

  • Slides: 18
Download presentation
Texture Mapping CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Texture Mapping CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Today’s Short Film by CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Today’s Short Film by CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Announcement • Remaining paper presentations on and after April 29. – Please pick a

Announcement • Remaining paper presentations on and after April 29. – Please pick a date and select a topic from the reading list. CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Texture Mapping • The simplest form: like wrapping a picture on an object. •

Texture Mapping • The simplest form: like wrapping a picture on an object. • Texture: 2 D image or a simple pattern (like a checkerboard) • Surface: could be any shape CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Examples • Almost trivial: Rectangular surface • A little bit harder: a Coke can

Examples • Almost trivial: Rectangular surface • A little bit harder: a Coke can • Cube? Sphere? Curve surface? CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Texture Coordinates • The mapping between surface points to image pixels is defined by

Texture Coordinates • The mapping between surface points to image pixels is defined by assigning texture coordinates to vertices of a surface. • Many surfaces have a natural “parameter space” CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Procedural Texture • A simple example: checkerboard. • Solid texture. Example: wood carving. •

Procedural Texture • A simple example: checkerboard. • Solid texture. Example: wood carving. • More advacned: Perlin noise. CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Bump Map and Displacement Map • Examples: – Golf ball – Figure 8. 10

Bump Map and Displacement Map • Examples: – Golf ball – Figure 8. 10 of Watt’s book • Bump Map vs. Displacement Map: – Bump Map: only the looks change – Displ. Map: the actual surface points change. CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Environment Map CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Environment Map CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Texture Mapping and Polygon Rasterization • Problems of linearly interpolating texture coordinates in screen

Texture Mapping and Polygon Rasterization • Problems of linearly interpolating texture coordinates in screen space. – Similar problems in the interpolations of colors for Gouraud shading and normals for Phong shading. • Problems in antialiasing – Expanding and shrinking CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Polygon Subdivision CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Polygon Subdivision CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Perspective Correction • Dividing the texture coordinates by w • Linearly interpolating (u/w, v/w,

Perspective Correction • Dividing the texture coordinates by w • Linearly interpolating (u/w, v/w, 1/w) • At each pixel, dividing (interpolated) u/w and v/w by (interpolated) 1/w. • Reference: Heckbert & Moreton “Interpolation for Polygon Texture Mapping and Shading” CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Using Textures in Open. GL Directly from SG 2001 Course 54: CS 6500 Adv.

Using Textures in Open. GL Directly from SG 2001 Course 54: CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003

Projective Texture • Mark Segal, et al. , “Fast shadows and lighting effects using

Projective Texture • Mark Segal, et al. , “Fast shadows and lighting effects using texture mapping”. SIGGRAPH 92 • Cass Everitt, “Projective Texture Mapping” NVIDIA SDK White Paper. Figure 1. Two different views of a smiley face texture projected onto the scene. CS 6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003