D3DX
This article needs additional citations for verification. (June 2020) |
In
The D3DX library contains pre-written routines for doing things common to most 2D/3D applications, such as games. Since the Direct3D API is relatively low-level, using the D3DX library is usually much simpler.
In 2012, Microsoft announced that D3DX 9, D3DX 10, and D3DX 11 would be deprecated in the Windows 8 SDK,[1] along with other development frameworks such as XNA. Shader effects, texture management, geometry optimizations and mesh models are available as separate sources published through GitHub.[2] The mathematical constructs of D3DX, like vectors and matrices, would be consolidated with XNAMath into a DirectXMath[3] and spherical harmonics math is provided as separate source.[2]
Interfaces
The D3DX library follows the
ID3DXEffect
The ID3DXEffect interface is used for compiling and binding FX shaders (.fx). It supports automatic mapping of named shader parameters to hardware constant registers, parameter pools, mapping textures to available samplers, specifying 'techniques' and modifying render states.
ID3DXFont
The ID3DXFont interface can be used to draw 2D text. See also D3DXCreateText that creates 3D meshes of text.
ID3DXLine
The ID3DXLine interface can be used for drawing anti-aliased screen-space lines with pattern.
ID3DXMesh
The ID3DXMesh interface is used for storage of meshes and mesh optimization for vertex cache friendliness and strip reordering. Some functions in D3DX operate on this interface. An example is D3DXComputeTangentFrame for creating a tangent-space frame for effects like normal and parallax mapping. A descendant of this class is ID3DXPMesh that can do geometry simplification.
ID3DXPRTEngine
It is used for Precomputed Radiance Transfer - a technique similar to spherical harmonics lighting that is used for precomputed global illumination and soft ambient lighting.
ID3DXSprite
The ID3DXSprite interface is a
The programmer typically needs only to call the ID3DXSprite object's Begin() method to set up the render state and world transform for 2D drawing, call the Draw() method to add
A common criticism of the D3DXSprite was that it was slow but this issue has been addressed as of Direct3D 9.
Functions
D3DXComputeTangentFrame
It computes the tangent-space frame of a mesh that is used for effects like normal/bump mapping, parallax mapping and anisotropic lighting models. It handles vertices at tangent-space discontinuities by making duplicates, thus solving the
Direct3D10
The D3DX10 utility library for Direct3D 10 was similar to the D3DX for Direct3D 9 in functionality, and included the same D3DXMath library and Block Compression (BC1-BC5) software codecs. The key differences were that Effects for Direct3D 10 was made an OS component, the HLSL compiler was moved to a distinct D3DCompile DLL, and the texture image load & save code utilized the
All versions of D3DX10 are deprecated per Microsoft Docs.[3]
Direct3D11
The D3DX11 utility library for Direct3D 11 was a trimmed down version of D3DX10. It included texture image load & save code using WIC, and the Block Compression (BC1-BC7) software codecs, but little else.
All versions of D3DX11 are deprecated per Microsoft Docs.[3]
Most functionality from D3DX9, D3DX10, and D3DX11 has been moved to open source projects for Direct3D 11 or later: DirectXMath,[4] DirectX Tool Kit,[5] DirectXTex,[6] DirectXMesh,[7] and UVAtlas.[8] There are also open source versions of DXUT[9] and the Effects (FX11)[10] runtime available.
Direct3D12
There is no DLL-based D3DX12 utility library. There is, however, a D3DX12 utility header (all inline C++ code) for some basic helpers for Direct3D 12 documented on Microsoft Docs[11] and is published on GitHub.[12] It does not include functionality such as math, sprites, font rendering, 3D shapes, meshes, or texture loading. There is a DirectX Tool Kit for Direct3D 12[13] which provides the missing functionality.
References
- ^ "D3DX Functions (Direct3D 11 Graphics)". Microsoft. 18 August 2023.
- ^ a b "Living without D3DX". MSDN. 20 August 2013.
- ^ a b c Microsoft. "Where is the DirectX SDK?". Microsoft. Retrieved 28 June 2020.
- ^ "DirectXMath". GitHub. 17 February 2022.
- ^ "DirectX Tool Kit for DX11". GitHub. 18 February 2022.
- ^ "DirectXTex texture processing library". GitHub. 16 February 2022.
- ^ "DirectXMesh geometry processing library". GitHub. 18 February 2022.
- ^ "UVAtlas isochart texture atlasing library". GitHub. 15 February 2022.
- ^ "DXUT for Direct3D 11". GitHub. 12 February 2022.
- ^ "Effects for Direct3D 11". GitHub. 12 February 2022.
- ^ Microsoft. "Helper Structures and Functions for D3D12". Microsoft. Retrieved 28 June 2020.
- ^ "D3DX12". GitHub.
- ^ "DirectX Tool Kit for DX12". GitHub. 18 February 2022.