Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let...

98
Computer graphics III – Bidirectional path tracing Jaroslav Křivánek, MFF UK [email protected]

Transcript of Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let...

Page 1: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Computer graphics III – Bidirectional path tracing

Jaroslav Křivánek, MFF UK

[email protected]

Page 2: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

CG III (NPGR010) - J. Křivánek 2015

Jerome White

Page 3: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Martin Geupel (DeadClown)

Page 4: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Chakib Rabia

Page 5: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light transport – Global illumination

© Duncan Howdin

Archviz Movies

Image courtesy of Columbia Pictures.

© 2006 Columbia Pictures Industries, Inc.

CG III (NPGR010) - J. Křivánek 2015

Page 6: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light transport – Global illumination

More information

“The State of Rendering”

CG III (NPGR010) - J. Křivánek 2015

Page 7: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement equation

Page 8: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement equation

Rendering equation enables evaluating radiance at isolated points in the scene

But in fact, we are interested in average radiance over a pixel: an integral, again?!

Yes, it’s called the Measurement equation

CG III (NPGR010) - J. Křivánek 2015

Page 9: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement equation

CG III (NPGR010) - J. Křivánek 2015

ALWIM H

ddcos),(),()(

ie x

xx

Response of a virtual linear sensor to light (most commonly the pixel color).

Integrate over the entire scene surface. (We assume that the virtual sensor is a part of the scene. The response is non-zero only on the sensor area because We is zero elsewhere.)

Relative response (weight). Each sensor (pixel) has a different We function.

Page 10: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Example measurement: Radiant flux over a region formulated as a ME

Given a region S in ray space

(a subset of the Cartesian product of the scene surfaces

and directions)

For We defined as

the result of the measurement equation is the radiant flux F(S).

CG III (NPGR010) - J. Křivánek 2015

HMS

otherwise0

),(for1),(

SxxWe

Page 11: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement equation as a scalar product of functions

Let us define a scalar product of function f and g as:

The Measurement equation can now be written as

CG III (NPGR010) - J. Křivánek 2015

AgfgfM H

ddcos),(),(,)(

x

xx

ie ,LWI

Page 12: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Transport of radiance and visual importance

CG III (NPGR010) - J. Křivánek 2015

L (radiance) W (importance)

Page 13: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Visual importance

We describes how important is the incident radiance to the sensor response

One step into the scene: Incident radiance on the sensor =

outgoing radiance from other scene points

And we can go on to 2, 3, … steps into the scene…

As a result, We can be interpreted as an (imaginary)

transport quantity emitted from the sensor (similarly to how radiance Le is emitted from light sources)

In this interpretation, we call We the emitted importance function

CG III (NPGR010) - J. Křivánek 2015

Page 14: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Transport of visual importance

The importance function is transported by the similar rules to radiance and settles down on an equilibrium

(steady state) given by the equilibrium visual importance function W:

CG III (NPGR010) - J. Křivánek 2015

)(

iiioii

oeo

dcos),()),,(r(

),(),(

x

xx

xx

H

rfW

WW

As in the rendering equation except that the BRDF arguments are exchanged (No difference for reflection because the BRDF is symmetrical, but it makes difference for transmission, which is in general not symmetrical.)

Page 15: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Duality of importance and radiance

CG III (NPGR010) - J. Křivánek 2015

e

ie

,

,

LW

LWI

i

Emitted importance

Equilibrium incident radiance

Equilibrium incident importance

Emitted radiance

Page 16: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Duality of importance and radiance – proof

CG III (NPGR010) - J. Křivánek 2015

r stands for (x,)

Page 17: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Duality of importance and radiance

In a given scene, there is only one emitted and equilibrium radiance function

But each pixel has its own emitted and equilibrium visual importance function

CG III (NPGR010) - J. Křivánek 2015

Page 18: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Duality in practice: Light tracing

Path tracing recursively solves the rendering equation

Similarly, light tracing recursively solves the

importance transport equation

Light paths start at the light sources and are traced into the

scene using exactly the same rules as photons in photon mapping

They may either hit the sensor by chance (for a finite

aperture camera) or we can explicitly connect vertices to the sensor (as in explicit light source sampling in PT)

CG III (NPGR010) - J. Křivánek 2015

Page 19: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light tracing

CG III (NPGR010) - J. Křivánek 2015

Ima

ge

: D

utr

e e

t a

l. A

dv

an

ced

Glo

ba

l Il

lum

ina

tio

n

Page 20: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light tracing in practice

Generally less efficient than PT

But it certain case, it may be much better. One example

are caustics.

Light tracing and path tracing are the basis of bidirectional methods, such as

Bidirectional path tracing, BPT

Photon mapping, etc.

CG III (NPGR010) - J. Křivánek 2015

Page 21: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Comparison

CG III (NPGR010) - J. Křivánek 2015

© F. Suykens

Path tracing Light tracing Bidirectional path tracing

Q: Why is the glass sphere entirely black?

Page 22: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Advanced light transport simulation methods

Page 23: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Main issue in light transport simulation

Robustness

None of the existing algorithms works for all scenes

Robust estimation

“An estimation technique which is insensitive to small departures from the idealized assumptions which have been used to optimize the algorithm.”

CG III (NPGR010) - J. Křivánek 2015

Page 24: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Bidirectional path tracing (BPT) vs. (unidirectional) path tracing (PT)

BPT, 25 path per pixel PT, 56 path per pixel

Ima

ge

: E

ric

Ve

ach

CG III (NPGR010) - J. Křivánek 2015

Page 25: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral formulation of light transport

Light transport expressed as an integral over the space o light transport paths

Page 26: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light transport

Geometric optics

emit

travel

reflect

CG III (NPGR010) - J. Křivánek 2015

scatter

Page 27: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Light transport

Geometric optics

emit

travel

reflect

CG III (NPGR010) - J. Křivánek 2015

scatter

light transport path

Page 28: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Camera response

all paths hitting the sensor

Light transport

CG III (NPGR010) - J. Křivánek 2015

Page 29: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral formulation

[Veach and Guibas 1995] [Veach 1997]

CG III (NPGR010) - J. Křivánek 2015

Page 30: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement contribution function

sensor sensitivity (“emitted importance”)

path throughput

emitted radiance

CG III (NPGR010) - J. Křivánek 2015

Page 31: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Geometry term

CG III (NPGR010) - J. Křivánek 2015

Page 32: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral formulation

?

CG III (NPGR010) - J. Křivánek 2015

Page 33: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral formulation

all path lengths

all possible vertex positions

CG III (NPGR010) - J. Křivánek 2015

Page 34: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral

CG III (NPGR010) - J. Křivánek 2015

Page 35: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Rendering : Evaluating the path integral

Page 36: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path integral

Monte Carlo integration

CG III (NPGR010) - J. Křivánek 2015

Page 37: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Monte Carlo integration

General approach to numerical evaluation of integrals

x1

f(x)

0 1

p(x)

x2 x3 x4 x5 x6

Integral:

Monte Carlo estimate of I:

Correct „on average“:

CG III (NPGR010) - J. Křivánek 2015

Page 38: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

MC evaluation of the path integral

Sample path from some distribution with PDF

Evaluate the probability density

Evaluate the integrand

? ?

Path integral MC estimator

CG III (NPGR010) - J. Křivánek 2015

Page 39: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Algorithms = different path sampling techniques

Path sampling

CG III (NPGR010) - J. Křivánek 2015

Page 40: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Algorithms = different path sampling techniques

Path tracing

Path sampling

CG III (NPGR010) - J. Křivánek 2015

Page 41: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Algorithms = different path sampling techniques

Light tracing

Path sampling

CG III (NPGR010) - J. Křivánek 2015

Page 42: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Algorithms = different path sampling techniques

Same general form of estimator

Path sampling

CG III (NPGR010) - J. Křivánek 2015

Page 43: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Path sampling & Path PDF

Page 44: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Local path sampling

Sample one path vertex at a time

1. From an a priori distribution

lights, camera sensors

2. Sample direction from an existing vertex

3. Connect sub-paths

test visibility between vertices

CG III (NPGR010) - J. Křivánek 2015

Page 45: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Example – Path tracing

1. A priori distrib.

2. Direction sampling

3. Connect vertices

1.

2.

1.

3.

2.

2.

CG III (NPGR010) - J. Křivánek 2015

Page 46: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Use of local path sampling

Path tracing Light tracing Bidirectional path tracing

CG III (NPGR010) - J. Křivánek 2015

Page 47: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Probability density function (PDF)

path PDF

joint PDF of path vertices

CG III (NPGR010) - J. Křivánek 2015

Page 48: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Probability density function (PDF)

path PDF

joint PDF of path vertices

CG III (NPGR010) - J. Křivánek 2015

Page 49: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Probability density function (PDF)

path PDF

joint PDF of path vertices product of (conditional) vertex PDFs

Path tracing example:

CG III (NPGR010) - J. Křivánek 2015

Page 50: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Probability density function (PDF)

path PDF

joint PDF of path vertices product of (conditional) vertex PDFs

Path tracing example:

CG III (NPGR010) - J. Křivánek 2015

Page 51: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Vertex sampling

Importance sampling principle

1. Sample from an a priori distrib.

2. Sample direction from an existing vertex

3. Connect sub-paths

BRDF lobe sampling

emission sampling

high thruput connections

CG III (NPGR010) - J. Křivánek 2015

Page 52: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

BRDF lobe sampling

Vertex sampling

Sample direction from an existing vertex

CG III (NPGR010) - J. Křivánek 2015

Page 53: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measure conversion

BRDF lobe sampling

Sample direction from an existing vertex

CG III (NPGR010) - J. Křivánek 2015

Page 54: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Summary

Path integral MC estimator

CG III (NPGR010) - J. Křivánek 2015

Page 55: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Summary

Algorithms

different path sampling techniques

different path PDF

CG III (NPGR010) - J. Křivánek 2015

Page 56: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Why is the path integral view so useful?

Identify source of problems

High contribution paths sampled with low probability

Develop solutions

Advanced, global path sampling techniques

Combined path sampling techniques (MIS)

CG III (NPGR010) - J. Křivánek 2015

Page 57: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Derivation of the path integral from the rendering and measurement equations

Page 58: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

o

i'

Let’s eliminate all directions and only talk about path vertices (i.e. points in the scene)

We introduce notation:

Three-point formulation of light transport

),()( xxx LL

),()( oi xxxx rr ffCG III (NPGR010) - J. Křivánek 2015

Page 59: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Rendering equation in the 3-pt formulation

Let’s use the above notation to rewrite the RE

Mr dAGfL

LL

xxxxxxxx

xxxx

)()()(

)()( e

2

coscos)()(

xxxxxx

ioVG

o

i'

CG III (NPGR010) - J. Křivánek 2015

Page 60: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Measurement equation in the 3-pt formulation

Visual importance emitted from x’ to x (Notation: arrow = direction of the flow of light, not importance)

x’ ... on the sensor x … on the scene surface

MM

j AAGLWI xxxxxxxx dd)()()((j)e

CG III (NPGR010) - J. Křivánek 2015

Page 61: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Derivation of the path integral: A sketch

Plug the Neumann expansion of the RE into the measurement equation, you get a sum of integrals.

The integrand of this sum is the path contribution function.

CG III (NPGR010) - J. Křivánek 2015

Page 62: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

“Path integral” – A historical remark

This course [Veach and Guibas 1995], [Veach 1997]

Easily derived form the rendering equation [Veach 1997]

Feynman path integral formulation of quantum

mechanics [Feynman and Hibbs 65]

Homogeneous materials [Tessendorf 89, 91, 92]

Rendering [Premože et al. 03, 04]

CG III (NPGR010) - J. Křivánek 2015

Page 63: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Bidirectional path tracing

Page 64: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Bidirectional path tracing

Path tracing Light tracing Bidirectional

path sampling

CG III (NPGR010) - J. Křivánek 2015

Page 65: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

All possible bidirectional techniques

vertex on a light sub-path

vertex on en eye sub-path

path tracing

light tracing

CG III (NPGR010) - J. Křivánek 2015

Page 66: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

All possible bidirectional techniques

vertex on a light sub-path

vertex on en eye sub-path

path tracing

light tracing

VPLs

no single technique importance samples all the terms

CG III (NPGR010) - J. Křivánek 2015

Page 67: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Bidirectional path tracing

Use all of the above sampling techniques

Combine using Multiple Importance Sampling

Generalizes the combined strategy for calculating direct

illumination in a path tracer

PT: Different strategies for sampling a direction toward a light source

BPT: Different strategies for sampling entire light

transport paths

CG III (NPGR010) - J. Křivánek 2015

Page 68: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Naive BPT

CG III (NPGR010) - J. Křivánek 2015

Page 69: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

MIS weight calculation

CG III (NPGR010) - J. Křivánek 2015

Page 70: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Sampling techniques in BPT

Example: Four techniques for k = 2

Ima

ge

: E

ric

Ve

ach

CG III (NPGR010) - J. Křivánek 2015

Page 71: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Sampling techniques in BPT

Sub-path with t vertices sampled from the camera

Sub-path with s vertices sampled from the light sources

Connection segment of length 1

Total path length : k = s + t – 1 (number of segments)

In BPT, there are k+2 way to generate a path of length k

CG III (NPGR010) - J. Křivánek 2015

Page 72: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Sampling techniques in BPT

Each path sampling technique has a different probability density ps,t

Each techniques is efficient at sampling different kinds of lighting effects

All of them estimate the same integral

CG III (NPGR010) - J. Křivánek 2015

Page 73: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Combination of path sampling techniques

Combined estimator (MIS)

MIS weights (e.g. the balance heuristic)

CG III (NPGR010) - J. Křivánek 2015

Page 74: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

BPT implementation in practice

CG III (NPGR010) - J. Křivánek 2015

Page 75: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

BPT implementation in practice

CG III (NPGR010) - J. Křivánek 2015

Page 76: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

BPT implementation in practice

Sample a sub-path of a random length starting from light sources

Sample a sub-path of random length starting from the camera

Connect each prefix of a sub-path from light with

each suffix of a sub-path from the camera

CG III (NPGR010) - J. Křivánek 2015

Page 77: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Results

BPT, 25 samples per pixel PT, 56 samples per pixel

Ima

ge

s: E

ric

Ve

ach

CG III (NPGR010) - J. Křivánek 2015

Page 78: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

k = 2 (2x)

k = 3 (4x)

k = 4 (8x)

k = 5 (16x)

s = 1 s = 2 ... t = 1 t = 2

s / t = number of vertices on the sub-path from light / camera

Page 79: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Algorithm comparison again

CG III (NPGR010) - J. Křivánek 2015

© F. Suykens

Path tracing Light tracing Bidirectional path tracing

Page 80: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

LIMITATIONS OF LOCAL PATH SAMPLING

Page 81: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Insufficient path sampling techniques

Reference solution Bidirectional path tracing CG III (NPGR010) - J. Křivánek 2015

Page 82: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Insufficient path sampling techniques

Some paths sampled with zero (or very small) probability

CG III (NPGR010) - J. Křivánek 2015

diffuse – D

specular – S

Page 83: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Alternatives to local path sampling

Global path sampling – Metropolis light transport

Initial proposal still relies on local sampling

Leave path integral framework

Density estimation – photon mapping

Unify path integral framework and density estimation

Vertex Connection & Merging

CG III (NPGR010) - J. Křivánek 2015

Page 84: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Our work: Vertex Connection and Merging

Page 85: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Robust photon mapping

Where exactly on the camera sub-path should we look-up the photons?

Commonly solved via a heuristic:

Diffuse surface … make the look-up right away

Specular surface … continue tracing and make the look-up later

But what exactly should be classified as “diffuse” and

“specular”?

We need a more universal and robust solution

Solution:

Bidirectional photon mapping [Vorba 2011]

Vertex Connection and Merging [Georgiev et al., 2012]

CG III (NPGR010) - J. Křivánek 2015

Page 86: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Bidirectional path tracing (30 min) Bidirectional path tracing (30 min) CG III (NPGR010) - J. Křivánek 2015

Page 87: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Photon mapping (Density estimation) (30 min) Photon mapping (Density estimation) (30 min) CG III (NPGR010) - J. Křivánek 2015

Page 88: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Vertex connection and merging (30 min) Vertex connection and merging (30 min) CG III (NPGR010) - J. Křivánek 2015

Page 89: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Overview

Problem: different mathematical frameworks

BPT: Monte Carlo estimator of a path integral

PM: Density estimation

Key contribution: Reformulate photon mapping in

Veach’s path integral framework

1) Formalize as path sampling technique

2) Derive path probability density

Combination of BPT and PM into a robust algorithm

CG III (NPGR010) - J. Křivánek 2015

Page 90: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Sampling techniques

Unidirectional 2 ways

Vertex connection 4 ways

Vertex merging 5 ways

Total 11 ways

Light vertex

Camera vertex

Page 91: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Combining path sampling techniques for volumetric light transport

In the following we apply MIS to combine full path sampling techniques for calculating light transport in participating media.

The results come from the SIGGRAPH 2014: Křivánek et al. Unifying points, beams and paths in volumetric light transport simulation.

Page 92: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Full transport

rare, fwd-scattering fog

back-scattering

back-scattering high albedo

Page 93: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Medium transport only

Page 94: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Pr

ev

iou

s w

or

k c

om

pa

ris

on

, 1 h

r

Point-Point 3D (≈vol. ph. map.) Point-Beam 2D (=BRE)

Beam-Beam 1D (=photon beams) Bidirectional PT

Page 95: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

UPBP (our algorithm) 1 hour

95

Page 96: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Pr

ev

iou

s w

or

k c

om

pa

ris

on

, 1 h

r

Point-Point 3D Point-Beam 2D

Beam-Beam 1D Bidirectional PT

Page 97: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Point-Point 3D W

eig

hte

d c

on

trib

uti

on

s

Point-Beam 2D

Beam-Beam 1D Bidirectional PT

Page 98: Computer graphics III Bidirectional path tracingjaroslav/teaching/2017-npgr010/slides/10... · Let us define a scalar product of function f and g as: The Measurement equation can

Literature

E. Veach: Robust Monte Carlo methods for

light transport simulation, PhD thesis, Stanford

University, 1997, pp. 219-230, 297-317 http://www.graphics.stanford.edu/papers/veach_thesis/

CG III (NPGR010) - J. Křivánek 2015