Graphics Reference
In-Depth Information
Subresources. With our discussion of mip-map levels, and of the array elements of a
resource, we have introduced the concept of a subresource. This name is used to identify
complete subportions of a resource. For example, every mip-map level of every element of
a texture array is a unique subresource. To aid in selecting a particular subresource, each
one is given a subresource index by which it can be identified. The numbering of subre-
source indices begins with the highest-resolution mip-map level of the first element of an
array, and increments for each mip-map level within that element. The count continues on
the highest-resolution mip-map level of the second element of the array, and continues until
all resources have an index. These indices will be very important when we consider the
methods for manipulating resources at the end of this chapter.
Texture 2D multisampled resources. Another option is available for two-dimensional
texture resources, and is aimed at improving image quality. Two-dimensional textures can
be created as multisample textures, and can be used to implement multisample anti-aliasing
(MSAA). The idea behind this resource type is that for each pixel, multiple subsamples
are actually stored in a pattern within the pixel boundaries. When rendering is carried
out, these subsamples are used to determine at a subpixel level the amount of coverage
that a pixel should receive from a given primitive being rasterized. This lets each pixel be
generated from a number of subsamples, which improves the quality of geometry edges
by effectively increasing the sampling rate of the render target. An example pixel with a
subsample pattern is shown in Figure 2.24.
Up to 32 subsamples can be selected by
the application, depending on hardware sup-
port. In the "Texture 2D" section we will see
how to create a texture with a valid number of
samples for a given hardware configuration.
Care must be taken when using MSAA, since
the amount of memory consumed by the re-
sources in question is effectively multiplied
by the number of subsamples used. Further
details about why MSAA is useful, as well as
information on how to use these resources, is
discussed in Chapter 3 in the "Rasterizer,"
"Pixel Shader," and "Output Merger" sections.
Figure 2.24. An example subsample pattern
within a pixel.
Texture 1 D
The first texture resource type that we will examine is the 1D texture. These textures are
arranged along a single axis, with each element being comprised of one of the basic DXGI
formats provided in the DXGI_FORMAT enumeration. The various subresource configu-
rations of a 1D texture are shown in Figure 2.25. These texture resources can be created
Search WWH ::




Custom Search