Platform SDK: DirectX

What Are Cubic Environment Maps?

A cubic environment maps—sometimes casually referred to as "cube maps"—are textures that contain image data representing the scene surrounding an object, as if the object were in the center of a cube. Each face of the cubic environment map covers a ninety degree field of view in the horizontal and vertical, and there are six faces per cube map. The orientation of the faces is given in the following illustration.

Each face of the cube is oriented perpendicular to the x/y, y/z, or x/z plane, in world space. The following figure shows how each plane corresponds to a face.

Cubic-environment maps are implemented as a series of attached texture surfaces, created in a single call, which can be accessed like any other set of attached surfaces. Applications can use static images for cubic-environment mapping, or they can render into the faces of the cube map to perform dynamic environment mapping. (This technique requires that the cube-map surfaces be valid render-target surfaces, created with the DDSCAPS_3DDEVICE capability.)

The faces of a cube map don't need to contain extremely detailed renderings of the surrounding scene. In most cases, environment maps are applied to curved surfaces. Given the amount of curvature used by most applications, the resulting reflective distortion makes extreme detail in the environment map wasteful in terms of memory and rendering overhead.