next up previous contents index
Next: Resolution of Table Up: Linear Interpolation of Attenuation Previous: Computing   Contents   Index


Domain of $ \Psi $

In the previous section, I show that it is most prudent to build a two dimensional table with entries corresponding to $ ({\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D)$ pairs (Equation 1.8). However, valid values for $ \tau {}D$ lay in the range $ [0,\infty)$. We must choose a subset of this range that provides good resolution for the most frequently encountered values of $ \tau {}D$.

Figure 1.1: Plot of $ \Psi $ (Equation 1.8) against $ {\tau }_{\,\mathrm{b}}D$ and $ {\tau }_{\,\mathrm{f}}D$ for values in the range $ [0,4]$.
\includegraphics[bb=88pt 4pt 376pt 238pt,clip=true,width=3in]{ray_integration/Psi4}

Figure 1.1 shows $ \Psi_{{\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D}$ plotted for parameters in the range $ [0,4]$. 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 $ \Psi_{{\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D}$ shown in Figure 1.1 is not sufficient. Notice that $ \Psi_{4,0}=0.6$, whereas $ \lim_{{\tau }_{\,\mathrm{b}}D \rightarrow \infty}
\Psi_{{\tau }_{\,\mathrm{b}}D,0} = 0$. Therefore, the assumption that $ \Psi_{4,{\tau }_{\,\mathrm{f}}D} \approx
\Psi_{\infty,{\tau }_{\,\mathrm{f}}D}$ 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 $ \Psi $ clipping.

So what can we do about $ \Psi $ clipping? One approach is to structure the application such that no integrated ray segment ever has a value of $ \tau {}D$ that exceeds $ 4$. 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 $ \tau $ that allows for smaller cells to be rendered opaque while maintaining the constraint that $ \tau {}D < 4$.

Another straightforward approach to eliminate $ \Psi $ clipping is to increase the domain of $ \Psi_{{\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D}$ until the $ \Psi $ clipping effect is below a tolerable threshold.

Figure 1.2: Plot of $ \Psi $ (Equation 1.8) against $ {\tau }_{\,\mathrm{b}}D$ and $ {\tau }_{\,\mathrm{f}}D$ for values in the range $ [0,16]$.
\includegraphics[bb=88pt 4pt 376pt 238pt,clip=true,width=3in]{ray_integration/Psi16}
Figure 1.2 demonstrates why this approach will not work. In it, we have significantly increased the range over which $ \Psi_{{\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D}$ is plotted. The area plotted increased 16 fold, and the surface is far less smooth, thereby necessitating a significant increase in lookup table resolution. Yet $ \Psi_{16,0} = 0.3$, which is still significantly greater than $ \Psi_{\infty,0}$.

I propose a means of eliminating $ \Psi $ clipping by changing the variables we use to index $ \Psi $, much like we did to reduce the dimensionality of the $ \Psi $ table as described in Section 1.2.2. First, we define the variable $ \gamma$ as

$\displaystyle \gamma \equiv \frac{\tau {}D}{\tau {}D+1} \index{$\gamma$}\index{gamma~($\gamma$)}$ (60)

Solving Equation 1.9 for $ \tau {}D$,

$\displaystyle \tau {}D = \gamma/(1-\gamma)$    

and substituting into Equation 1.8, we get the following.

$\displaystyle \Psi_{{\gamma}_{\,\mathrm{b}},{\gamma}_{\,\mathrm{f}}} = { \int_0...
... \frac{{\gamma}_{\,\mathrm{f}}}{1-{\gamma}_{\,\mathrm{f}}} t \right) } dt} ds }$ (61)

Figure 1.3: Plot of $ \Psi $ against $ {\gamma}_{\,\mathrm{b}}$ and $ {\gamma}_{\,\mathrm{f}}$ (Equation 1.10).
\includegraphics[bb=88pt 4pt 376pt 238pt,clip=true,width=3in]{ray_integration/PsiGamma}

The principle advantage of using $ \gamma$ over $ \tau {}D$ is that valid values of $ \gamma$ range only over $ [0,1)$. It is therefore possible to store the entire domain of $ \Psi $ into a single table. Figure 1.3 shows a plot of $ \Psi_{{\gamma}_{\,\mathrm{b}},{\gamma}_{\,\mathrm{f}}}$ over its entire domain.

Appendix 1 contains instructions on computing tables of $ \Psi $ values with Mathematica. Appendix 1.4 lists Cg code that uses such a table to compute the volume rendering integral.


next up previous contents index
Next: Resolution of Table Up: Linear Interpolation of Attenuation Previous: Computing   Contents   Index
Kenneth D Moreland 2004-07-16