next up previous contents
Next: Projection Up: Rendering Previous: Rendering   Contents


Template Calculation

Figure 4.14: Cell projection templates. As the projections of cell $C$ and cell $D$ (position of $v_1$) have different sub-pixel offsets, the shape of pixel-sets affected by the cells differs. Thus $C$ and $D$ require different templates for projection.
\includegraphics[width=.7\linewidth]{Figures/templ.eps}

The main purpose of the template is to allow fast identification of the pixels affected by the projection of a cell. At each of these pixels, the cell's influence on the maximum of the ray through this pixel and thus to the pixel value has to be evaluated. A sufficiently accurate calculation of this contribution requires several steps of trilinear interpolation along the ray within the cell. To save time during cell projection, it is quite useful to pre-calculate entry and exit coordinates of the ray for each pixel of the template. Interpolation weights ($u$, $v$, $w$ $\in [0,1]$ for trilinear interpolation) of the entry and exit points are stored for this purpose.

As only parallel projection is used, the shape and size of the projected images of all cells is identical in a continuous image space. Due to arbitrary scaling and rotation of the volume for viewing and the discrete nature of a pixelized image, images of cells differ by an individual sub-pixel displacement with respect to the pixels of the image (see figure 4.14), which also leads to differing sets of pixels covered by a cell's image. To account for this shift with sufficient accuracy, the projection has to be performed with sub-pixel accuracy, allowing to place a cell's image in between image-pixel positions. The placement on a 4x4 grid within a pixel produces satisfying results.

The placement of cell images on sub-pixel positions leads to slightly different shapes of the templates for different $x$/$y$-displacements and also requires the calculation of individual ray entry/exit-positions for each of the templates. The resulting (4x4) array of templates can be directly accessed during rendering using the sub-pixel displacements of a cell's projection.

To optimize the rendering performance each element (=pixel) of the template stores a set of values:

Before rendering, the template is optimized to speed-up access. To avoid the necessity of skipping non-covered pixels within a template, just a list of covered template entries is stored instead of a 2D array. Thus, each template is just an array of image offset and ray-information elements for locations covered by a cell's projection.


next up previous contents
Next: Projection Up: Rendering Previous: Rendering   Contents
Lukas Mroz, May 2001,
mailto:mroz@cg.tuwien.ac.at.