<s>
Path-tracing	B-Algorithm
is	O
a	O
computer	O
graphics	O
Monte	B-Algorithm
Carlo	I-Algorithm
method	I-Algorithm
of	O
rendering	O
images	O
of	O
three-dimensional	O
scenes	O
such	O
that	O
the	O
global	B-Algorithm
illumination	I-Algorithm
is	O
faithful	O
to	O
reality	O
.	O
</s>
<s>
Fundamentally	O
,	O
the	O
algorithm	O
is	O
integrating	B-Algorithm
over	O
all	O
the	O
illuminance	O
arriving	O
to	O
a	O
single	O
point	O
on	O
the	O
surface	O
of	O
an	O
object	O
.	O
</s>
<s>
This	O
integration-procedure	O
is	O
repeated	O
for	O
every	O
pixel	B-Algorithm
in	O
the	O
output-image	O
.	O
</s>
<s>
When	O
combined	O
with	O
physically-accurate	O
models	O
of	O
surfaces	O
,	O
accurate	O
models	O
of	O
real	O
light-sources	O
,	O
and	O
optically-correct	O
cameras	O
,	O
path-tracing	B-Algorithm
can	O
produce	O
still	O
images	O
that	O
are	O
indistinguishable	O
from	O
photographs	O
.	O
</s>
<s>
Path-tracing	B-Algorithm
naturally	O
simulates	O
many	O
effects	O
that	O
have	O
to	O
be	O
specifically-added	O
to	O
other	O
methods	O
(	O
conventional	O
ray-tracing	B-Algorithm
or	O
scanline	B-Algorithm
rendering	I-Algorithm
)	O
,	O
such	O
as	O
soft	O
shadows	O
,	O
depth	O
of	O
field	O
,	O
motion	O
blur	O
,	O
caustics	O
,	O
ambient	O
occlusion	O
,	O
and	O
indirect	O
lighting	O
.	O
</s>
<s>
An	O
extended	O
version	O
of	O
the	O
algorithm	O
is	O
realized	O
by	O
volumetric	B-Algorithm
path	I-Algorithm
tracing	I-Algorithm
,	O
which	O
considers	O
the	O
light	O
scattering	O
of	O
a	O
scene	O
.	O
</s>
<s>
Due	O
to	O
its	O
accuracy	O
,	O
unbiased	B-Application
nature	O
,	O
and	O
algorithmic	O
simplicity	O
,	O
path	B-Algorithm
tracing	I-Algorithm
is	O
used	O
to	O
generate	O
reference	O
images	O
when	O
testing	O
the	O
quality	O
of	O
other	O
rendering	O
algorithms	O
.	O
</s>
<s>
However	O
,	O
the	O
path	B-Algorithm
tracing	I-Algorithm
algorithm	O
is	O
relatively	O
inefficient	O
:	O
A	O
very	O
large	O
number	O
of	O
rays	O
must	O
be	O
traced	O
to	O
get	O
high-quality	O
images	O
free	O
of	O
noise	B-Algorithm
artifacts	I-Algorithm
.	O
</s>
<s>
Several	O
variants	O
have	O
been	O
introduced	O
which	O
are	O
more	O
efficient	O
than	O
the	O
original	O
algorithm	O
for	O
many	O
scenes	O
,	O
including	O
bidirectional	B-Algorithm
path	I-Algorithm
tracing	I-Algorithm
,	O
volumetric	B-Algorithm
path	I-Algorithm
tracing	I-Algorithm
,	O
and	O
Metropolis	B-Algorithm
light	I-Algorithm
transport	I-Algorithm
.	O
</s>
<s>
Path	B-Algorithm
tracing	I-Algorithm
was	O
introduced	O
then	O
as	O
an	O
algorithm	O
to	O
find	O
a	O
numerical	B-Algorithm
solution	I-Algorithm
to	O
the	O
integral	O
of	O
the	O
rendering	O
equation	O
.	O
</s>
<s>
A	O
decade	O
later	O
,	O
Lafortune	O
suggested	O
many	O
refinements	O
,	O
including	O
bidirectional	B-Algorithm
path	I-Algorithm
tracing	I-Algorithm
.	O
</s>
<s>
Metropolis	B-Algorithm
light	I-Algorithm
transport	I-Algorithm
,	O
a	O
method	O
of	O
perturbing	O
previously	O
found	O
paths	O
in	O
order	O
to	O
increase	O
performance	O
for	O
difficult	O
scenes	O
,	O
was	O
introduced	O
in	O
1997	O
by	O
Eric	O
Veach	O
and	O
Leonidas	O
J	O
.	O
Guibas	O
.	O
</s>
<s>
More	O
recently	O
,	O
CPUs	B-Device
and	O
GPUs	B-Architecture
have	O
become	O
powerful	O
enough	O
to	O
render	O
images	O
more	O
quickly	O
,	O
causing	O
more	O
widespread	O
interest	O
in	O
path	B-Algorithm
tracing	I-Algorithm
algorithms	O
.	O
</s>
<s>
Tim	O
Purcell	O
first	O
presented	O
a	O
global	B-Algorithm
illumination	I-Algorithm
algorithm	I-Algorithm
running	O
on	O
a	O
GPU	B-Architecture
in	O
2002	O
.	O
</s>
<s>
In	O
February	O
2009	O
,	O
Austin	O
Robison	O
of	O
Nvidia	O
demonstrated	O
the	O
first	O
commercial	O
implementation	O
of	O
a	O
path	O
tracer	O
running	O
on	O
a	O
GPU	B-Architecture
,	O
and	O
other	O
implementations	O
have	O
followed	O
,	O
such	O
as	O
that	O
of	O
Vladimir	O
Koylazov	O
in	O
August	O
2009	O
.	O
</s>
<s>
This	O
was	O
aided	O
by	O
the	O
maturing	O
of	O
GPGPU	B-Architecture
programming	O
toolkits	O
such	O
as	O
CUDA	B-Architecture
and	O
OpenCL	B-Application
and	O
GPU	B-Architecture
ray	B-Algorithm
tracing	I-Algorithm
SDKs	O
such	O
as	O
OptiX	B-Algorithm
.	O
</s>
<s>
Path-tracing	B-Algorithm
has	O
played	O
an	O
important	O
role	O
in	O
the	O
film	O
industry	O
.	O
</s>
<s>
Earlier	O
films	O
had	O
relied	O
on	O
scanline	B-Algorithm
rendering	I-Algorithm
to	O
produce	O
CG	O
visual	O
effects	O
and	O
animation	O
.	O
</s>
<s>
In	O
1998	O
,	O
Blue	O
Sky	O
Studios	O
rendered	O
the	O
Academy	O
Award-winning	O
short	O
film	O
Bunny	O
with	O
their	O
proprietary	O
CGI	O
Studio	O
path	B-Algorithm
tracing	I-Algorithm
renderer	O
,	O
featuring	O
soft	O
shadows	O
and	O
indirect	B-Algorithm
illumination	I-Algorithm
effects	O
.	O
</s>
<s>
Sony	O
Pictures	O
Imageworks	O
 '	O
Monster	O
House	O
was	O
,	O
in	O
2006	O
,	O
the	O
first	O
animated	O
feature	O
film	O
to	O
be	O
rendered	O
entirely	O
in	O
a	O
path	O
tracer	O
,	O
using	O
the	O
commercial	O
Arnold	B-Application
renderer	I-Application
.	O
</s>
<s>
Pixar	O
Animation	O
Studios	O
has	O
also	O
adopted	O
path	B-Algorithm
tracing	I-Algorithm
for	O
its	O
commercial	O
RenderMan	B-Application
renderer	O
.	O
</s>
<s>
Kajiya	O
's	O
rendering	O
equation	O
adheres	O
to	O
three	O
particular	O
principles	O
of	O
optics	O
;	O
the	O
Principle	O
of	O
Global	B-Algorithm
Illumination	I-Algorithm
,	O
the	O
Principle	O
of	O
Equivalence	O
(	O
reflected	O
light	O
is	O
equivalent	O
to	O
emitted	O
light	O
)	O
,	O
and	O
the	O
Principle	O
of	O
Direction	O
(	O
reflected	O
light	O
and	O
scattered	O
light	O
have	O
a	O
direction	O
)	O
.	O
</s>
<s>
Kajiya	O
's	O
equation	O
is	O
a	O
complete	O
summary	O
of	O
these	O
three	O
principles	O
,	O
and	O
path	B-Algorithm
tracing	I-Algorithm
,	O
which	O
approximates	O
a	O
solution	O
to	O
the	O
equation	O
,	O
remains	O
faithful	O
to	O
them	O
in	O
its	O
implementation	O
.	O
</s>
<s>
Path	B-Algorithm
tracing	I-Algorithm
is	O
confounded	O
by	O
optical	O
phenomena	O
not	O
contained	O
in	O
the	O
three	O
principles	O
.	O
</s>
<s>
Bright	O
,	O
sharp	O
caustics	O
;	O
radiance	B-Application
scales	O
by	O
the	O
density	O
of	O
illuminance	O
in	O
space	O
.	O
</s>
<s>
Subsurface	B-Algorithm
scattering	I-Algorithm
;	O
a	O
violation	O
of	O
Principle	O
III	O
above	O
.	O
</s>
<s>
The	O
following	O
pseudocode	B-Language
is	O
a	O
procedure	O
for	O
performing	O
naive	O
path	B-Algorithm
tracing	I-Algorithm
.	O
</s>
<s>
The	O
TracePath	O
function	O
calculates	O
a	O
single	O
sample	O
of	O
a	O
pixel	B-Algorithm
,	O
where	O
only	O
the	O
Gathering	O
Path	O
is	O
considered	O
.	O
</s>
<s>
For	O
instance	O
,	O
a	O
perfectly	O
specular	O
(	O
mirror	O
)	O
material	O
would	O
not	O
work	O
with	O
the	O
method	O
above	O
,	O
as	O
the	O
probability	O
of	O
the	O
new	O
ray	O
being	O
the	O
correct	O
reflected	O
ray	O
–	O
which	O
is	O
the	O
only	O
ray	O
through	O
which	O
any	O
radiance	B-Application
will	O
be	O
reflected	O
–	O
is	O
zero	O
.	O
</s>
<s>
In	O
these	O
situations	O
,	O
one	O
must	O
divide	O
the	O
reflectance	O
by	O
the	O
probability	O
density	O
function	O
of	O
the	O
sampling	O
scheme	O
,	O
as	O
per	O
Monte	B-Algorithm
Carlo	I-Algorithm
integration	I-Algorithm
(	O
in	O
the	O
naive	O
case	O
above	O
,	O
there	O
is	O
no	O
particular	O
sampling	O
scheme	O
,	O
so	O
the	O
PDF	O
turns	O
out	O
to	O
be	O
1	O
)	O
.	O
</s>
<s>
Backwards	O
path	B-Algorithm
tracing	I-Algorithm
,	O
where	O
paths	O
are	O
generated	O
starting	O
from	O
the	O
camera	O
and	O
bouncing	O
around	O
the	O
scene	O
until	O
they	O
encounter	O
a	O
light	O
source	O
.	O
</s>
<s>
Light	O
tracing	O
(	O
or	O
forwards	O
path	B-Algorithm
tracing	I-Algorithm
)	O
,	O
where	O
paths	O
are	O
generated	O
starting	O
from	O
the	O
light	O
sources	O
and	O
bouncing	O
around	O
the	O
scene	O
until	O
they	O
encounter	O
the	O
camera	O
.	O
</s>
<s>
This	O
works	O
by	O
directly	O
sampling	O
an	O
important	O
feature	O
(	O
the	O
camera	O
in	O
the	O
case	O
of	O
light	O
tracing	O
,	O
or	O
a	O
light	O
source	O
in	O
the	O
case	O
of	O
backwards	O
path	B-Algorithm
tracing	I-Algorithm
)	O
instead	O
of	O
waiting	O
for	O
a	O
path	O
to	O
hit	O
it	O
by	O
chance	O
.	O
</s>
<s>
For	O
backwards	O
path	B-Algorithm
tracing	I-Algorithm
,	O
this	O
creates	O
high	O
variance	O
for	O
caustic	O
paths	O
that	O
interact	O
with	O
a	O
diffuse	O
surface	O
,	O
then	O
bounce	O
off	O
a	O
specular	O
surface	O
before	O
hitting	O
a	O
light	O
source	O
.	O
</s>
<s>
Because	O
this	O
situation	O
is	O
significantly	O
more	O
common	O
,	O
and	O
noisy	O
(	O
or	O
completely	O
black	O
)	O
glass	O
objects	O
are	O
very	O
visually	O
disruptive	O
,	O
backwards	O
path	B-Algorithm
tracing	I-Algorithm
is	O
the	O
only	O
method	O
that	O
is	O
used	O
for	O
unidirectional	O
path	B-Algorithm
tracing	I-Algorithm
in	O
practice	O
.	O
</s>
<s>
Bidirectional	B-Algorithm
path	I-Algorithm
tracing	I-Algorithm
provides	O
an	O
algorithm	O
that	O
combines	O
the	O
two	O
approaches	O
and	O
can	O
produce	O
lower	O
variance	O
than	O
either	O
method	O
alone	O
.	O
</s>
<s>
The	O
original	O
light	O
tracing	O
and	O
backwards	O
path	B-Algorithm
tracing	I-Algorithm
algorithms	O
are	O
both	O
special	O
cases	O
of	O
these	O
strategies	O
.	O
</s>
<s>
For	O
backwards	O
path	B-Algorithm
tracing	I-Algorithm
,	O
it	O
is	O
connecting	O
the	O
vertices	O
of	O
the	O
light	O
path	O
to	O
the	O
first	O
vertex	O
of	O
the	O
camera	O
path	O
.	O
</s>
<s>
Weighting	O
all	O
of	O
these	O
sampling	O
strategies	O
using	O
multiple	O
importance	O
sampling	O
creates	O
a	O
new	O
sampler	O
that	O
can	O
converge	O
faster	O
than	O
unidirectional	O
path	B-Algorithm
tracing	I-Algorithm
,	O
even	O
though	O
more	O
work	O
is	O
required	O
for	O
each	O
sample	O
.	O
</s>
<s>
A	O
path	O
tracer	O
continuously	O
samples	O
pixels	B-Algorithm
of	O
an	O
image	O
.	O
</s>
<s>
The	O
image	O
starts	O
to	O
become	O
recognizable	O
after	O
only	O
a	O
few	O
samples	O
per	O
pixel	B-Algorithm
,	O
perhaps	O
100	O
.	O
</s>
<s>
The	O
central	O
performance	O
bottleneck	O
in	O
path	B-Algorithm
tracing	I-Algorithm
is	O
the	O
complex	O
geometrical	O
calculation	O
of	O
casting	O
a	O
ray	O
.	O
</s>
<s>
Metropolis	B-Algorithm
light	I-Algorithm
transport	I-Algorithm
can	O
result	O
in	O
a	O
lower-noise	O
image	O
with	O
fewer	O
samples	O
.	O
</s>
