next up previous contents index
Next: Synopsis Up: Linear Interpolation of Opacity Previous: Initial Approximation   Contents   Index


Improved Approximation

Figure 1.8: Plot of $ \zeta $ with linearly interpolated $ \alpha $, where $ {\alpha }_{\,\mathrm{b}}+{\alpha }_{\,\mathrm{f}} = 1$ and the length of the ray is 1. The solid line is the actual $ \zeta $. The dashed line is a parabola we fit over this curve.
\includegraphics[width=3in,bb=88 4 376 182,clip=true]{ray_integration/zeta_error_fix}

Although the plot in Figure 1.6(a) is mostly flat, like our approximation, there is a tapering at the corners where the two $ \alpha $ parameters are maximally different. Figure 1.8 shows the plot of the cross section between these two corners. The result looks like a parabola. We are able to reduce the error significantly by fitting a parabola to this plot and using

$\displaystyle \alpha (s) \approx { \frac{1}{2}\left({\alpha }_{\,\mathrm{b}}+{\...
...t) + 0.108165\left({\alpha }_{\,\mathrm{b}}-{\alpha }_{\,\mathrm{f}}\right)^2 }$ (64)

instead of $ \alpha (s) \approx
\frac{1}{2}\left({\alpha }_{\,\mathrm{b}}+{\alpha }_{\,\mathrm{f}}\right)$.

Our approximation of $ \Psi $ is trivially correct when $ {\alpha }_{\,\mathrm{b}} =
{\alpha }_{\,\mathrm{f}}$ but can have noticeable error when the two opacities are significantly different. Because we are averaging the opacity, our approximation yields the same result for any pair of $ ({\alpha }_{\,\mathrm{b}},
{\alpha }_{\,\mathrm{f}})$ that satisfies $ {\alpha }_{\,\mathrm{b}} + {\alpha }_{\,\mathrm{f}} = c$. However, $ \Psi $ should have smaller values when $ {\alpha }_{\,\mathrm{f}}$ is larger and the front color becomes more predominant than the back color. We can capture this effect by using a weighted sum for $ \alpha (s)$ rather than an average. Using

$\displaystyle {\alpha (s) \approx 0.27{\alpha }_{\,\mathrm{b}} + 0.73{\alpha }_{\,\mathrm{f}} }$ (65)

instead of $ \alpha (s) \approx
\frac{1}{2}\left({\alpha }_{\,\mathrm{b}}+{\alpha }_{\,\mathrm{f}}\right)$ yields a much lower error, as Figure 1.9 demonstrates. I get this weighting by using Mathematica [108] to minimize the $ l_2$-norm of the errors of 3840 samples over the domain of $ \Psi $.

Figure 1.9: Plots the error of the $ \Psi $ approximations. Both plots give values for unit length segments.
\includegraphics[width=.45\linewidth,bb=88 4 376 238,clip=true]{ray_integration/Psi_error_unweighted} \includegraphics[width=.45\linewidth,bb=88 4 376 238,clip=true]{ray_integration/Psi_error_weighted}
(a) Error of original approximation of $ \Psi $. (b) Error of adjusted approximation of $ \Psi $.

Appendix 1.6 lists Cg code that can use to perform this improved volume rendering integral approximation. When compiled with the latest NVIDIA Cg compiler, it requires 11 more instructions than the code listed in Appendix 1.6 for the approximation given in Section 1.3.1.

Figure 1.10: A comparison of ray-integration approaches that linearly interpolate the luminance.
Image spheres_alao.png Image spheres_llao.png
(a) Average color and opacity. (b) Linear color, average opacity.
Image spheres_lllo.png
(c) Linear color and opacity approximation.

Figure 1.10 compares various approaches for performing ray integration. The approximation that averages both the luminance and the opacity (Figure 1.10(a)) has obvious errors where the blue is bleeding through the yellow. The approximation that averages the opacity but linearly interpolates the color, introduced in Section 1.3.1, (Figure 1.10(b)) is a vast improvement. The same errors still exist, but are vary faint. The approximation for linear luminance and opacity introduced in this section (Figure 1.10(c)) reduces the errors yet again.


next up previous contents index
Next: Synopsis Up: Linear Interpolation of Opacity Previous: Initial Approximation   Contents   Index
Kenneth D Moreland 2004-07-16