10 bidirectional methodsvda.univie.ac.at/teaching/imagesynthesis/17w/lecture... · 2018-01-09 ·...

43
052213 VU Image Synthesis Light Transport III: Bidirectional Methods Alireza Ghane + Torsten Möller [email protected] [email protected] vda.cs.univie.ac.at/Teaching/ImageSynthesis/17w/ 1

Upload: others

Post on 10-Mar-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

052213 VU Image Synthesis

Light Transport III:Bidirectional Methods

Alireza Ghane + Torsten Möller

[email protected] [email protected]

vda.cs.univie.ac.at/Teaching/ImageSynthesis/17w/

1

Page 2: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Reading• Chapter 16 of “Physically Based Rendering” by Pharr, Jakob,

Humphreys • Chapter 19, 20 in “Principles of Digital Image Synthesis,” by A.

Glassner • “Realistic Image Synthesis Using Photon Mapping,”

by H. W. Jensen

2

Page 3: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

The path-space measurement equation

3

Page 4: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

• Expressing LTE in terms of geometry within the scene

• Replacing the integrand (dωi)with an area integrator over the whole scene geometry and remembering:

• - visibility term (either one or zero)

LTE - Geometric Formulation

4

dω i =cos ʹ ́ θ

ʹ p − ʹ ́ p 2 dA ʹ ́ p ( )

ωo

ω i

ʹ p €

ʹ ́ p

p

Page 5: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

LTE - Geometric Formulation• Geometry coupling term

• New (geometric) formulation of the Light Transport Equation (LTE)

• Randomly pick points in the scene and create a path • vs. (previously) randomly pick directions over a sphere

5

ωo

ω i

ʹ p €

ʹ ́ p

p

Page 6: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

• Recursive evaluation

+...

LTE - Geometric Formulation

6

p1€

p2

p0

p3

Page 7: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

LTE - Geometric Formulation• compact formulation:

• For a path • Where p0 is the camera and pi is a light source

7

p i = p0p1...pi

p1€

p2

p0

p3

Page 8: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

LTE - Geometric Formulation• with:

• Where

• Is called the throughput • Special case:

8

p1€

p2

p0

p3

Page 9: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Measuring over a pixel• Integrating over pixel j:

• Where We is the filter function around a pixel:

9

Page 10: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Integrating over a pixel• And hence the integral:

• A - light bounces around until it hits the camera • B - a quantity from the sensor bounces around and only makes a

contribution if it hits a light

10

Page 11: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Symmetry• Concept of measurement (We) and emission (Le) is symmetrical:

• Swapping the role of camera and light creates the idea of particle tracing

• We also known as the importance of ray between p0 and p1

11

Page 12: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Non-symmetry: Refraction• When light passes from one medium into another whose index of

refraction is lower the transmitted angle is larger than the incident angle

• at one point the light gets reflected - called total internal reflection • For water ηw = 4/3 • Radiance gets compressed

12

Li =⌘2i⌘2t

Lt

Page 13: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Non-symmetry: Refraction• Radiance gets compressed

• Choose a proper adjoint BTDF:

13

Li =⌘2i⌘2t

Lt

f?(p,!o,!i) = f(p,!i,!o) =⌘2t⌘2i

f(p,!o,!i)

Page 14: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Non-symmetry: shading• Sometime replace proper normal ng with Interpolated normal ns:

• We can achieve this by a different BTDF:

• Hence, the adjoint would be:

14

Lo(p,!o) = Le(p,!o) +

Z

S2

f(p,!o,!i)Li(p,!i)|ng · !i|d!i

fshade(p,!o,!i) =|ns · !i||ng · !i|

f(p,!o,!i)

f?shade(p,!o,!i) =

|ns · !o||ng · !o|

f?(p,!o,!i)

Page 15: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

Photon Mapping

15

Page 16: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Theoretical foundation for particle tracing

• Particle tracing algorithm creates N samples of illumination at points pj, on surfaces in the scene

(pj, ωj, βj) • Recording

• Incident illumination from direction ωj • With throughput weight βj

16

Page 17: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Theoretical foundation for particle tracing

• Particle tracing algorithm creates N samples of illumination at points pj, on surfaces in the scene

(pj, ωj, βj) • Recording

• Incident illumination from direction ωj • With throughput weight βj

• What are good values for ωj and βj

17

Page 18: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Theoretical foundation for particle tracing

• Given an importance function We(p, ω), ideally, we want

• E.g. if we want to compute the total flux:

• We would use an importance function of We(p, ω)=1 if p is on the wall surface and ω.n > 0

18

E

2

4 1

N

NX

j=1

�jWe(pj ,!j)

3

5 =

Z

a

Z

S2

We(p,!)Li(p,!)|cos✓|dAd!

⌦ =

Z

Awall

Z

H2(n)Li(p,!)|cos✓|dAd!

Page 19: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Theoretical foundation for particle tracing

• Given an importance function We(p, ω), ideally, we want

19

E

2

4 1

N

NX

j=1

�jWe(pj ,!j)

3

5 =

Z

a

Z

S2

We(p,!)Li(p,!)|cos✓|dAd!

Page 20: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Theoretical foundation for particle tracing

• Given an importance function We(p, ω), ideally, we want

• hence, good weights could be:

20

E

2

4 1

N

NX

j=1

�jWe(pj ,!j)

3

5 =

Z

a

Z

S2

We(p,!)Li(p,!)|cos✓|dAd!

�i,j =Le(pi,ni ! pi,ni�1)

p(pi,ni)

ni�1Y

j=1

1

1� qi,j

f(pi,j+1 ! pi,j ! pi,j�1)G(pi,j+1 $ pi,j)

p(pi,j)

Page 21: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Photon mapping• In order to compute reflected radiance at a point, need to estimate

exitant radiance at a point p in a direction ωo:

• Hence, we have as a measuring function:

• Not too useful • Spread out contribution instead and us a smooth interpolator • This reuse of photons is a big boost to the efficiency of photon

mapping

21

Z

S2

f(p,!o,!i)Li(p,!i)| cos ✓i|d!i =

Z

A

Z

S2

�(p� p0)f(p0,!o,!i)Li(p0,!i)| cos ✓i|d!idA(p

0)

We(p0,!) = �(p0 � p)f(p,!o,!i)

Page 22: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Photon Mapping Example• Pinhole camera • Point light • Only transmissive glass • Tracing ray through glass hits surface through refractive behaviour • No direct light strategies are possible / will hit the light • Photon mapping:

• trace particles leaving the light • Deposit them on the surface and • now collect their contributions

22

Glass

Diffuse

Page 23: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Photon Mapping• Kernel density estimation collects the photons

• dN — radius is chosen adaptively such that N photons are enclosed

• Big problem — storage of photons • Usually using a kd-tree

23

Lo(p,!o) ⇡1

NpdN (p)2

NpX

j

k

✓p� pjdN (p)

◆�jf(p,!o,!i)

Page 24: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Photon Mapping• Basic idea : Density estimation with a discrete density of photons • 2-step algorithm

• Photon trace: • Simulates the transport of individual photons • Photons emitted from source • Photons deposited on surfaces • Photons reflected from surfaces to other surfaces

• Rendering • Photons collected by rendering

24

Page 25: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

Progressive Photon Mapping

25

Page 26: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Progressive Photon Mapping• Trace rays from camera, find a VisiblePoint at each pixel • Store VisiblePoint in a 3D spatial structure that allows fast lookups • Trace photons from lights; at intersections search for nearby

VisiblePoints and contribute illumination • Decrease acceptance radius as more photons contribute

• When we hit a specular surface trace one bounce further

26

Page 27: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Progressive Photon Mapping• Trace rays from camera, find a VisiblePoint at each pixel • Store VisiblePoint in a 3D spatial structure that allows fast lookups • Trace photons from lights; at intersections search for nearby

VisiblePoints and contribute illumination • Decrease acceptance radius as more photons contribute

• LTE broken into two parts:

• Le is easy and direct term Ld can be handled in a standard fashion

27

L(p,!o) = Le(p,!o) +

Z

S2

f(p,!o,!i)Ld(p,!i)| cos ✓i|d!i +

Z

S2

f(p,!o,!i)Li(p,!i)| cos ✓i|d!i

Page 28: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Progressive Photon Mapping• Trace rays from camera, find a VisiblePoint at each pixel • Store VisiblePoint in a 3D spatial structure that allows fast lookups • Trace photons from lights; at intersections search for nearby

VisiblePoints and contribute illumination • Decrease acceptance radius as more photons contribute

• LTE broken into two parts:

• Li can be handled either by: • Sample next bounce according to BSDF (like a path tracer) • Save current point to collect illumination from photons

28

L(p,!o) = Le(p,!o) +

Z

S2

f(p,!o,!i)Ld(p,!i)| cos ✓i|d!i +

Z

S2

f(p,!o,!i)Li(p,!i)| cos ✓i|d!i

Page 29: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

Progressive Photon Mapping• Trace rays from camera, find a VisiblePoint at each pixel • Store VisiblePoint in a 3D spatial structure that allows fast lookups • Trace photons from lights; at intersections search for nearby

VisiblePoints and contribute illumination • Decrease acceptance radius as more photons contribute

• adv: • No photon storage used • Arbitrary number of photons can be traced

• Cons: • Storage limited by number of VisiblePoints

29

Page 30: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

Stochastic Progressive Photon Mapping (SPPM)

30

Page 31: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

SPPM• Three modifications:

• Same as PPM but with one VisiblePoint per pixel • Use a constant radius for all visible points:

• Update the radius as more photons are traced

31

Lo(p,!o) ⇡1

Np⇡r2

NpX

j

k

✓p� pjdN (p)

◆�jf(p,!o,!i)

Page 32: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

© Torsten Möller

SPPM — updating the radius

• Where • Ni is the number of points that have contributed to the point

after the its tiertion • Mi is the number of photons that contributed during the current

iteration • ri is the search radius for the its iteration • 𝜏 maintains the sum of products of photons with BSDF values

• 𝛾 is usually 2/3

32

Ni+1 = Ni + �Mi

rI+1 = ri

rNi+1

Ni +Mi

⌧i+1 = (⌧i + �i)r2i+1

r2i

�i =MiX

j

�jf(p,!o,!j)

Page 33: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

33http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 34: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

34http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 35: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

35http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 36: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

36http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 37: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

37http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 38: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

38http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 39: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

39http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 40: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

40http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 41: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

41http://graphics.stanford.edu/courses/cs348b/lecture/bidir

Page 42: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

Bidirectional Path Tracing

42

Page 43: 10 bidirectional methodsvda.univie.ac.at/Teaching/ImageSynthesis/17w/Lecture... · 2018-01-09 · SPPM — updating the radius • Where • N i is the number of points that have

Metropolis Light Transport

43