?/TD> |
Microsoft DirectX 9.0 |
This section contains information about the internal organization of compressed texture formats. You do not need these details to use compressed textures, because you can use Direct3D extensions (D3DX) functions for conversion to and from compressed formats. However, this information is useful if you want to operate on compressed surface data directly.
Microsoft?Direct3D?uses a compression format that divides texture maps into 4x4 texel blocks. If the texture contains no transparency—is opaque—or if the transparency is specified by a 1-bit alpha, an 8-byte block represents the texture map block. If the texture map does contain transparent texels, using an alpha channel, a 16-byte block represents it.
When 128-bit blocks are used, the alpha channel must be specified in either explicit (format DXT2 or DXT3) or interpolated mode (format DXT4 or DXT5) for the entire texture. As with color, when interpolated mode is selected, either eight interpolated alphas or six interpolated alphas mode can be used on a block-by-block basis. Again the magnitude comparison of alpha_0 and alpha_1 is done uniquely on a block-by-block basis.
The pitch for DXTn formats is different from what was returned in Microsoft DirectX?7.0. It now refers the pitch of a row of blocks. For example, if you have a width of 16, then you will have a pitch of four blocks (4*8 for DXT1, 4*16 for DXT2-5.)