DDS File Layout for Cubic Environment Maps
Microsoft DirectX 9.0 SDK Update (October 2004)

DDS File Layout for Cubic Environment Maps


For cubic environment maps, one or more faces of a cube are written to the file, using either uncompressed or compressed formats, and all faces must be the same size. Each face can have mipmaps defined, although all faces must have the same number of mipmap levels. If a file contains a cube map, DDSCAPS_COMPLEX, DDSCAPS2_CUBEMAP, and one or more of DSCAPS2_CUBEMAP_POSITIVEX/Y/Z and/or DDSCAPS2_CUBEMAP_NEGATIVEX/Y/Z should be set. The faces are written in the order: positive x, negative x, positive y, negative y, positive z, negative z, with any missing faces omitted. Each face is written with its main image, followed by any mipmap levels.

For example, a 256-by-256 cube map with positive x, negative y, and positive z faces, a pixel format of DXT1, and all mipmap levels would contain the following:

Texture Size/Type# Bytes
"DDS ", 256x256, linearsize = 32768, DXT1, 128, (TEXTURE, LINEARSIZE, COMPLEX, MIPMAP,  CUBEMAP, POSITIVEX, NEGATIVEY, POSITIVEZ, FOURCC)
256-by-256 positive x main image32768
128-by-128 positive x mipmap image8192
64-by-64 positive x mipmap image2048
32-by-32 positive x mipmap image512
16-by-16 positive x mipmap image128
8-by-8 positive x mipmap image32
4-by-4 positive x mipmap image8
2-by-2 positive x mipmap image8
1-by-1 positive x mipmap image8
256-by-256 negative y main image32768
128-by-128 negative y mipmap image8192
64-by-64 negative y mipmap image2048
32-by-32 negative y mipmap image512
16-by-16 negative y mipmap image128
8-by-8 negative y mipmap image32
4-by-4 negative y mipmap image8
2-by-2 negative y mipmap image8
1-by-1 negative y mipmap image8
256-by-256 positive z main image32768
128-by-128 positive z mipmap image8192
64-by-64 positive z mipmap image2048
32-by-32 positive z mipmap image512
16-by-16 positive z mipmap image128
8-by-8 positive z mipmap image32
4-by-4 positive z mipmap image8
2-by-2 positive z mipmap image8
1-by-1 positive z mipmap image8

Note  As of Microsoft DirectX 8.0, cube maps are always written with all faces defined.


© 2004 Microsoft Corporation. All rights reserved.
Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center.