Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow...

15
Page 1 CS348B Lecture 12 Pat Hanrahan, Spring 2005 Texture / Image-Based Rendering Texture maps Surface color and transparency Environment and irradiance maps Reflectance maps Shadow maps Displacement and bump maps Level of detail hierarchy CS348B Lecture 12 Pat Hanrahan, Spring 2005 Texture Maps How is texture mapped to the surface? Dimensionality: 1D, 2D, 3D Texture coordinates (s,t) Surface parameters (u,v) Direction vectors: reflection R, normal N, halfway H Projection: cylinder Developable surface: polyhedral net Reparameterize a surface: old-fashion model decal What does texture control? Surface color and opacity Illumination functions: environment maps, shadow maps Reflection functions: reflectance maps Geometry: bump and displacement maps

Transcript of Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow...

Page 1: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 1

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Texture / Image-Based Rendering

Texture maps

Surface color and transparency

Environment and irradiance maps

Reflectance maps

Shadow maps

Displacement and bump maps

Level of detail hierarchy

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Texture Maps

How is texture mapped to the surface?Dimensionality: 1D, 2D, 3DTexture coordinates (s,t)

Surface parameters (u,v)Direction vectors: reflection R, normal N, halfway HProjection: cylinderDevelopable surface: polyhedral netReparameterize a surface: old-fashion model decal

What does texture control?Surface color and opacityIllumination functions: environment maps, shadow mapsReflection functions: reflectance mapsGeometry: bump and displacement maps

Page 2: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 2

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Classic History

Catmull/Williams 1974 - basic idea

Blinn and Newell 1976 - basic idea, reflection maps

Blinn 1978 - bump mapping

Williams 1978, Reeves et al. 1987 - shadow maps

Smith 1980, Heckbert 1983 - texture mapped polygons

Williams 1983 - mipmaps

Miller and Hoffman 1984 - illumination and reflectance

Perlin 1985, Peachey 1985 - solid textures

Greene 1986 - environment maps/world projections

Akeley 1993 - Reality Engine

Light Field

BTF

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Texture Mapping

++ ==

3D Mesh 2D Texture 2D Image

Page 3: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 3

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Surface Color and Transparency

Source: RenderMan Companion, Pls. 12 & 13

Tom Porter’s Bowling Pin

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Reflection Maps

Blinn and Newell, 1976

Page 4: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 4

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Gazing Ball

Miller and Hoffman, 1984

Photograph of mirror ballMaps all directions to a to circleResolution function of orientationReflection indexed by normal

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Environment Maps

Interface, Chou and Williams (ca. 1985)

Page 5: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 5

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Environment Map Approximation

Ray Traced Environment Map

Self reflections are missing in the environment map

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Cylindrical Panoramas

QuickTime VR

Mars Pathfinder

Memorial Church (Ken Turkowski)

Page 6: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 6

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Fisheye Lens

Pair of 180 degree fisheyePhoto by K. Turkowski

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Cubical Environment Map

Easy to produce with rendering systemPossible to produce from photographs“Uniform” resolution Simple texture coordinates calculation

Page 7: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 7

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Direction Maps

Many ways to map directions to images...Methods:

Lattitude-Longitude (Map Projections) [Newell and Blinn]

Create by paintingGazing Ball (N) [Miller and Hoffman]

Create by photographing a reflective sphereFisheye Lens

Standard camera lensCubical Environment Map (R)

Create with a rendering program, photography...Issues:

Non-linear mapping - expensive, curved linesArea distortion - spatially varying resolutionConvert between maps using image warp

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Shadow Mattes

UberLight( ){Clip to near/far planesClip to shape boundaryforeach superelliptical blocker

atten *= …foreach cookie texture

atten *= …foreach slide texture

color *= …foreach noise texture

atten, color *= …foreach shadow map

atten, color *= …Calculate intensity fall-offCalculate beam distribution

}

Inconsistent Shadows

Projected Shadow Matte

Projected Texture

Page 8: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 8

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Reflectance Maps

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Capturing Reflectance Maps

Photographs of 5 spheres in 3 environments

[Adelson and Dror]

Page 9: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 9

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Creating Lambertian Reflectance Map

Incident Lighting Reflected Light

ˆ ˆ( ) ( )B Eρ=N N

Irradiance Map

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Creating Phong Reflectance Map

σFor each normal direction

For each incoming direction (hemispherical integral)Evaluate reflection equation

Page 10: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 10

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Filtered Environment Maps

From W. Heidrich

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Reflectance Space Shading

Cabral, Olano, Nemic 1999

12 directions

Page 11: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 11

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Illumination Maps

* =

Reflectance Irradiance Radiosity

( )B x( )E x( )xρ

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Quake Light Maps

* Lower resolution

Page 12: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 12

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Bidirectional Texture Function (BTF)

Plaster

CS348B Lecture 12 Pat Hanrahan, Spring 2005

BTF Mapping

Complex interplay between texture and reflection

Page 13: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 13

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Shadow Maps

Shadow maps = depth maps from light source

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Correct Shadow Maps

Step 1: Create z-buffer of scene as seen from light

source

Step 2. Render scene as seen from the eye

For each lightTransform point into light coordinates

return (zl < zbuffer[xl][yl] ) ? 1 : 0

Page 14: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 14

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Ambient Occlusion Maps

From Production ready global illumination, Hayden Landis, ILM

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Displacement/Bump Mapping

Displacement

Perturbed normal( , )

( ) ( )u v

u v

u v

h h

′ ′ ′= ×

= + × + ×

N P P

N T N S N

( , ) ( , ) ( , ) ( , )u v u v h u v u v′ = +P P N

From Blinn 1976

( , )u vP( , )

( , )u v

u vu

∂∂

=P

S( , )

( , )u v

u vv

∂∂

=P

T

( , )u v = ×N S T

Page 15: Texture / Image-Based Rendering - Computer Graphics · Williams 1978, Reeves et al. 1987 - shadow maps Smith 1980, Heckbert 1983 - texture mapped polygons Williams 1983 - mipmaps

Page 15

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Normal Maps

(nx,ny,nz) = (r,g,b)

http://members.shaw.ca/jimht03/normal.html

CS348B Lecture 12 Pat Hanrahan, Spring 2005

Hierarchy

Physics Computer Graphics

Geometrical optics GeometryMacro-structures Displacement (P) mapsTransport Bump (N) mapsMicro-structures ReflectionMicrofacets Texture

Physical opticsKirchoff approx.

Quantum optics