The first example we consider is a
Monte Carlo path tracing (MCPT) method with a radiosity preprocess to
reduce variance. In this
method the estimates *L^p* are made as described in
Section 3, except that in estimating
the incident radiance for diffuse-like
surfaces in the indirect illumination integral,
values from a radiosity preprocess are used.
This is essentially the progressive multi-pass method described
by Chen et al. [3], except that the ``light ray'' pass for
explicit calculation of caustics is replaced by allowing caustic paths
to be followed in the integration of indirect
illumination. The ``light ray'' pass can be extremely
costly when many light source/specular surface
combinations need to be examined. By using an energy preserving
filter, the noise that has been the drawback of including
caustic paths in the Monte Carlo integration will be reduced.

For this method, ``noise'' pixels will be identified as pixels
which have not converged to within a user specified interval
*+/-D*. To be sure that most pixels have converged, we need
a minimum value of *Mt* that will be valid for the majority
of pixels. To predict *Mt*, we
need to know typical values of *Sp* (defined in Eq. 5).
We also need to estimate
the floating point value visibility threshold *Ltvis* which will translate
into a difference of one unit in *Np*. The threshold
depends on the form of T() in Eq. 3.

To predict *Sp* and *Ltvis* we take a small pilot sample (e.g.
similar to the pilot sample suggested in [2])
by rendering a 100x100 pixel image with 16 trials per pixel.
Since the deviation in our estimates decreases with the
square root of the number of trials, the estimate of *Sp_Mt* for *Mt*
samples will be the average sample deviation *Sp_16* we
calculate for the pilot sample times *sqrt(16/Mt)*. For the purposes of estimating
*Ltvis*, we assume a simple linear tone operator in which
the average image
value *Lave* will be mapped to the middle of the display range, *NMID*.
That is:

Knowing *Ltvis* and an estimate of *Sp*,
the number of trials required to obtain a result
accurate to *+/- D * is approximately:

We construct our method to require a minimum of
samples *Mt* as given by Eq. 10.
(Note, because *t(1-alpha/2)(Mt-1)* is near 1.0 for
*alpha = 80%* and *Mt>16* it does not appear in the
estimate in Eq. 10.)
Since the value
of *Mt* using this technique is a typical, rather than maximum value,
we multiply this number by heuristically determined
value of 4 to
establish *Mt,ceiling* to insure that
the majority of pixels will converge.

The simple linear tone operator is only assumed for the purpose of estimating the number of samples. The image will still be computed in floating point, and any tone operator can be applied to the result.

For the method just described, a pixel is considered a
``noise'' pixel to be treated by the filter if its sample
variation is larger than the acceptable tolerance
after *Mt,ceiling* trials. The excess
value at each unconverged pixel is defined as the difference
between the pixel radiance and the average of its immediate neighbors.
If the excess energy exceeds this average by more than
the variation allowed in the original calculations (i.e. *DLtvis*),
it is spread into a region around the
unconverged pixel.

Energy could be preserved by simply spreading the excess energy
over the entire image. However, that would unnecessarily
disrupt some pixels, and all definition of features such as
caustics would be lost.
To determine the size of a smaller region into which the energy should
be spread, we use the criterion that we do not want to introduce
non-physical high frequency artifacts into the image. The
energy is spread so that the additional radiance at each
pixel will be no more than *Ltvis*.

Any shape filter could be used. For a simple box shaped filter, the calculation
is straightforward. The difference between the radiance of the
unconverged pixel *Lu* and the average of its converged neighbors
*Ln* is found. The amount that *Lu-Ln* exceeds the
allowable error level *DLtvis* is the excess value *Lexcess* which
needs to be distributed. To limit the effect on neighboring
pixels, the number of pixels to which the excess is
distributed is *ceiling(Lexcess/Ltvis)*.

Only converged pixels in the original solution are used to compute the average. The effect of the filter does not depend on the order in which pixels are traversed. In some instances an unconverged pixel will have no converged neighbors. In this case the filter is applied recursively, with pixels that have had excess energy spread out marked as converged in the next iteration.

The method just described doesn't account for the spectral variation of radiance. If the method were applied for each spectral sample individually, wavelengths for which a pixel had a high variance would be smoothed out, while values at other wavelengths would be left untouched. The result would be ``noisy'' areas tending to turn gray. To avoid this color shift, the luminance of each ``noisy'' pixel is compared to the average luminance of its neighbors, and excess luminance is distributed with the same spectral distribution as the original ``noisy'' pixel.

Figure 4 shows the results of applying the simple box filter to an image generated using
MCPT with radiosity preprocess.
Two small specular boxes, one blue and one red are located in
a yellow-brown room. (The specular boxes do not appear shiny
because
they reflect the featureless walls of the room). An image
rendered using Eq. 10 to determine *Mt* with *D* = 5 for a 0 to 255
display device is shown on the left.
There are noisy regions in the image due to caustic paths in
the indirect illumination calculation as diagrammed in Fig. 1(d).
A noisy caustic due to the blue box can be seen on the ceiling near
the light. More subtle noisy caustics due to the red box can be seen on the floor
near the red box and on the ceiling above the red box. There is also a large
penumbra region (as diagrammed in Fig. 1(a)) on the left wall
due to the blue box.

The image after applying the filter is shown in the center. A comparison of the unfiltered and filtered images shows that the filter correctly left features outside of the high noise areas undisrupted. Only a small number of pixels in the penumbra region are changed. The large caustic feature due to the blue box is retained and smoothed out, as are the smaller fainter red caustics.

The image in the lower right is the same scene rendered using
a minimum sampling rate that is 25 times higher (i.e. *Mt* set for *D* = 1.)
Not surprisingly, the filtered image appears somewhat noisier than the
high sampling rate image which took **25** times longer to compute.
This is because the filter is designed to affect
the unconverged ``high noise''
pixels only, not to remove the *+/-5* units of variation allowed in the
original low sampling rate calculation.
However, a comparison of the filtered and high sampling rate images
does show that the caustic features preserved by the filter are real.