Graphics Reference
In-Depth Information
Figure 2.32. A texture 2D resource used as a cube map, and a demonstration of how it is sampled.
The texture cube flag is unique to the 2D texture type. This flag indicates that a 2D tex-
ture that is created with six texture slices can be used to generate all six faces of a cube
map simultaneously. A cube map is a collection of six textures that can be sampled with a
three-component vector positioned at the cube center, returning the texture element that is
intersected by that vector. This is depicted in Figure 2.32. Intrinsic sampling functions are
available to use this particular type of texture resource object, which we will see in more
detail later in this section.
The other parameter for creating the texture is the initial data to load into the re-
source. This is provided with the D3D11_SUBRES0URCE_DATA point, which represents an
array of these structures, with one structure for each subresource. The data layout for ini-
tializing the resource is provided Figure 2.33. If the texture is multisampled, the initial data
parameter must be NULL, since these types of resources are not allowed to be initialized.
Figure 2.33. The layout of the subresource data to be applied to the initial contents of a 2D texture.
Search WWH ::




Custom Search