DXT
DXT is a texture compression format, formerly known as S3TC. DXT is widely supported on current graphics hardware, meaning it will stay compressed in video memory, allowing the artist to use more or larger textures.
There are five DXT formats: DXT1, DXT2, DXT3, DXT4, and DXT5.
In DirectX 10 it is known as Block Compression and comes in five basic flavors: BC1, BC2, BC3, BC4, and BC5.
The DXT compression format can be stored inside many container files like DDS, VTF, etc. but DDS is the most common file extension.
Source images must be power of two in size (i.e. 4x4, 32x8, 256x512, 1024x1024, etc.), and the smallest size is 4x4. If you feed it a smaller size (like 1x1 or 1x256) the file will be padded out to 4 pixels wide and/or tall.
DXT1a
Generally the best DXT format for textures with just black and white in the Alpha channel, no grays.
- In DirectX 10 it is called BC1.
- Compressed, with 1-bit Alpha (just black and white, no grays).
- Smallest file size, half the size of DXT3 and DXT5. Same file size as DXT1c.
- Doesn't work very well on images that have stark color changes, like pixel art.
- DXT1a and DXT1c are the same format, just an internal switch for enabling alpha or not.
- Note: the alpha is actually stored in the RGB data, so the black parts of the Alpha will replace the RGB color completely.
DXT1c
Generally the best DXT format for textures without an Alpha channel.
- In DirectX 10 it is called BC1.
- Compressed, with no Alpha.
- Smallest file size, half the size of DXT3 and DXT5. Same file size as DXT1a.
- Doesn't work very well on images that have stark color changes, like pixel art.
- DXT1a and DXT1c are the same format, just an internal switch for enabling alpha or not.
DXT2
- In DirectX 10 it is called BC2.
- Same format as DXT3, except it assumes the alpha is not pre-multiplied.
- Rarely used because it requires extra processing in the shader.
DXT3
Generally the best DXT format for textures with a sharp Alpha channel.
- In DirectX 10 it is called BC2.
- Compressed, with "explicit" Alpha.
- Color is compressed the same as DXT1.
- In the alpha channel, each pixel is only one of 16 levels of gray.
- This works well if the alpha values are mostly black and mostly white, with thin anti-aliasing between them.
- Twice the file size of DXT1, same file size as DXT5.
DXT4
- In DirectX 10 it is called BC3.
- Same format as DXT5, except it assumes the alpha is not pre-multiplied.
- Rarely used because it requires extra processing in the shader.
DXT5
Generally the best DXT format for textures with a smooth Alpha channel.
- In DirectX 10 it is called BC3.
- Compressed, with interpolated Alpha.
- Color is compressed the same as DXT1.
- In the alpha channel, each 4x4 block is compressed separately from the others. Two of the pixels are stored in 256 levels of gray, while the other 14 pixels in the block are interpolated between those two, using 8 levels of gray.
- This works well when each block has a fairly smooth gradation of values, rather than sharp transitions.
- Twice the file size of DXT1, same file size as DXT3.
Links
- Compressed Texture Formats (Direct3D 9) - Microsoft documentation.
- S3 Texture Compression - Wikipedia page.
- DXTC: DXTC Examples and Technical Comparison - visual examples from the Unreal Development Kit. Note: "Bright" = 256-color paletted, "DXTC" = DXT3/DXT5.