24
using the union of spheres and the computation detailed in Section 3.4. The S,sphere
is then restricted to the visible region using the Restrict operation to build a new
field 5,new. The restriction will enable users to paint only on regions that are visible.
After the restriction, we perform an Overwrite of the old scalar field with the new
field Snevι. All grid points that lie inside the union of spheres are assigned the mask
index associated with the current brush.
Manual painting can be time-consuming. It is also prone to human error in con-
trolling the painting device. Therefore, we decided to use automatic segmentation to
aid our process. In particular, we find the graph-cut approach of segmentation to be
very effective. We follow the method described by Liu et al. and extend it to a 3D
interface [14]. We will briefly describe this method in the next chapter; please refer
to Liu et al.’s work for more information. The scalars along the new inter-material
boundaries can be computed using our method from Section 3.1 or the distance map
method described by Gibson [7].
3.4 GPU-implementation
We use texture-based volume rendering as our algorithm for visualizing density maps.
All volume maps (i.e. density map, auxiliary scalars, mask, etc.) are stored as 3D
textures [28, 2]. Coloring a single screen fragment involves a number of texture loads
to determine the density, color, and shade of the fragment in texture space. For our
classification algorithm, we need to load an additional 8 scalar values and 8 integers as
part of the fragment shader program. Texture loads are typically expensive operations
in shader programming. However, these 16 loads can be reduced to 4 loads by packing
the values into the RGBA channels for a single texel.
We store both the distance scalars and material masks as 8-bit textures, which
allows up to 256 materials. With only 8-bits of precision for the distance scalars,
we need to ensure that the precision is not wasted on non-essential portions of the
representation. Note that the scalars are used for arbitration only on the border