Top Banner
A Mike Day Paper Exercise An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001
23

An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

Dec 14, 2015

Download

Documents

Latrell Mileham
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: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

A Mike Day Paper Exercise

An Efficient Representation for Irradiance Environment MapsRavi Ramamoorthi and Pat Hanrahan2001

Page 2: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What ? Describes a method of calculating Global

Illumination using spherical harmonics

Page 3: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

When calculating Global Illumination, high-frequency lighting gets blurred. This implies that we might be able to

ignore higher-order spherical harmonics terms.

The radiance map

The irradiance map

Page 4: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

Traditional Lighting

- Wikipedia

Page 5: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

Lighting a scene

Page 6: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What? A method of approximating light

accumulation (Irradiance) at a point in space using spherical harmonics

What?

Page 7: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

Spherical harmonics A method of approximating a function

over a domain Similar to Fourier transform

Approximating a square wave

Page 8: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What is irradiance? Irradiance is the accumulation of

all lighting values on a half-spherefor a point (given its normal).

It is a function of the normal (n). The integral over ω removes the

dependence on ω.

The integral represents the accumulation of all the light values.

dLE )()()()(

nnn

Page 9: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

How can we calculate E(n)? Spherical Harmonics! Like a Fourier Transform, Spherical

Harmonics translates one function into a sum of basis functions multiplied by coefficients.

The basis functions are defined using polar coordinates (θ, ϕ).

Page 10: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

So, let's apply Spherical Harmonics to E(n)!

dLE )()()()(

nnn

Page 11: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

So, let's apply Spherical Harmonics to E(n)!

Rewrite E(n) in terms of (θ, ϕ)▪ E(n) is in Cartesian coordinates▪ E(θ, ϕ) is E(n) converted to polar coordinates

dLE )()(),()(

nn

Page 12: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

So, let's apply Spherical Harmonics to E(n)!

Spherical harmonics lets us replace the function E(θ, ϕ) with a summation over l and m.▪ Ylm(θ, ϕ): The spherical harmonics basis

function▪ Elm: A coefficient for Ylm(θ, ϕ)

How many basis functions?

dLYEml

lmlm )()(),()(

,

n

n

Page 13: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

So, let's apply Spherical Harmonics to L(ω)!

Rewrite L(ω) in terms of (θ, ϕ)

dLYEml

lmlm )(),(),()(

,

n

n

Page 14: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

So, let's apply Spherical Harmonics to L(ω)!

Replace (n ∙ ω) with the cosine▪ Remember: a ∙ b = |a| |b| cos(θ)▪ Note that n and ω are unit vectors so their

lengths are 1▪ Let A(θ') = max[0, cos(θ')]

dALYEml

lmlm )'(),(),()(

,

n

Page 15: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

Simplify the equation! The derivation of the integrals is quite

difficult. This is the result of the paper:

llmlm ALE ˆ

)1,(0

)1(3

2

)()!(2

!

)1)(2(

)1(2

ˆ

22

12

loddl

l

evenll

ll

A

ll

l

l

Page 16: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

Replace the

22

12

)!(2

!

)1)(2(

)1(20

3

2

,11

ll

l

lmlmlmlmlm

l

llLEELE

evenloddll

lA

Page 17: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What does this mean?

Values for drop off quickly

22

12

)!(2

!

)1)(2(

)1(20

3

2

,11

ll

l

lmlmlmlmlm

l

llLEELE

evenloddll

l 0 1 2 3 4 5 6 7 8

Al 3.142 2.094 0.785 0 -0.131 0 0.049 0 -0.025

lA

Page 18: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What is ? Everything after the 3rd band of spherical

harmonics contribute little You get a good approximation by using

only 9 coefficients▪ l = [0, 1, 2] -l ≤ m ≤ l▪ (0, 0), (1, -1), (1, 0), (1, 1), (2, -2), (2, -1), (2, 0), (2, 1), (2, 2)

▪ Technically we get l = 3 as well, since the coefficient is 0

lA

Page 19: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

An Efficient Representation for Irradiance Environment Maps

What is ? The lighting environments they use for

their test cases have an average error of around 1% and a maximum error of around 5%.

Their test environments look to be fairly representative, so the margin for error for our environments should be similar.

lA

Page 20: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

Application

Bounced light calculation is expensive

Light maps only work for static objects

Sampling from voxels would work for dynamic objects, but needs lots of voxels

Page 21: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

Application

9 coefficients for each channel

Spherical harmonic coefficients can be calculated from environment maps

Irradiance is low frequency so maps do not need to be especially high res

Page 22: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

Application

Artists place volumes Automatic sampling within volume

produces many voxels

Page 23: An Efficient Representation for Irradiance Environment Maps Ravi Ramamoorthi and Pat Hanrahan 2001.

Application

Interpolate between voxels Irradiance evaluated as

M is a 4x4 matrix based on coefficients

MnnnE t)(