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


Computing $ \Psi $

In contrast, using a linear form for $ \tau (s)$ does not resolve $ \Psi_{D,\tau (s)}$ to a simple, easily computed form.

$\displaystyle \Psi_{D,{\tau }_{\,\mathrm{b}},{\tau }_{\,\mathrm{f}}} = { \frac{...
...left(1-\frac{t}{D}\right) + {\tau }_{\,\mathrm{f}} \frac{t}{D} \right) dt} ds }$ (58)

However, the linear form of $ \Psi $ relies on only three variables: $ D$, $ {\tau }_{\,\mathrm{b}}$, and $ {\tau }_{\,\mathrm{f}}$. It is therefore possible to precompute $ \Psi $ for all applicable $ (D,{\tau }_{\,\mathrm{b}},{\tau }_{\,\mathrm{f}})$ triples. Also, note that the $ \Psi $ table is ubiquitous. Once computed, its results are valid for any volume rendering application. Thus, we have the luxury of using numerical methods that may take hours or days.

Although loading a three-dimensional lookup table into a three-dimensional texture is possible, a two-dimensional table and a two-dimensional texture are preferable. Röttger and colleagues point out that the significantly lower memory requirements of two-dimensional tables allow for much higher fidelity in the data they store [81] and that data retrieval from two-dimensional textures is often faster than that from three-dimensional textures on current graphics hardware [80]. Furthermore, not all current graphics hardware supports three-dimensional textures with floating point precision.

Fortunately, pre-integrated values of the $ \Psi $ function for linear attenuation coefficients may be stored in a two-dimensional table with no approximations apart from those introduced by sampling the function. Consider what happens when we change the limits of the integrals in Equation 1.7 to range between 0 and 1.

$\displaystyle \Psi_{D,{\tau }_{\,\mathrm{b}},{\tau }_{\,\mathrm{f}}}$ $\displaystyle = { \frac{1}{D} \int_0^D e^{-\int_s^D \left( {\tau }_{\,\mathrm{b...
...left(1-\frac{t}{D}\right) + {\tau }_{\,\mathrm{f}} \frac{t}{D} \right) dt} ds }$    
  $\displaystyle = { \frac{1}{D} \int_0^D e^{-D\int_{s/D}^1 \left( {\tau }_{\,\mathrm{b}} \left(1-t\right) + {\tau }_{\,\mathrm{f}} t \right) dt} ds }$    
  $\displaystyle = { \int_0^1 e^{-D\int_s^1 \left( {\tau }_{\,\mathrm{b}} \left(1-t\right) + {\tau }_{\,\mathrm{f}} t \right) dt} ds }$    

Next, we distribute $ D$ within the inner integral.

$\displaystyle \Psi_{{\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D} = { \int_0...
...t( {\tau }_{\,\mathrm{b}}D (1-t) + {\tau }_{\,\mathrm{f}}D t \right) } dt} ds }$ (59)

Equation 1.8 demonstrates that we may store $ \Psi $ in a two-dimensional table by pre-computing $ \Psi $ for all applicable $ ({\tau }_{\,\mathrm{b}}D,{\tau }_{\,\mathrm{f}}D)$ pairs. Before a lookup into this table may occur, we must compute the products $ {\tau }_{\,\mathrm{b}}D$ and $ {\tau }_{\,\mathrm{f}}D$. We can perform both multiplications in a single GPU vector operation, and we can reuse the products to compute $ \zeta $ if we rewrite Equation 1.6 as $ e^{-\frac{1}{2}\left({\tau }_{\,\mathrm{b}}D +
{\tau }_{\,\mathrm{f}}D\right)}$, so the multiplications are essentially free.

Once we compute $ \zeta $ and determine $ \Psi $ via a lookup table, we can calculate Equation 1.5 directly to perform the ray integration. Because this method uses a table that holds the pre-integration of part of the volume rendering integral, I dub this method partial pre-integration.


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