Sei sulla pagina 1di 4

~ ComputerGraphics,Volume24, Number4, August1990

Particle Transport and Image Synthesis


James Arvo*
David Kirk*~
*Apollo Systems Division of Hewlett-Packard
300 Apollo Drive
Chelmsford, MA 01824
*t California Institute of Technology
Computer Science 256-80
Pasadena, CA 91125

Abstract been applied to integral equations of essentially the same


form as the rendering equation since the 50's [1].
T h e rendering equation is similar to the linear B o l t z m a n n Kajiya demonstrated the feasibility of this approach in
equation which has been widely s t u d i e d in physics a n d nu- image synthesis by successfully solving the rendering equa-
clear engineering. Consequently, m a n y of the powerful tech- tion for scenes including both specular and diffuse reflectors.
niques which have been d e v e l o p e d in these fields can be Though the level of realism attainable in this way is very
a p p l i e d to p r o b l e m s in image synthesis. I n this p a p e r we high, the cost can be prohibitive due to slow convergence of
a d a p t several s t a t i s t i c a l techniques c o m m o n l y used in neu- the Monte Carlo method. Other more efficient approaches
t r o n t r a n s p o r t to stochastic r a y tracing and, m o r e generally, have been devised [16,17] but none have completely obvi-
to Monte Carlo solution of t h e r e n d e r i n g equation. F i r s t , we ated the need for stochastic approximation without sacrific-
describe a technique k n o w n as Russian roulette which can ing certain modes of light transport.
b e used to t e r m i n a t e t h e recursive tracing of rays w i t h o u t Related statistical approaches have been applied to ray
i n t r o d u c i n g s t a t i s t i c a l bias. We also examine the practice tracing. Cook, et al. [4] described a stochastic sampling
of creating r a y trees in classical r a y t r a c i n g in the light of a technique termed distributedray tracing which provides a
well-known technique in particle transport known as split- means of anti-aliasing as well as simulating effects such as
ting. We show t h a t n e i t h e r r a y trees nor p a t h s as described motion blur, penumbrae, depth of field, and fuzzy reflec-
in [10] c o n s t i t u t e an o p t i m a l s a m p l i n g p l a n in themselves tions. Its central idea is that features in the environment
a n d t h a t a h y b r i d m a y b e m o r e efficient. which vary in time and space can be sampled stochastically
to estimate their contribution to the final image. Both of
C R Categories and Subject Descriptors: 1 . 3 . 7 - these paradigms have a great deal in c o m m o n with Monte
[Computer G r a p h i c s ] : T h r e e - D i m e n s i o n a l G r a p h i c s a n d Carlo techniques applied to particle transport problems in
Realism; 1 . 3 . 3 - - [ C o m p u t e r G r a p h i c s ] : Picture/Image
other fields.
Generation;
General Terms: A l g o r i t h m s , G r a p h i c s
Additional K e y Words and Phrases~ B o I t z m a n n equa- 2 Particle Transport
tion, M o n t e Carlo, p a r t i c l e t r a n s p o r t , radiosity, r a y tracing,
rendering equation. T h e class of particle transport problems consists of those
p r o b l e m s which seek to characterize t h e d i s t r i b u t i o n of ide-
alized p a r t i c l e s t a k i u g account of their m o t i o n a n d inter-
1 Introduction action w i t h a m e d i u m [5,12,19]. Such p r o b l e m s a p p e a r in
nuclear engineering as n e u t r o n t r a n s p o r t [15], in h e a t trans-
The rendering equation [10] provides a framework in which fer as photon transport [13], and in semiconductor device
aLl current image synthesis techniques can be be viewed as simulation as carrier transport [6]. M a n y of the equations
m e t h o d s of a p p r o x i m a t i o n . B o t h r a d i o s i t y [7] a n d r a y trac- governing these transport processes ultimately derive from
ing [18] are examples of a p p r o x i m a t i o n because t h e y neglect the Boltzmann equation which arose from the kinetic theory
various optical p h e n o m e n a in order to yield a reasonable of gases. I n its simplest form t h e linear B o l t z m a n n e q u a t i o n
m e t h o d of solution. A n a l t e r n a t i v e , i n t r o d u c e d b y K a j i y a ,
can be w r i t t e n as
is to solve the rendering e q u a t i o n directly via M o n t e Carlo
techniques similar to those developed for n e u t r o n t r a n s p o r t
problems. Such techniques have a long h i s t o r y a n d have • (P) = S(P) + f K(P' --~P) q,(P') de' (I)
Jfl
where P represents p a r t i c l e position, direction, a n d energy,
and ~(P) is the density of radiation at P due to emission
from the source S as well as contributions scattered into
Pelmission to copy without fee all or part of this material is granted P from all P' [11]. The function K is known as the scat-
provided that the copies are not made or distributed for direct teeing kernel, and the domain of integration, ~, consists of
commercial advantage, the ACM cop)right notice and the title of the
publication and its date appear, and notice is given that copying is by
permission of the Association for Computing Machinery. To copy
otherwise, or to republish, requires a fee and/or specific permission.

©1990 ACM-0-89791-344-2/90/008/0063 $00.75 63


O SIGGRAPH '90, Dallas, August 6-10, 1990
i

all positions, directions~ and energies. This is a notoriously the behavior of large numbers of particles obeying the pre-
difficult equation to solve analytically in all but the most scribed laws of motion expressed as scattering probabilities.
trivial problem instances [2,5]. This is true of the rendering Each particle undergoes a sequence of collisions or scatter-
equation as well which is essentially a variant of the linear ing events which probabilistically alter its trajectory at each
Boltzmaun equation. The principal difference is t h a t the collision-site and contribute to the history of the particle.
scattering kernel is rephrased as a geometry term, g~ which Each particle history, or random walk, is used as a statistical
accounts for occlusion and inverse square attenuation, and estimator of average case behavior. R a y tracing is a mecha-
a trivariate scattering term, p, whose arguments are sur- nism for computing points of collision, and a stochastic ray
face points (See [10]). The latter encodes the directions of p a t h [10] is the resulting r a n d o m walk of a particle. The
incidence and reflection implicitly through the positions of rendering equation provides a link which allows us to view
the source and destination elements relative to the point of image synthesis in terms of particle transport. T h r o u g h this
reflection. The similarity of the rendering equation to the connection we can gain useful insight into the features and
linear Boltzmann equation suggests that m a n y of the power- limitations of image synthesis techniques.
ful techniques which have been developed for other particle For example, consider the use of decoupled passes of ray
transport problems may be applied to problems in image tracing and radiosity to model specular and diffuse modes
synthesis. of transport independently. It has been observed that sim-
We note t h a t there are several aspects in which the ren- ply combining the results of these passes fails to account
dering equation is somewhat more tractable t h a n the trans- for some important phenomena of geometrical optics [16].
port equations in fields such as nuclear engineering. The most obvious example is a caustic formed by specularly
transmitted or reflected light falling on a diffuse surface.
1) The particles (i.e. photons) do not influence one another, B o t h classical ray tracing and radiosity totally neglect this
alter the environment, carry a charge, or replicate via mode o£ transport, therefore this deficiency cannot be reme-
fission. Thus scattering is independent of • as well as died by summing their contributions a posteriori. Wallace
external forces, making the equation linear. describes a solution for this particular case of specular-to-
diffuse transport, but it is impossible to account for all such
2) In the absence of participating media, collisions occur
sequences of transport as special cases. This phenomenon
only at surfaces. The particles therefore have a rela-
has been observed in other linear transport problems and
tively large mean free path.
is attributed to the fact t h a t equation 1, t h o u g h linear in
3) We seek only the steady state solution, not transient the source term, S, is nonlinear with respect to the scat-
distributions on the way to equilibrium. tering kernel, K . While the linearity in S allows us to sum
the independent contributions made by different sources and
These properties manifest themselves largely in the rela- wavelengths of light, the analogous decoupling fails when the
tively simple form of the scattering kernel which is com- kernel is partitioned into, for example, Kspec+Kdiff. A faith-
prised of the bidirectional reflectance functions associated fnl simulation of all modes of transport can only be achieved
with the surfaces. After probabilistically determining a new by coupling t h e m in the solution process.
particle direction at each scattering event the next col].ision-
site along the r a n d o m walk is completely determined, elim- 3 Russian Roulette
inating stochastic distance calculations. However, there are
two respects in which this transport process is made more The albedo of a surface is the probability that an incident
d i ~ c u l t t h a n typically encountered in other disciplines. particle will be re-radiated after collision [3]. In Monte Carlo
First, the geometry of the simulated environments can simulations this probability is normally used to adjust a nu-
be arbitrarily complex. While simulations of reactor cores merical weight associated with the particle rather t h a n prob-
and semiconductor devices benefit from fairly constrained abilistically terminating the history. This technique, termed
geometries and exploit special properties of lattices, cylin- implicit capture [12], has better statistical properties owing
ders, slabs, etc. [12], the trend in computer graphics is to to longer particle histories.
move toward greater and greater scene complexity. This A p r o p e r t y of implicit capture is t h a t particle histories
is exemplified by recent work involving billions of geomet- can only terminate at surfaces of zero albedo or by leakage,
rical primitives [14]. This can be further complicated by t h a t is, by escaping the system. However, it is nearly always
time-dependent scene geometry. Simulation of the resulting impractical to continue tracing a p a t h until one of these
m o t i o n blur requires time averaging steady-state solutions conditions is met. Even if we could guarantee the eventual
at intermediate scene configurations. termination of every history, we would spend an inordinate
Secondly, the problem of interest in image synthesis is to amount of time computing collisions involving particles of
compute the intensity of illumination impinging on a single negligible weight. One solution is to place a limit on the
point, the "eye", through small apertures which correspond number of scattering events in a particle history and to ig-
to "pixels". Analogous situations occur in reactor shield- nore all contributions beyond this point. A better solution
ing problems which simulate point radiation detectors [3]. is to use weight cuto~ which truncates the particle's history
These are inherently more diiBcnlt to solve than the typical only when its weight falls below some threshold [12]. The
problems which involve flux averages over volumes. idea of using weight cutoff to terminate ray tracing recursion
M a n y important problems in particle transport do not was introduced by Hall [8] and termed adaptive tree depth
admit analytic solutions and are also prohibitively expensive control. B o t h of these techniques are commonly employed
to solve via numerical integration due to the high dimension in ray tracing implementations in order to avoid excessively
of the phase space in which they operate (e.g. three spa- deep ray trees and, in extreme cases, even unending recur-
tial dimensions, two directional dimensions, and an energy sion due to opposing mirrors or total internal reflection. The
dimension). The only recourse for solving these types of difficulty with this type of policy is that truncation intro-
problems appears to be Monte Carlo methods which track

64
~ ComputerGraphics,Volume24, Number4, August 1990

particles is costly, it is justified if the variaucc is reduced


sufficiently. Because it is used strictly as a variance reduc-
if w e i g h t < T h r e s h t h e n tion technique and not as a means of simulating fission, it is
begin applicable to photon transport as well.
sample s uniformly from [0, 1] In the classical approach to ray tracing introduced by
if s < .P t h e n terminate path Whitted [18], a single ray can recuxsively spawn a multiplic-
else w e i g h t e - w e i g h t ~ ( 1 - P ) ity of rays at surfaces which both reflect and transmit light
specnlarly. Cook, et al. [4] generalized this approach by
end
replacing the deterministic branching steps by probabilis-
tic ones distributed over spatial and temporal dimensions.
Through the generality of Monte Carlo integration, this al-
Figure 1: The Russian Roulette algorithm which is used to ter- lowed a wider variety of optical effects to be simulated with
minate particles with insignificant weights without introducing the same number of samples. The resulting method of prob-
bias. The value P can be any probability less than 1. abilistic branching is essentially an application of splitting.
As Kajiya observed, however, this approach creates un-
necessarily bushy ray trees and expends most of the effort
duces a systematic bias to the estimator which m a y become at the leaves (higher generation rays) which make only a
significant if applied to a large n u m b e r of paths. small contribution [10]. Though Russian roulette (Sec. 3)
Fortunately, this bias can be e l i m i n a t e d by a simple tech- can help to limit the depth of these trees by terminating
nique k n o w n as R u s s i a n roulette [3,12,15]. According to this low-weight branches fairly, it does not in itself reduce the
technique, once the weight of a particle has fallen below a bushiness of the tree. Kajiya suggests that it is more ap-
pre-defined threshold we terminate its history probabilisti- propriate to trace paths instead of trees. At each collision
cally, with some given probability, P. If the particle "sur- event, exactly one ray is followed by probabilistically choos-
vives," its weight is increased by a factor of 1/(1 - P). Let ing one scattering m o d e to sample from; for example, either
w denote the weight of a particle before playing Russian the reflected or the transmitted light.
roulette and let the random variable W denote its subse- W e can compare the two approaches using the figure of
quent weight. The expected value of W , denoted E ( W ) , is merit [12] or efficiency[11] of the resulting estimators. This
t h e n given by measure, which we shall denote by ~, is defined by
1
E(W) = Prob( t e r m i n a t i o n ) • 0 + - (4)
if2 T
113
Prob( s u r v i v a l ) * 1--~-ff (2) where 0.~ is the variance of the estimator a n d ~- is the cost
associated with drawing a single sample. In this case a sam-
But the probability of t e r m i n a t i o n is P , a n d t h a t of survival ple consists of a complete particle history. At each collision
is 1 - P , so we have event we wish to sample the incident illumination in such a
way that the entire estimator is as efficient as possible. The
W
P*0 + (l-P)* 1-P - w (3) idea behind path tracing is to use a single particle, thereby
reducing v, which includes the cost of tracing each ray in
which is the the original weight of the particle. O n average, the e n v k o n m e n t . This cost can be considerable for complex
then, the particle will have the appropriate weight. We m a y environments. O n the other hand, averaging m a n y particle
therefore ignore the m a j o r i t y of the insignificant particles histories leads to a n estimator with a smaller variance, 0"2.
by artificially inflating the c o n t r i b u t i o n s of those which sur- Are there any situations in which this reduction in variance
vive. Although eliminating the bias in this way does i n fact outweighs the cost of tracking multiple particle histories?
increase the variance slightly, if applied to particles of suf- Though it is difficult in general to estimate both ~- and 0.2
ficiently low weight this c a n b e more t h a n c o m p e n s a t e d for for any given strategy, we can nevertheless construct exam-
by the additional samples we can collect for the same overall ples in which splitting confers a clear advantage.
cost. Perhaps more i m p o r t a n t l y , e l i m i n a t i n g the bias guar- Consider a particle which encounters N ideal mirror re-
antees t h a t we will converge to the correct result i n the limit Rectors before reaching a diffuse reflector. If we estimate
if the sample m e a n converges at all. The R u s s i a n Roulette the incident illumination at the diffuse surface by tracing a
algorithm is outlined in figure 1. single path, obtaining a variance of o-1
z at a cost v, then the
efficiency of the entire estimator is
4 Splitting: Paths vs. Trees 1
el - 0.~(No~ + r ) (5)
Another technique which is commonly used to improve the
efficiency of particle transport simulations is splitting.While where a is the average cost of tracing a single ray in the
Russian roulette reduces the number of scattering events environment. O n the other hand, if we achieve a slightly
at the expense of a slight increase in variance, the goal of lower variance, a,~,
2 by splitting into m paths of the same
splitting is to reduce variance by introducing more scatter- cost after tracing a single path to the diffuse reflector then
ing events. It works by partitioning a single particle into the efficiency of the entire estimator is
a multiplicity of particles, tracking their diverging histories
independently, then d o w n weighting their contributions ap- 1
propriately. In reactor simulations splitting is used when a ~ = 0 . ~ ( N a + mr) (6)
neutron encounters a region which is particularly important To see t h a t splitting can be advantageous in some instances
or of high sensitivity. Though tracking m a n y light weight we need only observe t h a t

65
O StGGRAPH '90, Dallas, August 6-10, 1990

[2] Cercignani, Carlo, "The Boltzmann Equation and its


~rn __ Cr12 Applications," Springer-Verlag, New York, 1988.
N~o¢ el o'~ > 1 (7)
[3] Clark, Francis H., "Methods and data for reactor shield
This shows that for any given a and v, after a sufficiently calculations," in Advances in Nuclear Science and Tech-
large number of mirror reflections splitting into multiple nology, No. 5, 1971, pp. 95-183.
paths is a more efficient strategy than continuing a single
path. [4] Cook, Robert L., Thomas Porter, and Loren Carpenter,
Another instance in which splitting is advantageous is "Distributed Ray Tracing," Computer Graphics, 18(3),
when multiple samples reduce the variance significantly. July 1984, pp. 137-145.
More precisely, if at any point along a path we can employ m
samples of equal cost to estimate the incident illumination [5] Duderstadt, J. J., and W. R. Martin, "Transport The-
and achieve a variance O'm 2 such that ory," J. Wiley, New York, 1979.
[6] Ferry, D. K., "Semi-Classical Boltzman Transport The-
~m < -- (s) ory in Semiconductors," in Physics of Nonlinear Trans-
m
port in Semiconductors, New York, 1979.
where o-12is the variance of a singe sample, then em > el and
we have an increase in el~iciency. Under certain conditions, [7] Coral, Cindy M., Kenneth E. Torrance, Donald P.
such a reduction in variance can be obtained through sample Greenberg, and Bennett Battaile, "Modeling the interac-
stratification, a common Monte Carlo technique in which tion of light between diffuse surfaces," Computer Graph-
the domain of integration is partitioned into disjoint regions ics, 18(3), July 1984, pp. 213-222.
which are sampled independently. [8] Hall, R. A., and D. P. Greenberg, "A testbed for realistic
If the incident illumination at a surface point can be image synthesis," IEEE Computer Graphics and Applica-
separated into low-variance strata whose mean values differ tions, 3(10), November, 1983, pp. 10-20.
greatly, then splitting into one p a t h for each stratum will
result in a more efficient estimator [9]. Two strata which will [9] Hammersley, J. M., and D. C. Handscomb, "Monte Carlo
often meet these criteria are the intense direct illumination Methods," Chapman and Hall, 1964.
from light sources and the attenuated indirect illumination
from the remainder of the environment [10]. [10] Kajiya, J. T., "The Rendering Equation," Computer
While ray trees generally place too much of the compu- Graphics, 20(4), August 1986, pp. 143-150.
tational burden at the leaves, these examples indicate that
[11] Kalos, M. H., and Paula A. Whitlock, "Monte Carlo
there exist cases in which trees lead to greater efficiency
than a strict application of p a t h tracing. This suggests that Methods, Volume I: Basics," J. Wiley, New York, 1986.
a hybrid method can achieve higher efficiency t h a n either [12] Lewis, E. E., and W. F. Miller, Jr., "Computational
strategy alone if inexpensive heuristics for strategy selection Methods of Neutron Transport," J. Wiley, New York,
are employed. 1984.

5 Conclusion [13] Siegel, Robert, and John R. Howell, "Thermal Radia-


tion Heat Transfer," Hemisphere Publishing Corp., Wash-
As the level of realism in computer generated images has ington DC, 1981.
grown, the underlying illmnination models have encountered
[14] Snyder, John M. and Alan H. Barr, "Ray Tracing Com-
many of the complications common to other particle trans-
plex Models Containing Surface Tessellations," Computer
port problems. This is not surprising when one views the
Graphics, Vol. 21, No. 4, July 1987, pp. 119-126.
rendering equation as a form of the linear Boltzmann equa-
tion, a transport equation which has application in many ar- [15] Spanier, Jerome, and Ely M. Gelbavd, "Monte Carlo
eas of science and engineering. We can exploit this similarity Principles and Neutron Transport Problems," Addison-
by drawing upon techniques developed for other transport Wesley Publishing Company, 1969.
problems and applying them to image synthesis. Fields such
as nuclear engineering are rich sources of statistical tech- [16] Wallace, John R., Michael F. Cohen, and Donald P.
niques which are applicable to stochastic ray tracing and Greenberg, "A two-pass solution to the rendering equa-
to Monte Carlo solution of the rendering equation. As ex- tion: a synthesis of ray-tracing and radiosity methods,"
amples, we have discussed the uses of Russian roulette and Computer Graphics, 21(4), July 1987, pp. 311-320.
splitting in this context. Finally, because image synthesis
presents additional challenges due to features such as com- [17] Ward, Gregory J., Francis M. Rubinstein, and Robert
plex scene geometry, techniques developed for image synthe- D. Clear, "A Ray Tracing Solution for Diffuse Interreflec-
sis may also be useful in other domains. tion," Computer Graphics, 22(4), August 1988, pp. 85-92.
[18] Whitted, Turner, "An Improved Illumination Model for
References Shaded Display," Communications of the ACM, 32(6),
June 1980, pp. 343-349.
[1] Albert, G. E., "A general theory of stochastic estimates
of the Neumann series for solution of certain Fredholm [19] Williams, M. M. R., "Mathematical Methods in Parti-
integral equations and related series," in Symposium on cle Transport Theory," J. Wiley, New York, 1971.
Monte Carlo Methods, edited by M. A. Meyer, J. Wiley,
New York 1956, pp. 37-46.

65

Potrebbero piacerti anche