S3 Texture Compression

S3 Texture Compression ( S3TC ) (sometimes DXTn or DXTC ) is originally developed for the Savage 3D texture compression system from S3 Graphics. It is in contrast to image compression algorithms such as JPEG for hardware-accelerated computer graphics because it has a fixed data compression rate and only one memory access per texel required. By including in DirectX 6.0 S3TC was quickly accepted across manufacturers and is now the dominant standard. The DXT formats are supported in OpenGL as an extension.

S3TC consists of five formats, which are named after their assigned in DirectX FourCC identification as DXT1 to DXT5 and differ in the use of the alpha channel. DXT2 DXT4 and are hardly used and are in contrast to the other three forms not part of the OpenGL extension for S3TC.

Like any other lossy compression algorithm tries S3TC, visible artifacts to minimize despite high data pack rate. So, with the same memory requirements can be a texture with a much higher resolution can be used, resulting in an overall better result. Like most modern algorithms for image compression S3TC shall only determine how the data will be extracted and thus leaves room for different approaches to compression. Still collects royalties, as the basic implementation is covered by a patent.

With Direct3D 10 DXT the five stages have been deprecated ( deprecated ). The difference between before and after multiplied alpha values ​​is no longer made ​​. For DXT1 is BC1, BC2 from DXT2 and DXT3 is from DXT4 and DXT5 is BC3.

Principle of operation

Five algorithms have been developed based on the same principle but are adapted for different types of image data. The texture is first divided into 4 × 4 blocks of texel. From the 16 color values ​​, two 16 -bit RGB 565 colors are calculated. The individual algorithms compute from these two additional color values ​​and store them in a lookup table. As in a graph with color palette only the index of the best matching color value is stored for each texel in the table and not the color of the texel itself The entries there can be addressed with just a few bits, so that with 32 bits RGBA textures compression ratios of 8:1 and 4:1 in DXT1 arise in all other codecs.


For each 4 x 4 texture block is a 2 -bit index can be calculated in addition to the two 16-bit color values ​​per texel. In total, 64 bits per block are required and the lookup table can contain a maximum of 4 entries.

If the first color value is greater than the second, are the other two:


DXT1 compressed compared to the other algorithms twice as fast since no alpha values ​​are stored.


DXT3 compresses the color values ​​as DXT1, makes no distinction between the two schemes, but always the first variant used with four opaque colors, transparency is made possible by an additional 4 -bit alpha channel. A total of 128 bits per block are required. DXT3 is suitable especially for textures with sharp transitions between transparent and opaque regions.


DXT5 compressed the color values ​​as DXT1. There are stored two 8 -bit alpha values ​​per pixel, and a 3-bit value that is used to interpolate between the alpha values ​​. If the first alpha value is greater than the second, 8 alpha values ​​are obtained by linear interpolation. Otherwise only 6 alpha values ​​are generated by interpolation, while the other two are 0 and 1. There are 128 bits per block are required.


In practice, especially cartoon -like drawings and normal maps have proven to be problematic. Developed by ATI 3Dc algorithm is based on S3TC compressed Normals Maps but much more efficient. Id Software also dealt with the development of Doom 3 with the topic. The programmers worked around this problem, at least partially, reversed by the red color channel with the alpha channel before and after compression.