73
Radiance Caching for Participating Media University of California, San Diego Pixel Lab Wojciech Jarosz Craig Donner Matthias Zwicker Henrik Wann Jensen Thursday, 6 September 12

Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Radiance Caching for Participating Media

University of California, San DiegoPixel Lab

Wojciech Jarosz Craig Donner Matthias Zwicker Henrik Wann Jensen

Thursday, 6 September 12

Page 2: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

2

http://mev.fopf.mipt.ru

Wojciech Jarosz http://mattmosher.com/

Thursday, 6 September 12

* In this talk, we are interested in rendering scene with participating media, or scenes where the volume or medium participates in the lighting interactions.* Participating media is actually all around us.* These are just a few example photographs of the type of striking effects that are caused by participating media.

Page 3: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Volume Rendering Eq.

3

Participating MediumL(e,�)

Thursday, 6 September 12

* In order to render images:* We need to compute the radiance, L, arriving at the eye along a ray in the presence of participating media.* This can be expressed using the volume rendering equation, which consists of two main terms: * The right term incorporates lighting arriving from surfaces * and the left term, scattering of light from the medium

Page 4: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

3

Participating MediumL(e,�)

Thursday, 6 September 12

* In order to render images:* We need to compute the radiance, L, arriving at the eye along a ray in the presence of participating media.* This can be expressed using the volume rendering equation, which consists of two main terms: * The right term incorporates lighting arriving from surfaces * and the left term, scattering of light from the medium

Page 5: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(x�,�)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

4

� ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

Tr(e�x⇥) = e�R xe �(t) dtTransmittance:

Tr(e�x�)

Thursday, 6 September 12

* This light is then diminished by the transmittance as it travels through the medium towards the eye

Page 6: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

5

Li(x, ⇥�)

all light arriving at x which scatters towards e

Thursday, 6 September 12

Page 7: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

6

Li(x, ⇥�)

scattering coefficient

Thursday, 6 September 12

Page 8: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

7

Li(x, ⇥�)

� ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥Tr(e�x)

Thursday, 6 September 12

Page 9: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Volume Rendering Eq.

8

Li(x, ⇥�)

Very costly!

Thursday, 6 September 12

Page 10: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Previous Work

Path tracing[Kajiya and Herzen 84, Kajiya 86, Lafortune and Willems 96]

- Slow convergence/noisy results.

Photon mapping[Jensen and Christensen 1998.]

- Costly for high albedo

- Costly for scenes with large extent

Finite Element[Rushmeier and Torrance 87]

- Requires discretization

Participating Media

9

Thursday, 6 September 12

* A number of methods have been developed to handle participating media, but they all have significant limitations.* this motivates us to develop a new method.

Page 11: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Related Work

Caching:

• “A Ray Tracing Solution for Diffuse Interreflection.” Ward et al. 1988.

• “Irradiance Gradients.” Ward and Heckbert. 1992.

• “Radiance Caching for Efficient Global Illumination Computation.” Křivánek et al. ‘05

Global Illumination

10

Thursday, 6 September 12

* we draw inspiration for our method from irradiance caching methods for surfaces.

Page 12: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Indirect Illumination

Direct Illumination Indirect Illumination

11

Thursday, 6 September 12

* direct illumination has sharp discontinuities* Indirect illumination smooth in large regions

Page 13: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Irradiance CachingWard et al. ‘88

12

Thursday, 6 September 12

* compute irradiance accurately only at a sparse set of locations (shown in yellow) and interpolate whenever possible.

Page 14: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Irradiance GradientsWard and Heckbert ‘92

13

Irra

dia

nce

Cac

hin

gIr

radia

nce

Gra

die

nts

Thursday, 6 September 12

* follow-up work

Page 15: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

http://www.kevinyank.com

14

Observations

Smooth in large portions of the image

Thursday, 6 September 12

* We make the observation that same property is true for participating media* computationally very expensive, but very smooth and low frequency in large parts of the image

Page 16: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Goals

• Exploit this property by caching lighting within participating media.

• Develop an efficient but general rendering algorithm which can handle:

• single, multiple, anisotropic scattering

• heterogeneous media

• production quality

15

Thursday, 6 September 12

* production quality, physically based

Page 17: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Radiance Caching in Participating Media

16

cache point valid radius

Thursday, 6 September 12

* at a high level, radiance caching gains efficiency by caching expensive lighting calculations within the medium.

Page 18: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Radiance Caching in Participating Media

17

cache point valid radius

Thursday, 6 September 12

* for this ray, since a cache point overlaps with every part of the ray, we can compute the lighting by interpolating the cache points

Page 19: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Radiance Caching in Participating Media

18

cache point valid radius

Thursday, 6 September 12

* a neighboring ray can re-use many of the same cache points

Page 20: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Challenges

• What should the cache points store? • Where to place cache points to

minimize visible error?• How to interpolate cache points

accurately?

19

Thursday, 6 September 12

* Cannot re-use details from irradiance caching directly, since many underlying assumptions are different.* What is a “good” valid radius?* How do we interpolate the nearby cached values?

Page 21: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Approach

• Cache inscattered radiance:

20

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Thursday, 6 September 12

* Since the gradient is a local measure of the smoothness of the radiance field, we use it to estimate a valid radius within which it’s OK to extrapolate each cache point.

Page 22: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Approach

• Cache inscattered radiance:

• Compute gradients due to translation

20

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Thursday, 6 September 12

* Since the gradient is a local measure of the smoothness of the radiance field, we use it to estimate a valid radius within which it’s OK to extrapolate each cache point.

Page 23: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Approach

• Cache inscattered radiance:

• Compute gradients due to translation

• Use gradients to:

• Estimate valid radius within which it’s OK to extrapolate

• Provide high quality interpolation

20

L(e, ⌥⇥) =� s

0Tr(e�x)�s(x)Li(x, ⌥⇥) dx + Tr(e�x�)L(x�, ⌥⇥)

Thursday, 6 September 12

* Since the gradient is a local measure of the smoothness of the radiance field, we use it to estimate a valid radius within which it’s OK to extrapolate each cache point.

Page 24: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Radiance Computation

• In order to make gradient derivations more convenient:

• Split computation into single and multiple scattering components:

• How do we compute

• How do we compute

21

Li = Ls + Lm

Ls and Lm?

�Ls and �Lm?

Thursday, 6 September 12

* we cache values of Li* split because: * it makes the derivations more convenient* single scatter is light that only scatters once in the medium before reaching the eye.* multiple scattering scatters at least twice

Page 25: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Single Scattering

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

22

x

x’

Thursday, 6 September 12

Page 26: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Single Scattering

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

23

x’A

A

Integration over surface area

Thursday, 6 September 12

* over area of light sources and surfaces* reduce radiance* radiance from light, diminished through medium

Page 27: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Single Scattering

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

{24

x

x’

Lr(x��x) = L(x��x)Tr(x�⇥x)Reduced Radiance:

Thursday, 6 September 12

* over area of light sources and surfaces* reduce radiance* radiance from light, diminished through medium

Page 28: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Single Scattering

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

25

x’

Phase function

Thursday, 6 September 12

Page 29: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Single Scattering

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

26

x

x’

Visibility Function and Geometry Term

Thursday, 6 September 12

* there is also a visibility and geometry function

Page 30: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Gradient Computation

27

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

Thursday, 6 September 12

* In order to obtain the gradient, we analytically differentiate the terms in the integrand using the product rule.* gradient of Lr is most significant: * accounts for change in transmission, even in heterogeneous media

Page 31: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Gradient Computation

27

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

�Ls(x, ��) =�

A(�p)LrV H + p(�Lr)V H + pLrV (�H) dx�

Thursday, 6 September 12

* In order to obtain the gradient, we analytically differentiate the terms in the integrand using the product rule.* gradient of Lr is most significant: * accounts for change in transmission, even in heterogeneous media

Page 32: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

• Assumes constant visibility

Gradient Computation

27

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

�Ls(x, ��) =�

A(�p)LrV H + p(�Lr)V H + pLrV (�H) dx�

Thursday, 6 September 12

* In order to obtain the gradient, we analytically differentiate the terms in the integrand using the product rule.* gradient of Lr is most significant: * accounts for change in transmission, even in heterogeneous media

Page 33: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

• Assumes constant visibility

• Evaluated together using Monte Carlo integration and ray marching

Gradient Computation

27

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

�Ls(x, ��) =�

A(�p)LrV H + p(�Lr)V H + pLrV (�H) dx�

Thursday, 6 September 12

* In order to obtain the gradient, we analytically differentiate the terms in the integrand using the product rule.* gradient of Lr is most significant: * accounts for change in transmission, even in heterogeneous media

Page 34: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

• Assumes constant visibility

• Evaluated together using Monte Carlo integration and ray marching

• Gradients take into account changing properties of medium along the whole ray

Gradient Computation

27

Ls(x, ��) =�

Ap(��,x��x)Lr(x��x)V (x�⇥x)H(x��x) dx�

�Ls(x, ��) =�

A(�p)LrV H + p(�Lr)V H + pLrV (�H) dx�

Thursday, 6 September 12

* In order to obtain the gradient, we analytically differentiate the terms in the integrand using the product rule.* gradient of Lr is most significant: * accounts for change in transmission, even in heterogeneous media

Page 35: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Reduced Radiance

28

Tr � ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

x x'

Lr(x��x) = L(x��x)Tr(x�⇥x)Reduced Radiance:

Thursday, 6 September 12

Page 36: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Ray Marching

29

Tr

σt

σt

σt

σt

� ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

x x'

Thursday, 6 September 12

Page 37: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Transmission Gradient

30

∇Tr � ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

x'x

Thursday, 6 September 12

Page 38: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

∇Tr

∇σt

∇σt

∇σt

∇σt

� ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

x'x

Transmission Gradient

31

Thursday, 6 September 12

* take into account how the extinction coefficients change along the whole ray segment

Page 39: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Transmission Gradient

32

∇Tr

∇σt

∇σt

∇σt

∇σt

� ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇤ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⌅ ⇥

x'x

Thursday, 6 September 12

* these changes would induce a different overall transmission when x is translated* gradients contain meaningful information about how Tr changes as we move x in any direction, even out of the line connecting x to x’

Page 40: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Lm x

Multiple Scattering

33

Thursday, 6 September 12

Page 41: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

∇Lm x

Multiple Scattering Gradient

34

Thursday, 6 September 12

Page 42: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Cache Storage

• Cached points store:• 3D position• Value (inscattered radiance)• Gradient• Valid Radius

35

Thursday, 6 September 12

* distinct caches for single, surface, and multiple scattering

Page 43: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Cache Storage

• Cached points store:• 3D position• Value• Gradient• Valid Radius

}

Isotropic Media

‣inscattered radiance is a scalar

36

Thursday, 6 September 12

Page 44: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Cache Storage

• Cached points store:• 3D position• Value• Gradient• Valid Radius

}

Anisotropic Media

‣inscattered radiance is a spherical function‣projected onto SH

37

Thursday, 6 September 12

Page 45: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Valid Radius

38

Thursday, 6 September 12

Want density of cache points to adapt to the local variation of illumination:* smooth radiance → large radius, few cache points* sharp radiance → small radius, many cache points

Page 46: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Optimal Radius

Ex(x�) = radiance extrapolated from x to x�

A(x�) = actual radiance at x�

39

Thursday, 6 September 12

* Maximum radius such that the total relative error between the extrapolated and actual radiance within the cached region is below some error threshold t.* using relative error because human vision is sensitive to contrast, not absolute errors

Page 47: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Optimal Radius

Ropt(x) = maxr

⇧⇧⇤

x�⇥�r

|Ex(x�)�A(x�)| dx�

x�⇥�r

A(x�) dx�< t

⌃⌃⌅

Ex(x�) = radiance extrapolated from x to x�

A(x�) = actual radiance at x�

39

Thursday, 6 September 12

* Maximum radius such that the total relative error between the extrapolated and actual radiance within the cached region is below some error threshold t.* using relative error because human vision is sensitive to contrast, not absolute errors

Page 48: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Valid Radius1D Scene with 2 Point Lights

Va

lid

ra

diu

s g

iven

err

or

thre

sho

ld

Optimal radius

Position

Location of

Light 1

Location of

Light 2

40

Thursday, 6 September 12

* numerically computed optimal radius

Page 49: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Valid Radius1D Scene with 2 Point Lights

Va

lid

ra

diu

s g

iven

err

or

thre

sho

ld

Optimal radius

Position

Location of

Light 1

Location of

Light 2

41

� ln(L) =�L

L

measure of local contrast:

Thursday, 6 September 12

* log-space gradient. perceptually motivated: contrast

Page 50: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Valid Radius1D Scene with 2 Point Lights

Va

lid

ra

diu

s g

iven

err

or

thre

sho

ld

Optimal radiusInverse log-space gradient

Position

42

measure of local contrast:

� ln(L) =�L

Lr � 1

⇥⇤ ln(L)⇥ =�

j Lj

⇥�

j ⇤Lj⇥

Thursday, 6 September 12

Page 51: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Valid Radius1D Scene with 2 Point Lights

Va

lid

ra

diu

s g

iven

err

or

thre

sho

ld

Optimal radiusInverse log-space gradientOur error metric

Position

43

r ��

j Lj�j ⇥⇤Lj⇥

r ��

j Lj

⇥�

j ⇤Lj⇥

Avoid singularities:

Thursday, 6 September 12

Page 52: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

• Perform a weighted interpolation from nearby cache points.

44

Interpolation

Thursday, 6 September 12

* whenever possible, interpolate from nearby cache points* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 53: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

• Perform a weighted interpolation from nearby cache points.

44

Interpolation

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

Thursday, 6 September 12

* whenever possible, interpolate from nearby cache points* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 54: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

x

45

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

Thursday, 6 September 12

* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 55: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Find overlapping cache points.

46

xxk1

xk2

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

Thursday, 6 September 12

* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 56: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Extrapolate along gradients in log-space.

47

ln(L)

xk1 xk2

�Lk1

Lk1�Lk2

Lk2ln(Lk1)

ln(Lk2)

xxk1

xk2

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

Thursday, 6 September 12

* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 57: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Weight contributions using smooth kernel

48

ln(L)

xk1 xk2

xxk1

xk2

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

Thursday, 6 September 12

* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 58: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Exponentiate result to obtain interpolated radiance.

49

ln(L)

xk1 xk2x

L(x) ⇤ exp

⌥⌥⌥⇧

k�C

�ln(Lk) +

⇧Lk

Lk· (x� xk)

⇥w (⌅x� xk⌅)

k�C

w (⌅x� xk⌅)

���⌃

xxk1

xk2

Thursday, 6 September 12

* given a valid radius for each cache point, in order to compute radiance: interpolate* weighted average* smooth weighting function

Page 59: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

50

• All results rendered:• at 1K horizontal resolution• with up to 16 samples per pixel• on a Core 2 Duo 2.4 GHz

Thursday, 6 September 12

Page 60: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

1.4 minutes51

RC

PT

Thursday, 6 September 12

Page 61: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

3.6 minutes52

RC

PT

Thursday, 6 September 12

* can handle anisotropic media* project radiance and gradient onto SH* photon mapping works quite well in contained scenes like this, however...

Page 62: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

19 minutes

53

RC

PT

Thursday, 6 September 12

* very difficult for photon mapping* reuse for walk-through animations

Page 63: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

54

Thursday, 6 September 12

Page 64: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

5.8 minutes

55

RC

PT

Thursday, 6 September 12

* can handle heterogeneous media

Page 65: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

56

Thursday, 6 September 12

Page 66: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

20 minutes

57

RC

PT

Thursday, 6 September 12

* can handle scenes with large extent* difficult for photon mapping

Page 67: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Results

contrast enhanced

58

PMRC

Thursday, 6 September 12

* 8M photons

Page 68: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Contributions

59

Thursday, 6 September 12

Page 69: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Contributions

59

• Radiance caching scheme for Part. media:• complementary to photon mapping

• perceptually motivated error metric

Thursday, 6 September 12

Page 70: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Contributions

59

• Radiance caching scheme for Part. media:• complementary to photon mapping

• perceptually motivated error metric

• Analytic gradient derivations for inscattered radiance:• efficient to compute

• take into account changing properties of medium

Thursday, 6 September 12

Page 71: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Limitations

• Gradient ignores visibility/occlusion changes

• Multiple scattering still costly

60

Thursday, 6 September 12

Page 72: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Future Work

• Gradient ignores visibility/occlusion changes

• W. Jarosz, et al. “Irradiance Gradients in the Presence of Participating Media and Occlusions.”

• Multiple scattering still costly• Terminate recursion using volumetric photon

mapping

61

Thursday, 6 September 12

Page 73: Radiance Caching for Participating Mediawjarosz/publications/... · • Cache inscattered radiance: • Compute gradients due to translation 20 L(e,⌥⇥) = s 0 T r(ex) s(x)L i(x,⌥⇥)

Thank you

Thursday, 6 September 12