Graphics Reference
In-Depth Information
Figure 2.41. The various 3D texture resource configurations.
texture type requires a significant amount of memory to hold all of its data, and hence it is
typically either limited in resolution or is used in cases where it is absolutely mandatory
to have a full 3D representation. Of course, as the amount of memory in GPUs continues
to increase, this situation will continually improve. At first 3D textures seem to be almost
exactly like a 2D texture array, and in some ways they are very similar. The single biggest
difference is that a texture sample performed an a texture array will only sample + filter
from the specified texture slice, while a sample performed on a 3D texture will filter be-
tween two adjacent slices. This means that on a 3D texture, a single trilinear filtered sample
will perform 16 memory fetches!
Even with the current performance and size limitations, many interesting and creative
uses have been found for 3D texture resources. The storage of voxel data is perhaps the pro-
totypical example. A voxel is an extension of a 2D pixel (as a picture element) to 3D (as a
volume element). This data structure stores a scalar value at each point within a 3D grid. The
data in the grid can then be used to extract isosurface information to produce a model. For
example, we could extract a surface from the model where the scalar value is equal to 0.5.
This is commonly done with the well-known marching cubes algorithm (Lorensen, 1987)
or some variant of it. An easy-to-visualize example of such a voxel-based data set is the
results of a magnetic resonance imaging (MRI) scan, where the biological material density
of a patient is represented as a scalar value at each point within the 3D grid.
Other increasingly popular uses are global illumination lighting solutions. In these
scenarios, light propagation is calculated over a complete scene volume, which is repre-
sented by a 3D texture. Since the 3D grid is limited in resolution, this provides a lower
calculation cost than trying to perform ray-tracing, which more or less entails tracing
Search WWH ::




Custom Search