Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DDS Cube Map Example

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:

DDS Components# Bytes
header128
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
repeat the previous 9 layers for the y mipmap image43704
repeat the previous 9 layers for the z mipmap image43704

 

Starting with DirectX 8, a cube map is stored with all faces defined.

DXGI Cube Maps

Cubic environment maps in Direct3D 10.x and Direct3D 11 are equivalent to a 2D texture array with 6 images, and can be stored in DDS files as such. With Direct3D 10.1 and Direct3D 11, the hardware can also support arrays of cubemaps which are themselves 2D texture arrays with a mulitple of 6 images (6, 12, 18, 24, etc.).

For example, here is a 256-by-256 cubemap with mipmap levels stored in a BC6H format as a 2D texture array:

DDS Components# Bytes
header (FourCC of "DX10")128
extended header (DXGI format set to 95 [DXGI_FORMAT_BC6H_UF16], dimension value of 3 [D3Dxx_RESOURCE_DIMENSION_TEXTURE2D], array size of 6, misc flags of 0x4 [D3Dxx_RESOURCE_MISC_TEXTURECUBE])20
256-by-256 array entry 0 (positive x) main image65536
128-by-128 array entry 0 (positive x) mipmap image16384
64-by-64 array entry 0 (positive x) mipmap image4096
32-by-32 array entry 0 (positive x) mipmap image1024
16-by-16 array entry 0 (positive x) mipmap image256
8-by-8 array entry 0 (positive x) mipmap image64
4-by-4 array entry 0 (positive x) mipmap image16
2-by-2 array entry 0 (positive x) mipmap image16
1-by-1 array entry 0 (positive x) mipmap image16
repeat the previous 9 layers for array entry 1 (negative x) mipmap image87408
repeat the previous 9 layers for array entry 2 (positive y) mipmap image87408
repeat the previous 9 layers for array entry 3 (negative y) mipmap image87408
repeat the previous 9 layers for array entry 4 (positive z) mipmap image87408
repeat the previous 9 layers for array entry 5 (negative z) mipmap image87408

 

Related topics

Programming Guide for DDS

 

 

Community Additions

Show:
© 2014 Microsoft