Graphics Reference
In-Depth Information
buffers and textures have different qualities, the appropriate resource type must be chosen
for a particular situation. In addition, textures support the ability to use mip-maps, which
are essential for achieving good performance and visual quality when rendering texture-
mapped geometry.
We will explore the texture resource types in more detail throughout this chapter. We
begin with a general discussion about textures, and some specific details about their uses
and available operations. This is followed by a more detailed look at using, creating, and
manipulating each type of texture resource, both in C++ and in HLSL.
Common Texture Properties
As mentioned above, texture resources are available in ID, 2D, and 3D versions. The
specific memory layouts that they use are distinct from one another, due to their differ-
ences in dimension. These are similar to the differences you would expect to see in C/C++
in layout between arrays of different dimensions. As an indication of how these layouts
are organized from a usage perspective, consider the graphical representations shown in
Figure 2.21. Even with distinct layouts, the texture resources share many other properties.
We will explore some of these common properties before moving on to examine each
texture type.
As shown in Figure 2.21, textures are arranged in according to the familiar X, Y, and Z
axes. This figure also includes additional axis descriptions, named U, V, and W. These indi-
cate the texture addressing scheme used by Direct3D 11, in which the total size of a texture
(regardless of how large or small it is) in each of the X, Y, and Z directions is mapped into
a range of [0,1]. This is done to provide a convenient method for sampling a texture. If you
sample a one-dimensional texture at address u =0.5, then regardless of whether the texture
has 16 elements, or 1600 elements, you will receive the element that is at the halfway point
of the texture. This is a very important consideration when performing sampling, and will
be considered further when we discuss samplers in the "Sampler State Object" section.
Figure 2.21 . A visualization of the various texture configurations.
Search WWH ::




Custom Search