Garrity [31] introduces an efficient method for ray casting transparent unstructured grids. His method requires that the unstructured grid be a conforming mesh. For a mesh to be conforming, the intersection of any two of its cells is either empty or the shared vertex, edge, or face. Non-conforming grids hold a variety of problems with both simulation and visualization and are therefore usually considered to be erroneous grids.
![]() |
![]() |
![]() |
| (a) A ray intersecting an external face. | (b) The ray exiting the cell. | (c) The ray entrance to the next cell. |
We can partition the cell faces in a conforming unstructured mesh into two sets. The internal faces are those that are shared by two cells. The external faces (known also as boundary faces) are those that belong to only one cell. Garrity's method starts with the obvious observation that a ray originating from outside a grid must enter it through an external face. In general, the number of external faces is drastically smaller than the total number of cells. Thus, checking only the external faces drastically reduces the number of intersection tests. Bunyk, Kaufman, and Silva [5] speed up this part of the algorithm further by computing all ray intersections of each front facing external face at one time.
Once inside the cell, the ray, obviously, must exit through one of its faces. Thus, at this point we need only to check intersections of the ray with the cell's faces. If the exit face happens to be an external face, then we can find the next entry point by again checking only external faces. If the exit face is an internal face, then, by definition, another cell shares the face. These shared faces are static with respect to the grid. We could therefore generate offline a cell connectivity graph, a graph where each node represents a cell and each edge represents a face shared between cells. We could then consult the cell connectivity graph to determine the next cell without further intersection tests. Figure 1.2 demonstrates this process.
Weiler and colleagues [99] developed a way to perform ray casting using cell traversal on graphics hardware. Weiler finds the initial ray entry point by rendering front faces. Weiler then traverses through cells using the fragment program by storing the cells and connectivity graph in textures. Once a ray exits the grid, Weiler's algorithm does not handle reentry into the grid. Thus, the grids must be convex. To handle nonconvex grids, Weiler adds cells to make the grid convex in the same manner as suggested by [103].