Table of contents
GDI
TOC
Collapse the table of content
Expand the table of content

Multiple Textures

Last Updated: 2/14/2017

Direct3D drivers can support the simultaneous use of multiple textures by using texture-stage states of the texture stage state type D3DTEXTURESTAGESTATETYPE, which is described in the DirectX SDK documentation. This type allows all the properties of a texture to be defined and combined with vertex extensions that specify independent sets of texture coordinate data.

Adding multiple texture support for Direct3D drivers requires setting the correct capability bits (Caps), implementing texture blending, and implementing D3dValidateTextureStageState.

To be compliant with DirectX 6.0 and later versions, a driver is required to properly parse up to eight texture coordinate sets, even if the device can only iterate and use the number of coordinates defined in the dwFVFCaps member of the D3DHAL_D3DEXTENDEDCAPS structure. The driver uses D3DTSS_TEXCOORDINDEX to get the correct coordinates to use for texturing.

Flexible vertex formats (FVF) allow multiple texturing because they make it possible to pass more than one texture coordinate in the vertex structure. Multiple textures can then be blended together in an iterated process and applied to a piece of geometry.

Texture handles are no longer generated by Direct3D drivers. Instead, the texture handles are generated by the Direct3D runtime. Texture cache management is done completely by the Direct3D runtime so that, to the driver, textures always appear to come from the application itself. All texture state is sent to the driver in the D3dDrawPrimitives2 command stream.

With the addition of multiple texturing, the methods for blending and texture filtering have also been refined to provide a clearer and more well-defined mechanism for blending. For more information about these blending and texture filtering mechanisms, see the Microsoft DirectX SDK documentation.

If a driver sets the D3DDEVCAPS_SEPARATETEXTUREMEMORIES flag in the DevCaps member of the D3DCAPS8 structure, it indicates to DirectX 8.0 and later versions of applications that they are disabled from simultaneously using multiple textures. The driver returns a D3DCAPS8 structure in response to a GetDriverInfo2 query as described in Reporting DirectX 8.0 Style Direct3D Capabilities. Support of this query is described in Supporting GetDriverInfo2.

Send comments about this topic to Microsoft

© 2017 Microsoft