Top Banner
Environment Mapping Computer Graphics CSE 167 Lecture 13
24

Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Mar 28, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment Mapping

Computer Graphics

CSE 167

Lecture 13

Page 2: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

CSE 167: Computer graphics

• Environment mapping

– An image-based lighting method

– Approximates the appearance of a surface using a precomputed texture image (or images)

– In general, the fastest method of rendering a surface

CSE 167, Winter 2020 2

Page 3: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

More realistic illumination

• In the real world, at each point in a scene, light arrives from all directions (not just from a few point light sources)– Global illumination is a solution, but is computationally

expensive– An alternative to global illumination is an environment map

• Store “omni-directional” illumination as images• Each pixel corresponds to light from a certain direction• Sky boxes make for great environment maps

CSE 167, Winter 2020 3Based on slides courtesy of Jurgen Schulze

Page 4: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• Early (earliest?) non-decal use of textures

• Appearance of shiny objects– Phong highlights produce blurry highlights for glossy

surfaces

– A polished (shiny) object reflects a sharp image of its environment

• The whole key to ashiny-looking material is providing something for it to reflect

4

[Dro

r, W

illsk

y, &

Ad

elso

n 2

00

4]

CSE 167, Winter 2020

Page 5: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• A function from the sphere to colors, stored as a texture

5CSE 167, Winter 2020

[Blin

n &

New

ell 1

97

6]

Page 6: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• Interface (Lance Williams, 1985)

CSE 167, Winter 2020 6

Video

Page 7: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• Flight of the Navigator (1986)

CSE 167, Winter 2020 7

Page 8: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• Terminator 2 (1991)

CSE 167, Winter 2020 8

Page 9: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection mapping

• Star Wars: Episode I The Phantom Menace(1999)

CSE 167, Winter 2020 9

Page 10: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Creating environment maps

• An environment map is a spherical panoramic image

• Capturing a spherical panoramic image– Use a 360 degree camera

– Take a picture of a mirrored ball (called a light probe)

CSE 167, Winter 2020 10Light Probes by Paul Debevec https://www.debevec.org/Probes/

Page 11: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment maps as light sources

• Key assumption: light captured by an environment map is emitted from infinitely far away

• As such, an environment map consists of directional light sources

– An environment map value is defined for each direction, independent of position in scene

– The same environment map is used at each point in the scene

CSE 167, Winter 2020 11

Page 12: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment maps

CSE 167, Winter 2020 12

Global illumination with

pre-computed radiance transfer

[Sloan et al. 2002]

Reflection mapping[Georg-Simon Ohm University of Applied Sciences]

Page 13: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment maps

CSE 167, Winter 2020 13

Page 14: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Cube environment map

• Store incident light on six faces of a cube instead of on sphere

CSE 167, Winter 2020 14

Page 15: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Cube environment map

CSE 167, Winter 2020 15

Spherical map Cube map

Page 16: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Cube vs. spherical maps

• Advantages of cube maps

– More even texel sample density causes less distortion, allowing for lower resolution maps

– Easier to dynamically generate cube maps for real-time simulated reflections

CSE 167, Winter 2020 16

Page 17: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Cube environment map

• Cube map look-up

– Given light direction (x,y,z)

– Largest coordinate component determines cube map face

– Dividing by magnitude of largest component yields coordinates within face

CSE 167, Winter 2020 17

Page 18: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment mapping

CSE 167, Winter 2020 18

Source: https://antongerdelan.net/opengl/cubemaps.html

Page 19: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection maps

• Simulates mirror reflection

• Computes reflection vector at each pixel

• Use reflection vector to look up cube map

• Rendering cube map itself is optional (application dependent)

CSE 167, Winter 2020 19

Page 20: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Reflection maps

Images from Illumination and Reflection Maps:

Simulated Objects in Simulated and Real Environments

Gene Miller and C. Robert Hoffman

SIGGRAPH 1984 “Advanced Computer Graphics Animation” Course Notes

CSE 167, Winter 2020 20

Page 21: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Diffuse irradiance environment map

• Given a scene with k directional lights, light directions d1, …, dk, and intensities i1, …, ik illuminating a diffuse surface with normal n and color c

• Pixel intensity B is computed as

• The cost of computing B is proportional to the number of texels in environment map

• Observations– All surfaces with normal direction n will return the same

value for the sum– The sum is dependent on just the lights in the scene and

the surface normal

CSE 167, Winter 2020 21

=

=kj

jj indcB..1

),0max(

Page 22: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Diffuse irradiance environment map

• Precompute diffuse reflections– Precompute sum for any normal n and store result

in a second environment map, indexed by surface normal

• Second environment map is called diffuse irradiance environment map

• Allows to illuminate objects with arbitrarily complex lighting environments with single texture lookup

CSE 167, Winter 2020 22

Page 23: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Diffuse irradiance environment map

• Two cubic environment maps

– Reflection map

– Diffuse map

CSE 167, Winter 2020 23

Diffuse shading vs. shading with diffuse map

Page 24: Introduction and Overview · 2020. 2. 26. · •Star Wars: Episode I . The Phantom Menace (1999) CSE 167, Winter 2020 9. Creating environment maps •An environment map is a spherical

Environment mapping

• Rendering with Natural Light (Paul Debevec, 1998)

CSE 167, Winter 2020 24

Video