3Dc (
FourCC
A FourCC ("four-character code") is a sequence of four bytes (typically ASCII) used to uniquely identify data formats. It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts I ...
: ATI2), also known as DXN, BC5, or Block Compression 5 is a
lossy data compression algorithm for
normal maps
In 3D computer graphics, normal mapping, or Dot3 bump mapping, is a texture mapping technique used for faking the lighting of bumps and dents – an implementation of bump mapping. It is used to add details without using more polygons. A common u ...
invented and first implemented by
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 ...
. It builds upon the earlier
DXT5 algorithm and is an
open standard
An open standard is a standard that is openly accessible and usable by anyone. It is also a prerequisite to use open license, non-discrimination and extensibility. Typically, anybody can participate in the development. There is no single definition ...
. 3Dc is now implemented by both ATI and
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 ...
.
Target application
The target application, normal mapping, is an extension of
bump mapping that simulates lighting on
geometric
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space such as the distance, shape, size, and relative position of figures. A mathematician who works in the field of geometry is ca ...
surfaces by reading surface normals from a rectilinear grid analogous to a
texture map
Texture mapping is a method for mapping a texture on a computer-generated graphic. Texture here can be high frequency detail, surface texture, or color.
History
The original technique was pioneered by Edwin Catmull in 1974.
Texture mapping ...
- giving simple models the impression of increased complexity. This additional channel however increases the load on the graphics system's memory bandwidth. Pre-existing lossy compression algorithms implemented on consumer 3D hardware lacked the precision necessary for reproducing normal maps without excessive visible artefacts, justifying the development of 3Dc.
Algorithm
Surface normals are three-dimensional vectors of unit length. Because of the length constraint only two elements of any normal need to be stored. The input is therefore an array of two-dimensional values.
Compression is performed in 4×4 blocks. In each block the two components of each value are compressed separately. For each block, each of the two components have a palette of 8 values to choose from. The palettes are generated from two values representing the start and end of a line and the other six values being generated as linear combinations of the start and end values.
Compression is natively achieved by finding the lowest and highest values of the 16 pixels to be compressed and storing each of those as an 8-bit quantity. Individual elements within the 4×4 block are then stored with 3-bits each, representing their position on an 8 step linear scale from the lowest value to the highest. Each pixel's 3-bit value (the palette index) would be chosen by choosing the palette entry with the minimum distance from the original values.
Total storage is 128 bits per 4x4 block once both source components are factored in. In an uncompressed scheme with similar 8-bit precision, the source data is 32 8-bit values for the same area, occupying 256 bits. The algorithm therefore produces a 2:1
compression ratio.
The compression ratio is sometimes stated as being "up to 4:1" as it is common to use 16-bit precision for input data rather than 8-bit. This produces compressed output that is literally 1/4 the size of the input but it is not of comparable precision.
3Dc+
3Dc+ (
FourCC
A FourCC ("four-character code") is a sequence of four bytes (typically ASCII) used to uniquely identify data formats. It originated from the OSType or ResType metadata system used in classic Mac OS and was adopted for the Amiga/Electronic Arts I ...
: ATI1) (also known as BC4 or Block Compression 4) can compress textures, i.e. light maps, shadow maps, HDR textures and material properties. 3Dc+ provides 2:1
compression ratio with single component (
DXT5 alpha) 8-bit integer textures and 4:1 compression ratio with normal maps and textures consisting of two 8-bit integer components
References
Microsoft Developer Network article on Block Compression in Direct3D 10CREATING AND USING NORMAL MAPS
Texture compression
Open file formats
Lossy compression algorithms
3D graphics software