Loading...
 
DirectDraw Surface        

DirectDraw Surface

The DirectDraw Surface file format is used to store texture maps, both compressed and uncompressed.

Chunks

DXT1-5 compression artifacts appear in 4x4 texel chunks in the texture. Here is an before/after example scaled by 4x so the texels are clear:

Image

The artifacts are due to each chunk having a restricted palette.

Quality / Size Table

Encoding Bytes per texel in RAM/Disk Colour depth of R:G:B channels Number of colour values allowed per chunk Depth of A channel Number of alpha values allowed per chunk
L8 1 N/A N/A 8 16
RGB24 3 8:8:8 16 0 0
RGBA32 4 8:8:8 16 8 16
DXT1 0.5 5:6:5 4 1 2
DXT3 1 5:6:5 4 4 16
DXT5 1 5:6:5 4 8 4
3Dc 1 N/A N/A N/A N/A


Alpha Comparisons

DXT1, DXT3, DXT5 vary only in their encoding of the alpha channel.

DXT1

DXT1 compression should be used only with diffuse maps?, specular maps? and translucency maps?.

DXT1's 1 bit alpha can be used to store very primitive alphas (mainly for alpha rejection) but the colour component for these texels will always be black, meaning premultipliedAlpha must be set in the material.

DXT3

Used for texture with alpha maps that have a lot of chaotic high frequency texel details but only need 16 levels of alpha.

DXT2 and DXT3 are identical

DXT5

Used for texture with alpha maps that have smooth gradients and therefore need all 256 levels of alpha.

DXT4 and DXT5 are identical

Example

Here you can see the differences of a full alpha gradient (from opaque to transparent) in DXT3 and DXT5. There is no DXT1 alpha comparison because only 2 alpha values (on and off) are supported in DXT1.
DXT3 DXT5
Image Image


Misc

3DC

Used to encode normal maps?, gives better compression quality than DXT1 and other hacks involving DXT5. It stores 2 8bit channels (the 3rd is derived by the shader) and each channel has a separate 8 value palette.

Tools

  1. GIMP's DDS plug-in(external link)
  2. Adobe Photoshop's nvidia Plug-in(external link)
  3. AMD's Compressonator(external link)

See also


Category:File Formats?
Category:Graphics?
Category:Mapping?