S3 Texture Compression
   HOME

TheInfoList



OR:

S3 Texture Compression (S3TC) (sometimes also called DXTn, DXTC, or BCn) is a group of related
lossy In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data si ...
texture compression Texture compression is a specialized form of image compression designed for storing texture maps in 3D computer graphics rendering systems. Unlike conventional image compression algorithms, texture compression algorithms are optimized for random ac ...
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
s originally developed by Iourcha et al. of S3 Graphics, Ltd. for use in their Savage 3D computer graphics accelerator. The method of compression is strikingly similar to the previously published Color Cell Compression, which is in turn an adaptation of Block Truncation Coding published in the late 1970s. Unlike some image compression algorithms (e.g.
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
), S3TC's fixed-rate data compression coupled with the single memory access (cf. Color Cell Compression and some VQ-based schemes) made it well-suited for use in compressing textures in hardware-accelerated
3D computer graphics 3D computer graphics, or “3D graphics,” sometimes called CGI, 3D-CGI or three-dimensional computer graphics are graphics that use a three-dimensional representation of geometric data (often Cartesian) that is stored in the computer for th ...
. Its subsequent inclusion in
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
's
DirectX Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct" ...
6.0 and
OpenGL OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardwa ...
1.3 (via the GL_EXT_texture_compression_s3tc
extension Extension, extend or extended may refer to: Mathematics Logic or set theory * Axiom of extensionality * Extensible cardinal * Extension (model theory) * Extension (predicate logic), the set of tuples of values that satisfy the predicate * Ext ...
) led to widespread adoption of the technology among hardware and software makers. While S3 Graphics is no longer a competitor in the graphics accelerator market, license fees have been levied and collected for the use of S3TC technology until October 2017, for example in
game console A video game console is an electronic device that outputs a video signal or image to display a video game that can be played with a game controller. These may be home consoles, which are generally placed in a permanent location connected to a ...
s and graphics cards. The wide use of S3TC has led to a
de facto ''De facto'' ( ; , "in fact") describes practices that exist in reality, whether or not they are officially recognized by laws or other formal norms. It is commonly used to refer to what happens in practice, in contrast with '' de jure'' ("by l ...
requirement for OpenGL drivers to support it, but the patent-encumbered status of S3TC presented a major obstacle to
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized so ...
implementations, while implementation approaches which tried to avoid the patented parts existed.


Patent

Some (e.g. US 5956431 A) of the multiple USPTO patents on S3 Texture Compression expired on October 2, 2017. At least one continuation patent
US6,775,417
however had a 165-day extension. This continuation patent expired on March 16, 2018.


Codecs

There are five variations of the S3TC algorithm (named DXT1 through DXT5, referring to the FourCC code assigned by Microsoft to each format), each designed for specific types of image data. All convert a 4×4 block of
pixels In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device. In most digital display devices, pixels are the sm ...
to a 64- bit or 128-bit quantity, resulting in compression ratios of 6:1 with 24-bit RGB input data or 4:1 with 32-bit
RGBA RGBA stands for red green blue alpha. While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth ''alpha channel''. Alpha indicates how opaque each pixel is and allows an image to ...
input data. S3TC is a
lossy In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data si ...
compression algorithm, resulting in image quality degradation, an effect which is minimized by the ability to increase texture resolutions while maintaining the same memory requirements. Hand-drawn cartoon-like images do not compress well, nor do normal map data, both of which usually generate artifacts.
ATI Ati or ATI may refer to: * Ati people, a Negrito ethnic group in the Philippines **Ati language (Philippines), the language spoken by this people group ** Ati-Atihan festival, an annual celebration held in the Philippines *Ati language (China), a ...
's 3Dc compression algorithm is a modification of DXT5 designed to overcome S3TC's shortcomings with regard to normal maps.
id Software id Software LLC () is an American video game developer based in Richardson, Texas. It was founded on February 1, 1991, by four members of the computer company Softdisk: game programmer, programmers John Carmack and John Romero, game designer T ...
worked around the normalmap compression issues in Doom 3 by moving the red component into the alpha channel before compression and moving it back during rendering in the
pixel shader In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the Rendering (computer graphics), rendering of a 3D scene - a process known as ''shading''. Shaders have evolved ...
. Like many modern image compression algorithms, S3TC only specifies the method used to decompress images, allowing implementers to design the compression algorithm to suit their specific needs, although the patent still covers compression algorithms. The
nVidia Nvidia CorporationOfficially written as NVIDIA and stylized in its logo as VIDIA with the lowercase "n" the same height as the uppercase "VIDIA"; formerly stylized as VIDIA with a large italicized lowercase "n" on products from the mid 1990s to ...
GeForce 256 through to GeForce 4 cards also used 16-bit interpolation to render DXT1 textures, which resulted in banding when unpacking textures with color gradients. Again, this created an unfavorable impression of
texture compression Texture compression is a specialized form of image compression designed for storing texture maps in 3D computer graphics rendering systems. Unlike conventional image compression algorithms, texture compression algorithms are optimized for random ac ...
, not related to the fundamentals of the codec itself.


DXT1

DXT1 (also known as Block Compression 1 or BC1) is the smallest variation of S3TC, storing 16 input pixels in 64 bits of output, consisting of two 16-bit RGB 5:6:5 color values c_0 and c_1, and a 4×4 two-bit lookup table. If c_0 > c_1(compare these colors by interpreting them as two 16-bit unsigned numbers), then two other colors are calculated, such that for each component, c_2 = c_0 + c_1 and c_3 = c_0 + c_1. This mode operates similarly to mode 0xC0 of the original Apple Video codec.Togni, Roberto, et al.
Apple RPZA
. MultimediaWiki.
Otherwise, if c_0 \le c_1, then c_2 = c_0 + c_1 and c_3 is transparent black corresponding to a premultiplied alpha format. This color sometimes causes a black border surrounding the transparent area when linear texture filtering and alpha test is used, due to colors being interpolated between the color of opaque texel and neighbouring black transparent texel. The lookup table is then consulted to determine the color value for each pixel, with a value of 0 corresponding to c_0 and a value of 3 corresponding to c_3.


DXT2 and DXT3

DXT2 and DXT3 (collectively also known as Block Compression 2 or BC2) converts 16 input pixels (corresponding to a 4x4 pixel block) into 128 bits of output, consisting of 64 bits of alpha channel data (4 bits for each pixel) followed by 64 bits of color data, encoded the same way as DXT1 (with the exception that the 4-color version of the DXT1 algorithm is always used instead of deciding which version to use based on the relative values of c_0 and c_1). In DXT2, the color data is interpreted as being premultiplied by alpha, in DXT3 it is interpreted as not having been premultiplied by alpha. Typically DXT2/3 are well suited to images with sharp alpha transitions, between translucent and opaque areas.


DXT4 and DXT5

DXT4 and DXT5 (collectively also known as Block Compression 3 or BC3) converts 16 input pixels into 128 bits of output, consisting of 64 bits of alpha channel data (two 8-bit alpha values and a 4×4 3-bit lookup table) followed by 64 bits of color data (encoded the same way as DXT1). If \alpha_0 > \alpha_1, then six other alpha values are calculated, such that \alpha_2 = , \alpha_3 = , \alpha_4 = , \alpha_5 = , \alpha_6 = , and \alpha_7 = . Otherwise, if \alpha_0 \le \alpha_1, four other alpha values are calculated such that \alpha_2 = , \alpha_3 = , \alpha_4 = , and \alpha_5 = with \alpha_6 = 0 and \alpha_7 = 255. The lookup table is then consulted to determine the alpha value for each pixel, with a value of 0 corresponding to \alpha_0 and a value of 7 corresponding to \alpha_7. DXT4's color data is premultiplied by alpha, whereas DXT5's is not. Because DXT4/5 use an interpolated alpha scheme, they generally produce superior results for alpha (transparency) gradients than DXT2/3.


Further variants


BC4 and BC5

BC4 and BC5 (Block Compression 4 and 5) are added in Direct3D 10. They reuse the alpha channel encoding found in DXT4/5 (BC3). * BC4 stores 16 input single-channel (e.g. greyscale) pixels into 64 bits of output, encoded in the same way as BC3 alphas. The expanded palette provides higher quality. * BC5 stores 16 input double-channel (e.g. tangent space normal map) pixels into 128 bits of output, consisting of two halves each encoded in the same way as BC3 alphas.


BC6H and BC7

BC6H (sometimes BC6) and BC7 (Block Compression 6H and 7) are added in Direct3D 11. * BC6H encodes 16 input RGB HDR (float16) pixels into 128 bits of output. * BC7 encodes 16 input RGB8/RGBA8 pixels into 128 bits of output. BC6H and BC7 have a much more complex algorithm with a selection of encoding modes. The quality is much better as a result.


S3TC format comparison


See also

*
S2TC S2TC (short for Super Simple Texture Compression) is a texture compression algorithm based on Color Cell Compression. It is designed to be compatible with existing patented S3TC decompressors while avoiding any need for patent licensing fees. A ...
, patentless workaround * FXT1 * DirectDraw Surface *
PVRTC PVRTC (PowerVR Texture Compression) and PVRTC2 are a family of lossy, fixed-rate texture compression formats used in PowerVR's MBX (PVRTC only), SGX and Rogue technologies. The PVRTC algorithm is documented in Simon Fenney's paperTexture Compression ...
* Adaptive Scalable Texture Compression (ASTC) *
Ericsson Texture Compression Ericsson Texture Compression (ETC) is a lossy texture compression technique developed in collaboration with Ericsson Research in early 2005. It was originally developed under the name iPACKMAN and based on an earlier compression scheme called PAC ...
(ETC1 & ETC2) * Color Cell Compression


References


External links

{{External links, section, date=February 2017
US Patent & Trademark Office, Patent Full Text and Image Database, result for US 5956431 A
* ttp://msdn.microsoft.com/en-us/library/bb694531(v=vs.85).aspx Microsoft Developer Network article on Block Compression in Direct3D 10br>squish
an MIT-licensed S3TC compressor. The site also contain
an article
giving an introduction to compression algorithms.
Comparison between S3TC and FXT1 texture compressionThe Truth about S3TC
Note: This article used an early S3TC compression engine, not
nVidia Nvidia CorporationOfficially written as NVIDIA and stylized in its logo as VIDIA with the lowercase "n" the same height as the uppercase "VIDIA"; formerly stylized as VIDIA with a large italicized lowercase "n" on products from the mid 1990s to ...
's or ATI's updated codecs. (
Wayback Machine The Wayback Machine is a digital archive of the World Wide Web founded by the Internet Archive, a nonprofit based in San Francisco, California. Created in 1996 and launched to the public in 2001, it allows the user to go "back in time" and see ...
copy)
Texture compression
survey
A fast, SSE2-enabled DXT1/5 compressor by IntelBetsy, a GPU-accelerated compressor.Rate–distortion optimization">Modern open source BC1-7 encoders supporting Rate Distortion Optimization, Rate–distortion optimization
(RDO)br>DXT Texture Compression with SDL
3D computer graphics Lossy compression algorithms Texture compression