radiative transfer & volume path...

44
Radiative Transfer & Volume Path Tracing CS295, Spring 2017 Shuang Zhao Computer Science Department University of California, Irvine CS295, Spring 2017 Shuang Zhao 1

Upload: others

Post on 24-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer &Volume Path Tracing

CS295, Spring 2017

Shuang Zhao

Computer Science Department

University of California, Irvine

CS295, Spring 2017 Shuang Zhao 1

Page 2: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Last Lecture

• Refraction & BSDFs• How light interacts with refractive interfaces (e.g.,

glass)

CS295, Spring 2017 Shuang Zhao 2

Page 3: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Today’s Lecture

• Radiative transfer• The mathematical model to simulate light scattering

in participating media (e.g., smoke) and translucent materials (e.g., marble and skin)

• Volume path tracing (VPT)• A Monte Carlo solution to the radiative transfer

problem

• Similar to the normal PT from previous lectures

CS295, Spring 2017 Shuang Zhao 3

Page 4: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer

CS295: Realistic Image Synthesis

CS295, Spring 2017 Shuang Zhao 4

Page 5: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Participating Media

CS295, Spring 2017 Shuang Zhao 5

[Kutz et al. 2017]

Page 6: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Translucent Materials

CS295, Spring 2017 Shuang Zhao 6

[Gkioulekas et al. 2013]

Page 7: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Subsurface Scattering

• Light enters a material and scatters around before eventually leaving or absorbed

CS295, Spring 2017 Shuang Zhao 7

X Absorbed

Participating medium

Page 8: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Subsurface Scattering

• Light enters a material and scatters around before eventually leaving or absorbed

CS295, Spring 2017 Shuang Zhao 8

Scattered

Participating medium

Page 9: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Subsurface Scattering

• Light enters a material and scatters around before eventually leaving or absorbed

CS295, Spring 2017 Shuang Zhao 9

Participating medium

Page 10: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer

• A mathematical model describing how light interacts with participating media

• Originated in physics

• Now used in many areas• Astrophysics (light transport in space)

• Biomedicine (light transport in human tissue)

• Graphics

• Nuclear science & engineering (neutron transport)

• Remote sensing

• …

CS295, Spring 2017 Shuang Zhao 10

Page 11: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer Equation (RTE)

CS295, Spring 2017 Shuang Zhao 11

In-scattering Out-scattering

& absorption

EmissionDifferential

radiance

In-scattering Out-scattering

& absorption

Emission

Page 12: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer Equation (RTE)

• The RTE is a first-order integro-differential equation

• For a participating medium in a volume with boundary , the RTE governs the radiance values inside this volume (i.e., for all )

• The boundary condition is the radiance field on the boundary (i.e., L(x, ω) for all )

CS295, Spring 2017 Shuang Zhao 12

In-scattering Out-scattering

& absorption

Emission

Page 13: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer Equation (RTE)

• Differential radiance

• Scattering coefficient: ,Phase function: , a probability density over given x and ωi

• Extinction coefficient:

• Source term:

CS295, Spring 2017 Shuang Zhao 13

In-scattering Out-scattering

& absorption

Emission

Page 14: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer Equation (RTE)

• σt controls how frequently light scatters and is also known as the optical density

• The ratio between σs and σt controls the fraction of radiant energy not being absorbed at each scattering

and is also known as the single-scattering albedo

CS295, Spring 2017 Shuang Zhao 14

In-scattering Out-scattering

& absorption

Emission

Page 15: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Radiative Transfer Equation (RTE)

• The phase function fp is usually parameterized as a function on the angle between ωi and ω. Namely,

• Example: the Henyey-Greenstein (HG) phase function with parameter -1 < g < 1:

CS295, Spring 2017 Shuang Zhao 15

In-scattering Out-scattering

& absorption

Emission

Page 16: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

The Integral Form of the RTE

• It is desirable to rewrite the RTE as an integral equation• which can then be solved numerically using Monte Carlo

methods

CS295, Spring 2017 Shuang Zhao 16

Integro-differential equation

Integral equation

Page 17: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Integral Form of the RTE

• For any , let h(x, ω) denotes the minimal distance for the ray (x, -ω) to hit the boundary . In other words,

• When (x, -ω) never hits the boundary,• This can happen when the volume is infinite

• For any with , let

CS295, Spring 2017 Shuang Zhao 17

Page 18: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Integral Form of the RTE

• For any , the attenuation between x and y is

• A line integral between x and y

• for all x and y

• For homogeneous media with ,

CS295, Spring 2017 Shuang Zhao 18

Page 19: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Integral Form of the RTE

CS295, Spring 2017 Shuang Zhao 19

In-scattering EmissionAttenuation

Attenuation Boundary cond.

(The second term vanishes when )

where

Page 20: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Kernel Form of the RTE

CS295, Spring 2017 Shuang Zhao 20

whereKernel function Source function

Page 21: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Operator Form of the RTE

• Phase space:

• For any real-valued function g on Γ, define operator K as

where

• Then, the RTE becomes

• Similar to the RE!

• Yield Neumann series

CS295, Spring 2017 Shuang Zhao 21

Page 22: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Volume Path Tracing

CS295: Realistic Image Synthesis

CS295, Spring 2017 Shuang Zhao 22

Page 23: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Solving the RTE

• Given the similarity between the RTE and the RE, Monte Carlo solutions to the RE can be adapted to solve the RTE

• Volume path tracing

• Volume adjoint particle tracing

• Volume bidirectional path tracing

• …

CS295, Spring 2017 Shuang Zhao 23

Page 24: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Volume Path Tracing

• Basic idea• Draw from

• Draw ωi from p(ωi)

• Evaluate L(r, ωi) recursively

CS295, Spring 2017 Shuang Zhao 24

Known

where

Page 25: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling

• is called the “free distance” and is sampled from

where

with λ0 being an arbitrary positive number

• p gives an exponential distribution with varying parameters

CS295, Spring 2017 Shuang Zhao 25

Page 26: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling

• For all , it holds that

CS295, Spring 2017 Shuang Zhao 26

Page 27: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling

CS295, Spring 2017 Shuang Zhao 27

where

Page 28: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling

• By applying Monte Carlo integration, we have

• Pseudocode:

• Draw from p

• If , return

• Otherwise, return

CS295, Spring 2017 Shuang Zhao 28

Page 29: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Direction Sampling

• One extra integral remains:

• ωi can be sampled based on • In practice, is usually a valid

probability density on ωi, yielding

CS295, Spring 2017 Shuang Zhao 29

Page 30: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Volume Path Tracing

radiance(x, ω):

compute h = h(x, ω) # using ray tracing

draw τ

if τ < h:

r = x – τ*ω

draw ωi

return σs(r)/σt(r)*radiance(r, ωi) + Q(r, ω)/σt(r)

else:

return boundaryRadiance(x – h*ω, ω)

CS295, Spring 2017 Shuang Zhao 30

How to implement this?

Page 31: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling Methods

• How to draw samples from this distribution?

• Homogeneous media•

• Let , then and

• In this case, can be drawn using the inversion method:

CS295, Spring 2017 Shuang Zhao 31

Page 32: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Free Distance Sampling Methods

• Heterogeneous media• varies with x, causing to vary with

• p does not have a close-form expression in general

• Common sampling methods• Ray marching

• Delta tracking

CS295, Spring 2017 Shuang Zhao 32

Page 33: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Ray Marching

• One can apply the inversion method by1. Drawing ξ from U(0, 1)

2. Finding satisfying• This is usually achieved numerically by iteratively

increasing with some fixed step size untilreaches ξ

• The step size is generally picked according to the underlying representation of σt(x) (e.g., voxel size)

CS295, Spring 2017 Shuang Zhao 33

Page 34: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Ray Marching

• Pros• For each sample , can be obtained easily

• Cons• Biased (for any finite step size )

• Resolution dependent• needs to be picked based on the resolution of the

density (σt) field

• Slow for high-resolution density fields

CS295, Spring 2017 Shuang Zhao 34

Page 35: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Delta Tracking

• Also known as Woodcock tracking

• Basic idea• Consider the medium to have homogeneous density

, and use it to draw free distances

• To compensate the fact that “phantom” densities have been introduced, the sampling process continues with probability

at each ri

CS295, Spring 2017 Shuang Zhao 35

Page 36: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Delta Tracking

• Pseudocode:

deltaTracking(x, ω, σtmax)

compute h using ray tracing

τ = 0

while τ < h:

τ += -log(rand())/σtmax

r = x - τ*ω

if rand() < σt(r)/σtmax:

break

return τ

CS295, Spring 2017 Shuang Zhao 36

Page 37: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Delta Tracking

• Pros• Unbiased

• Resolution independent

• Cons• For each sample , is not immediately

available

• Slow for density fields with widely varying σt values (i.e., σt

max >> σt(x) for many x)

CS295, Spring 2017 Shuang Zhao 37

Page 38: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Volume Path Tracing (VPT)

radiance(x, ω):

compute h = h(x, ω)

draw τ

if τ < h:

r = x – τ*ω

draw ωi

return σs(r)/σt(r)*radiance(r, ωi) + Q(r, ω)/σt(r)

else:

return boundaryRadiance(x – h*ω, ω)

CS295, Spring 2017 Shuang Zhao 38

This basic version can be improved

using techniques we have seen earlier:

• Russian roulette

• Next-event estimation

• Multiple importance sampling

Page 39: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

VPT with Next-Event Estimation

• The RTE implies that . Namely,

• By drawing from the aforementioned exponential distribution, we have

CS295, Spring 2017 Shuang Zhao 39

where

Page 40: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

VPT with Next-Event Estimation

• The remaining integral is then split into two:

CS295, Spring 2017 Shuang Zhao 40

Estimate recursively by

drawing ωi based on fp“indirect illumination”

Estimate directly by

area sampling or MIS

“direct illumination”

Page 41: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

VPT with Next-Event Estimation

• Pseudocode:scatteredRadiance(x, ω):

compute h = h(x, ω) # using ray tracing

draw τ

if τ < h:

r = x – τ*ω

rad = directIllumination(r, ω)

draw ωirad += scatteredRadiance(r, ωi)

return σs(r)/σt(r)*rad

else:

return 0

CS295, Spring 2017 Shuang Zhao 41

Page 42: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Direct Illumination for VPT

• Recall that

• For non-emissive materials, Q vanishes and

• In this case,

• The area integral can be further restricted to the subset of where the boundary radiance is non-zero

CS295, Spring 2017 Shuang Zhao 42

Change of measure

Boundary

radiance

Page 43: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Direct Illumination for VPT

• Phase function sampling:

• Area sampling:

• The two strategies can be combined using MIS

CS295, Spring 2017 Shuang Zhao 43

Draw ωi based on fp

Draw y from

Page 44: Radiative Transfer & Volume Path Tracingshz/courses/cs295/slides/15_radiative_transfer.pdfRadiative Transfer Equation (RTE) •The RTE is a first-order integro-differential equation

Next Lecture

• Metropolis light transport (MLT)• Applying the Metropolis-Hasting algorithm to

rendering

CS295, Spring 2017 Shuang Zhao 44