DirectX - Texturing



A texture resource is considered as a core part of gaming programming. It includes structured collection of data which is designed to store texels. Texel represents the smallest unit of a texture which can be read or written with the help of pipeline. Textures can be filtered by texture samplers as they are read by shader units. The texel includes 1 to 4 components which are arranged in DXGI formats. These textures are created as a structured resource with the mentioned size. The texture can be considered as typed or typeless based on the resource that is being created.

Now let us focus on the texture types which are primarily used by DirectX. Different textures are mentioned below −

  • 1D Textures
  • 1D Texture Arrays
  • 2D Textures and 2D Texture Arrays
  • 3D Textures

1D Textures

A 1D texture is the simplest form which contains texture data with only one base coordinate.

For DirectX, 1D textures are represented by the ID3D11Texture1D interface. Each texel contains a number of color components which is based on the data being stored.

A mipmap level in 1D texture that is a power-of-two smaller than the level above it.

Now let us focus on 1D Texture Arrays which is described below

1D Texture Arrays

This includes collection of 1D texture arrays. Direct3D 11 also supports arrays of textures. A 1D texture array is represented by the ID3D11Texture1D interface speaking in terms of DirectX latest version.

An array of 1D textures looks conceptually like the following illustration −

1D Texture Arrays

The texture array with one dimension consists of three textures. Each of the three textures has a texture with a width of 5 elements. Each texture also consists of layer with 3 tiers mipmap.

2D Textures and 2D Texture Arrays

A Texture2D is a 2 dimensional figure which consists of a 2D grid of texels. Each texel is usually addressed by a u, v vector. The texture resource, it consists mipmap levels and sub resources. 2D textures are represented in DirectX with respect to ID3D11Texture2D interface. The snapshot below depicts the 2D textures which is primarily used in gaming programming activities.

2D Textures

A 2D texture array is a collection of 2D textures which includes resource with a composition of homogeneous array of 2D textures where each texture includes the same data format and dimensions.

2D Textures Arrays

3D Textures

A 3D texture resource also referred with other name volume texture resource contains a 3D volume of texels. It includes minimap levels as it is texture resource. 3D textures in DirectX are implemented by the ID3D11Texture3D interface. A fully populated 3D texture looks like the way it is represented in snapshot below −

3D Textures

3D texture mipmap slice includes a constraint with render target output also with respect to render target view, the 3D texture includes behaviour is considered identical to 2D texture array.

Advertisements