next up previous contents index
Next: Practical Implementations of Volume Up: Closed Forms of the Previous: Homogeneous Particles with Variable   Contents   Index


Linear Interpolation of Volume Parameters

So far, in all the closed forms to the volume rendering integral that I have presented, none is capable of interpolating both the luminance and attenuation parameters of the volume (without the use of piecewise integration). The simplest form of interpolation is linear interpolation. Williams and Max [104] were the first to solve the volume rendering integral with linear interpolation of both luminance and attenuation. They choose to parameterize their equations using a tetrahedron that a viewing ray intersects.

I instead give a closed form that parameterizes the volume rendering equation using only $ L(s)$ and $ \tau (s)$, which, in my humble opinion, leads to a simpler form of the equation. Without loss of generality, I use the following linear forms of $ L(s)$ and $ \tau (s)$.

$\displaystyle L(s)$ $\displaystyle { = {L}_{\,\mathrm{b}}\frac{D-s}{D} + {L}_{\,\mathrm{f}}\frac{s}{D} }$ (16)
$\displaystyle \tau (s)$ $\displaystyle { = {\tau }_{\,\mathrm{b}}\frac{D-s}{D} + {\tau }_{\,\mathrm{f}}\frac{s}{D} }$ (17)

In Equation 1.19, $ {L}_{\,\mathrm{f}}$ and $ {L}_{\,\mathrm{b}}$ describe the luminance at the front and back of the ray, respectively. This is likewise for the attenuation in Equation 1.20.

Substituting Equation 1.19 and Equation 1.20 into Equation 1.2 results in a solvable equation, although the calculus to do so is difficult. Using the help of a mathematical solver such as Mathematica [108], we get

\begin{multline}
I(D) = { I_0 e^{-D\frac{{\tau }_{\,\mathrm{b}}+{\tau }_{\,\mat...
...tau }_{\,\mathrm{b}}
-{\tau }_{\,\mathrm{f}})}}}\right)\right] }
\end{multline}

Equation 1.21 has many terms, which makes it computationally intensive to compute. Furthermore, there are instances of the $ \mathrm{erf}$ function. Here, $ \mathrm{erf}$ is the error function, defined as $ \mathrm{erf}(x) = \frac{2}{\pi}\int_0^x e^{-u^2} du$. The $ \mathrm{erf}$ function does not have a closed form, but there are several known numerical methods to compute it with sufficient accuracy.

Further analysis shows us that if $ {\tau }_{\,\mathrm{b}} <
{\tau }_{\,\mathrm{f}}$, Equation 1.21 contains imaginary terms, that is, terms with $ \mathrm{\mathbf{i}}= \sqrt{-1}$ in them. The idea of having complex values for light intensity is a bit disturbing, and it might lead you to question the validity of Equation 1.21. However, as long as the values for $ {\tau }_{\,\mathrm{b}}$, $ {\tau }_{\,\mathrm{f}}$, $ {L}_{\,\mathrm{b}}$, and $ {L}_{\,\mathrm{f}}$ are real, all imaginary terms will cancel out.

An implementation evaluating Equation 1.21 could compute it by performing complex arithmetic. However, because it is generally more convenient to perform strictly real arithmetic, we can manipulate Equation 1.21 to have only real numbers when $ {\tau }_{\,\mathrm{b}} <
{\tau }_{\,\mathrm{f}}$. We can do this using the imaginary error function, $ \mathrm{erfi}$, defined as $ \mathrm{erfi}(x) =
\mathrm{erf}(\mathrm{\mathbf{i}}{}x)/\mathrm{\mathbf{i}}= \frac{2}{\sqrt{\pi}}\int_0^x e^{u^2} du$. Although the relation contains $ \mathrm{\mathbf{i}}$, both $ \mathrm{erf}(x)$ and $ \mathrm{erfi}(x)$ are real functions. So for the case when $ {\tau }_{\,\mathrm{b}} <
{\tau }_{\,\mathrm{f}}$, we get the modified real equation

\begin{multline}
I(D) = { I_0 e^{-D\frac{{\tau }_{\,\mathrm{f}}+{\tau }_{\,\mat...
...tau }_{\,\mathrm{f}}
-{\tau }_{\,\mathrm{b}})}}}\right)\right] }
\end{multline}

Neither Equation 1.21 nor Equation 1.22 is well defined if $ {\tau }_{\,\mathrm{b}} = {\tau }_{\,\mathrm{f}}$. For the special case when the attenuation coefficient is constant, we have to resolve Equation 1.2 and get yet another equation:

$\displaystyle I(D) = { I_0 e^{-\tau D} + {L}_{\,\mathrm{b}}{\left(\frac{_{1}}{^...
...\left(1 + \frac{_{1}}{^{\tau D}} e^{-\tau D} - \frac{_{1}}{^{\tau D}}\right)} }$ (18)

Equations 1.21 through 1.23 together make up the closed form for the volume rendering integral with linear parameters.


next up previous contents index
Next: Practical Implementations of Volume Up: Closed Forms of the Previous: Homogeneous Particles with Variable   Contents   Index
Kenneth D Moreland 2004-07-16