Compositing

In raycasting, the volume rendering integral is approximated by repeated application of the over-operator [54,43] in front-to-back order. That is, at each resample location, the current color and alpha values for a ray are computed in the following way:


\begin{displaymath}
\begin{array}{lcr}
c_{out} & = & c_{in} + c(x)\alpha (x)(1 -...
...} & = & \alpha _{in} + \alpha (x)(1 - \alpha _{in})
\end{array}\end{displaymath} (3.12)

$c_{in}$ and $\alpha _{in}$ are the color and opacity the ray has accumulated so far. $x$ is the reconstructed function value and $c(x)$ and $\alpha (x)$ are the classified and shaded color and opacity for this value. The advantage of using the front-to-back formulation of the over-operator is the possibility of early ray termination. As soon as a ray has accumulated full opacity (i.e., $\alpha _{out} = 1$), no further processing has to be done for this ray.

This formulation is only valid if compositing is performed at evenly-spaced locations at a distance of 1. If the object sample distance, i.e., the distance between subsequent samples along a ray, differs from 1, opacity correction is needed. Assuming an equal object sample distance for all rays, opacity correction can be achieved by using a corrected lookup table for the opacity values:


\begin{displaymath}
\alpha _{corr} (x) = 1 - (1 - \alpha (x))^{\Delta s}
\end{displaymath} (3.13)

where $\alpha _{corr}$ is the corrected opacity transfer function, $\alpha$ is the original opacity transfer function, and $\Delta s$ is the object sample distance. In Equation 3.12, $\alpha$ is then replaced by $\alpha _{corr}$.