Düzenle

Aracılığıyla paylaş


Textures

Textures are a powerful tool in creating realism in computer-generated 3D images. Direct3D supports an extensive texturing feature set, providing developers with easy access to advanced texturing techniques.

For improved performance, consider using dynamic textures. A dynamic texture can be locked, written to, and unlocked each frame.

In this section

Topic Description

Introduction to textures

A texture resource is a data structure to store texels, which are the smallest unit of a texture that can be read or written to. When the texture is read by a shader, it can be filtered by texture samplers.

Basic texturing concepts

Early computer-generated 3D images, although generally advanced for their time, tended to have a shiny plastic look. They lacked the types of markings-such as scuffs, cracks, fingerprints, and smudges-that give 3D objects realistic visual complexity. Textures have become popular for enhancing the realism of computer-generated 3D images.

Texture addressing modes

Your Direct3D application can assign texture coordinates to any vertex of any primitive. Typically, the u- and v-texture coordinates that you assign to a vertex are in the range of 0.0 to 1.0 inclusive. However, by assigning texture coordinates outside that range, you can create certain special texturing effects.

Texture filtering

Texture filtering produces a color for each pixel in the primitive's 2D rendered image when a primitive is rendered by mapping a 3D primitive onto a 2D screen.

Texture resources

Textures are a type of resource used for rendering.

Texture wrapping

Texture wrapping changes the basic way that Direct3D rasterizes textured polygons using the texture coordinates specified for each vertex. While rasterizing a polygon, the system interpolates between the texture coordinates at each of the polygon's vertices to determine the texels that should be used for every pixel of the polygon.

Texture blending

Direct3D can blend as many as eight textures onto primitives in a single pass. The use of multiple texture blending can profoundly increase the frame rate of a Direct3D application. An application employs multiple texture blending to apply textures, shadows, specular lighting, diffuse lighting, and other special effects in a single pass.

Light mapping with textures

A light map is a texture or group of textures that contains information about lighting in a 3D scene. Light maps map areas of light and shadow onto primitives. Multipass and multiple texture blending enable your application to render scenes with a more realistic appearance than shading techniques.

Compressed texture resources

Texture maps are digitized images drawn on three-dimensional shapes to add visual detail. They are mapped into these shapes during rasterization, and the process can consume large amounts of both the system bus and memory. To reduce the amount of memory consumed by textures, Direct3D supports the compression of texture surfaces. Some Direct3D devices support compressed texture surfaces natively.

 

Direct3D Graphics Learning Guide