Beruflich Dokumente
Kultur Dokumente
advantages
predictive simulation
can be used for architecture, engineering,
photorealistic
if simulation if correct, images will look real
disadvantages
(really) slow
simulation of physics is computationally very expensive
need accurate geometry, materials and lights
otherwise just a correct solution to the wrong problem
L(x ) Le (x )
L(x ) (x, ) cos d
x
[Bala]
x x
L(x ) Le (x ) L( x )
computer graphics path tracing 2010 fabio pellacini, william kerr 4
basic path tracing
look up emission
[Bala]
Le (x )
need to evaluate
Lr (x ) L(x ) (x, ) cos(N x , )d
x
evaluate BRDF
evaluate cosine
evaluate L(x i )
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 7
basic path tracing
need to evaluate
L(x i )
determine visible point from x in direction i
r (x i )
in vacuum
L(x i ) L(r (x, i ) i )
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 8
basic path tracing
need to evaluate
L(r (x, i ) i )
recursively execute procedure
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 9
russian roulette
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 10
russian roulette
P f ( y / P)
I RR dy
f ( y / P)
yP
y ~1 f ( y) P
0 yP
1 P f ( y / P)
E[ f ( y )] f ( y ) p( y )dy dy I
0 0 P
1 N f ( xi )
E[ f ( x)] [ f ] [ f ]
N i1 p( xi )
reminder:
2 [ x] E[ x 2 ] E[ x]2
computer graphics path tracing 2010 fabio pellacini, william kerr 13
russian roulette
computeRadiance(x, theta)
estimatedRadiance = basicPT(x, theta)
return estimatedRadiance
computer graphics path tracing 2010 fabio pellacini, william kerr 16
basic path tracing pseudocode
basicPT(x, theta)
estimatedRadiance = Le(x, theta)
if(not absorbed) // russian roulette
for s = 1 to #radianceSamples
psi = generate random dir on hemisphere
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 20
monte carlo vs. deterministic integration
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 21
next event estimation
L(x ) Le (x )
L(x ) (x, ) cos d
x
[Bala]
x x
L(x ) Le (x ) L( x )
computer graphics path tracing 2010 fabio pellacini, william kerr 23
direct and indirect illum. formulation
L(x ) Le (x ) Lr (x )
[Bala]
L( x ) Le (x ) Lr (x )
Lr (x ) Le (x ) (...) cos d
x
Lr (x ) (...) cos d
x
Ld (x ) Li (x )
Ld (x ) Le (x ) (...) cos d
x
Li (x ) Lr (x ) (...) cos d
x
discard Le
if ray hits light
Li (x ) Lr (x ) (...) cos d
x
without with
[Bala]
16 samples
1 sample 4 samples
[Bala]
16 samples 256 samples
depends on
emitted radiance distribution Le
how to pick points y on the light
how many points to use
number of shadow rays
1
p(y )
AS
simply sample that [0,1] square and rescale
works fairly well in practice
slightly better techniques exists tough
Li (x ) Lr (x ) (...) cos d
x
1 N Lr (x ) (...) cos
Li (x )
N i 1 p( )
depends on how to sample the hemisphere
uniform distribution
importance sampling: pick p to match integral
cosine distribution
BRDF distribution
BRDF*cosine distribution
1
p( )
2
2 N
Ld (x )
N i1
Lr (x ) (...) cos
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 39
indirect illumination cosine dist.
cos
p( )
N
Ld (x )
N
L (x ) (...)
i 1
r
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 40
indirect illumination BRDF Dist.
p() ~ (...)
1 N
Ld (x ) Lr (x ) cos
N i 1
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 41
indirect illumination BRDF*Cosine Dist.
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 42
importance sampling performance
without with
[Bala]
computer graphics path tracing 2010 fabio pellacini, william kerr 43
pt pseudocode pixel sampling
computeImage()
foreach pixel (i,j)
estimatedRadiance[i,j] = 0
for s = 1 to #viewSamples
generate Q in pixel (i,j)
theta = (Q E)/|Q-E|
idea: shoot paths from the eye and from the light
eye paths: work well for reflections
light paths: pick up secondary sources
in reality very complex
computer graphics path tracing 2010 fabio pellacini, william kerr 50
bidirectional path tracing