Graphics Reference
In-Depth Information
will require lots of samples, or some other approach to reducing variance. For a
basic ray tracer, this means you may need to trace many rays per pixel to get a
good estimate of the radiance arriving at a single image pixel.
31.5.1.2 Infinite Series
It's tempting to generalize to infinite series A = a 1 + a 2 +
in the obvious
way: Pick a non-negative integer i , and let X = a i ; make all choices of i equally
probable, and then the expected value of X should be A . There are two problems
with this, however. First, there's the missing factor of 20. In the finite example,
we multiplied each a i by 20 because the probability of picking it was 1
...
20. This
means that in the infinite case, we'd need to multiply each a i by infinity, because
the probability of picking it is infinitesimal. This doesn't make any sense at all.
Second, the idea of picking a positive integer uniformly at random sounds good,
but it's mathematically not possible. We need a slightly different approach, moti-
vated by Equation 31.11, in which each term of the series is multiplied by the
probability of picking that term (1
/
20) and by the inverse of that probability (20).
All we need to do is abandon the idea of a uniform distribution.
To sum the series
/
A = a 1 + a 2 +
...
,
(31.14)
2 j so that the probability
we can pick a non-negative integer j with probability 1
/
2 10 = 1
of picking j = 1is1
1024.
(This particular choice of probabilities was made because it's easy to work with,
and it's obvious that the probabilities sum to 1, but any other collection of positive
numbers that sum to 1 would work equally well.)
We then let
/
2 and the probability of picking j = 10 is 1
/
/
X = 2 j a j .
(31.15)
Just as before, the expected value of X is
E [ X ]=
1
2 j ( 2 j a j )
(31.16)
j = 1
=
a j
(31.17)
j = 1
= A .
(31.18)
And just as before, the variance in the estimate is related to the terms of the
series. If a j happens to be 2 j , then the variance is zero and the estimator is great.
If a j = 1
j 2 , then the variance is considerably larger, and we'll need to average
lots of samples to get a low-variance estimate of the result.
As we said, the particular choice we made in picking j —the choice to select j
with probability 2 j —was simple, but we could have used some other probability
distribution on the positive integers; depending on which distribution we choose,
the estimator may have lower or higher variance.
When it comes to applying this approach to rendering, the choice of j will
become the choice of “how many bounces the light takes.” If we have a scene in
which the albedo of every surface is about 50 % , then we expect only about half
as much light to travel along paths of length k + 1 as did along paths of length k .
/
 
Search WWH ::




Custom Search