Light rays travels to the view point through semi-transparent voxels accumulating shaded voxel colours. To measure the transparent component effect, the colour is reduced by the opacity of voxels through which the light ray traverses. Since on the image plane only one colour is given for each ray that traverses a set of voxel, a formulation to derived that colour value using all the samples on one ray is necessary. This operation of formulating the image pixel value corresponding to the voxel values traversed along the ray is called compositing. Compositing is an light accumulation and attenuation method.
The most basic compositing operation is a recursive computation of :
The direction followed by
and
is either from front to back or
back to front with respect to the view plane depending if the operation is
started with the voxel closest or furthest from the view plane.
A very simple compositing operation is accomplished by
choosing an opacity constant, e.g.
and the
voxel density for the colour,
. This compositing gives an X-ray like picture,
since the density will be accumulated all along the ray.
Levoy's method takes for the colour coming out of a voxel,
,
the sum of the accumulated colour along the ray passing through the voxel reduced
by the voxel's opacity,
, and the voxel's colour,
.
Therefore, if the opacity of a voxel
is one, the accumulated colour of the ray until this location is ignored and
only the full colour of this voxel is preserved. It follows that if only other
voxels of null-opacity are encountered along the ray, the colour of the previous voxel of
opacity one will be the only one to contribute to the pixel colour from where
the ray was initially shot.
It is important to notice that in this model the light position and direction is ignored
in the computation, except implicitly in the induced shading colour of the voxels.