Platform SDK: DirectX

What Is a Texture?

Early computer-generated 3-D images, although generally advanced for their time, tended to have a shiny plastic look. They lacked the types of markings that give 3-D objects realistic visual complexity such as scuffs, cracks, fingerprints, and smudges. In recent years, textures have gained popularity among developers as a tool for enhancing the realism of computer-generated 3-D images.

At its most basic, a texture is simply a bitmap of pixel colors. In this sense, the word texture has a specific definition when used in the context of computer graphics. In the normal semantics associated with the word texture, we refer both to the patterns of color on an object and its roughness or smoothness. Direct3D textures don't add "bumpiness" to an object. Rather, the textures, or patterns of colors, just give it the appearance of bumpiness.

Because Direct3D textures are simply bitmaps, any bitmap can be applied to a Direct3D primitive. For instance, applications can create and manipulate objects that appear to have a wood grain pattern in them. Grass, dirt, and rocks can be applied to a set of 3-D primitives that form a hill. The result is a very realistic-looking hillside. Texturing can also be used to create effects such as signs along a roadside, rock strata in a cliff, or the appearance of marble on a floor.

In addition, Direct3D supports more advanced texturing techniques such as texture blending (with or without transparency) and light mapping. Information on these techniques is presented in Texture Blending and Light Mapping With Textures.

If your application creates a HAL device, an MMX device, or an RGB device (see Direct3D Device Types), it can use 8-, 16-, 24-, or 32-bit textures. Legacy applications that use the monochromatic (or ramp) device must use 8-bit textures.