In the previous section, I show that it is most prudent to build a two
dimensional table with entries corresponding to
pairs
(Equation 1.8). However, valid
values for
lay in the range
. We must choose
a subset of this range that provides good resolution for the most frequently
encountered values of
.
Figure 1.1 shows
plotted for parameters
in the range
. Despite the number of terms generated when solving
Equation 1.8, we see that our plot is
quite smooth. The absence of high frequencies makes storing the function
over a finite domain in a table practical.
However, the partial pre-integration tables I have described thus far are
not complete. For example, the domain for
shown in
Figure 1.1 is not sufficient. Notice that
, whereas
. Therefore, the assumption that
is incorrect. Using a table based on
the plot in Figure 1.1 can cause extreme and
incorrect fluctuations in color space, an effect I dub
clipping.
So what can we do about
clipping? One approach is to structure the
application such that no integrated ray segment ever has a value of
that exceeds
. For many applications, such an
approach is perfectly reasonable. After all, providing a larger
attenuation does not make the model look more opaque, so why support
higher attenuations? On the other hand, if rendering a model
with cells varying wildly in size, it may not be possible to pick a range
for
that allows for smaller cells to be rendered opaque
while maintaining the constraint that
.
Another straightforward approach to eliminate
clipping is to
increase the domain of
until the
clipping effect is below a tolerable threshold.
I propose a means of eliminating
clipping by changing the
variables we use to index
, much like we did to reduce the
dimensionality of the
table as described in
Section 1.2.2. First, we define the
variable
as
The principle advantage of using
over
is that
valid values of
range only over
. It is therefore possible
to store the entire domain of
into a single table.
Figure 1.3 shows a plot of
over its entire domain.
Appendix 1 contains instructions on computing tables
of
values with Mathematica.
Appendix 1.4 lists Cg code that uses such
a table to compute the volume rendering integral.