D3DX

Last updated

In computing, D3DX (Direct3D Extension) is a high level API library which is written to supplement Microsoft's Direct3D graphics API. The D3DX library was introduced in Direct3D 7, and subsequently was improved in Direct3D 9. It provides classes for common calculations on vectors, matrices and colors, calculating look-at and projection matrices, spline interpolations, and several more complicated tasks, such as compiling or assembling shaders used for 3D graphic programming, compressed skeletal animation storage and matrix stacks. There are several functions that provide complex operations over 3D meshes like tangent-space computation, mesh simplification, precomputed radiance transfer, optimizing for vertex cache friendliness and strip reordering, and generators for 3D text meshes. 2D features include classes for drawing screen-space lines, text and sprite based particle systems. Spatial functions include various intersection routines, conversion from/to barycentric coordinates and bounding box and sphere generators.

Contents

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 COM object oriented programming model. Functionality is accessed using C++-like interfaces.

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 C++ class used for drawing a 2D image to the screen known as a sprite in computer graphics. In DirectX 7 this was typically done using the DirectDraw API, which is deprecated.

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 textures to the list to be drawn and finally call the End() method to draw the images to the screen and restore the original graphics state.

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 hairy ball problem. It doesn't handle reversed UV winding of faces so models with mirrored texture mapping may run into lighting troubles because of this.

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 Windows Imaging Component. As a consequence of the shift to using WIC, D3DX10 did not support Truevision TGA, RGBE image format, or Portable PixMap file formats which were supported by D3DX. D3DX10 also did not include the UVAtlas isochart texture atlasing or Precomputed Radiance Transfer APIs.

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.

Related Research Articles

DirectX Collection of multimedia related APIs on Microsoft platforms

Microsoft DirectX is a collection of application programming interfaces (APIs) for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with "Direct", such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. The name DirectX was coined as a shorthand term for all of these APIs and soon became the name of the collection. When Microsoft later set out to develop a gaming console, the X was used as the basis of the name Xbox to indicate that the console was based on DirectX technology. The X initial has been carried forward in the naming of APIs designed for the Xbox such as XInput and the Cross-platform Audio Creation Tool (XACT), while the DirectX pattern has been continued for Windows APIs such as Direct2D and DirectWrite.

OpenGL Cross-platform graphics API

OpenGL is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics. The API is typically used to interact with a graphics processing unit (GPU), to achieve hardware-accelerated rendering.

Wine (software) Windows compatibility software

Wine is a free and open-source compatibility layer that aims to allow application software and computer games developed for Microsoft Windows to run on Unix-like operating systems. Wine also provides a software library, named Winelib, against which developers can compile Windows applications to help port them to Unix-like systems.

Direct3D is a graphics application programming interface (API) for Microsoft Windows. Part of DirectX, Direct3D is used to render three-dimensional graphics in applications where performance is important, such as games. Direct3D uses hardware acceleration if it is available on the graphics card, allowing for hardware acceleration of the entire 3D rendering pipeline or even only partial acceleration. Direct3D exposes the advanced graphics capabilities of 3D graphics hardware, including Z-buffering, W-buffering, stencil buffering, spatial anti-aliasing, alpha blending, color blending, mipmapping, texture blending, clipping, culling, atmospheric effects, perspective-correct texture mapping, programmable HLSL shaders and effects. Integration with other DirectX technologies enables Direct3D to deliver such features as video mapping, hardware 3D rendering in 2D overlay planes, and even sprites, providing the use of 2D and 3D graphics in interactive media ties.

High-Level Shader Language Shading language

The High-Level Shader Language or High-Level Shading Language (HLSL) is a proprietary shading language developed by Microsoft for the Direct3D 9 API to augment the shader assembly language, and went on to become the required shading language for the unified shader model of Direct3D 10 and higher.

Shader Type of program in a graphical processing unit (GPU)

In computer graphics, a shader is a type of computer program originally used for shading in 3D scenes. They now perform a variety of specialized functions in various fields within the category of computer graphics special effects, or else do video post-processing unrelated to shading, or even perform functions unrelated to graphics.

Torque Game Engine, or TGE, is an open-source cross-platform 3D computer game engine, developed by GarageGames and actively maintained under the current versions Torque 3D as well as Torque 2D. It was originally developed by Dynamix for the 2001 first-person shooter Tribes 2. In September 2012, GarageGames released Torque 3D as open-source software under the MIT License.

Windows Presentation Foundation (WPF) is a free and open-source graphical subsystem originally developed by Microsoft for rendering user interfaces in Windows-based applications. WPF, previously known as "Avalon", was initially released as part of .NET Framework 3.0 in 2006. WPF uses DirectX and attempts to provide a consistent programming model for building applications. It separates the user interface from business logic, and resembles similar XML-oriented object models, such as those implemented in XUL and SVG.

Matplotlib Library for creating static, animated, and interactive visualizations in Python.

Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications using general-purpose GUI toolkits like Tkinter, wxPython, Qt, or GTK. There is also a procedural "pylab" interface based on a state machine, designed to closely resemble that of MATLAB, though its use is discouraged. SciPy makes use of Matplotlib.

Desktop Window Manager is the compositing window manager in Microsoft Windows since Windows Vista that enables the use of hardware acceleration to render the graphical user interface of Windows.

Windows Display Driver Model (WDDM) is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista.

A vertex in computer graphics is a data structure that describes certain attributes, like the position of a point in 2D or 3D space, or multiple points on a surface.

Open Asset Import Library (Assimp) is a cross-platform 3D model import library which aims to provide a common application programming interface (API) for different 3D asset file formats. Written in C++, it offers interfaces for both C and C++. Bindings to other languages are developed as part of the project or are available elsewhere. Given the importance and the benefits of Assimp, a pure Java (/Kotlin) port is being developed here.

Three.js

Three.js is a cross-browser JavaScript library and application programming interface (API) used to create and display animated 3D computer graphics in a web browser using WebGL. The source code is hosted in a repository on GitHub.

In computing, Stage3D is an Adobe Flash Player API for rendering interactive 3D graphics with GPU-acceleration, within Flash games and applications. Flash Player or AIR applications written in ActionScript 3 may use Stage3D to render 3D graphics, and such applications run natively on Windows, Mac OS X, Linux, Apple iOS and Google Android. Stage3D is similar in purpose and design to WebGL.

Feature levels in Direct3D define strict sets of features required by certain versions of the Direct3D API and runtime, as well as additional optional feature levels available within the same API version.

WebXR Device API is a Web application programming interface (API) that describes support for accessing augmented reality and virtual reality devices, such as the HTC Vive, Oculus Rift, Google Cardboard, HoloLens, Magic Leap or Open Source Virtual Reality (OSVR), in a web browser. The WebXR Device API and related APIs are standards defined by W3C groups, the Immersive Web Community Group and Immersive Web Working Group. While the Community Group works on the proposals in the incubation period, the Working Group defines the final web specifications to be implemented by the browsers.

This is a glossary of terms relating to computer graphics.

Cg (programming language) Shading language

Cg and High-Level Shader Language (HLSL) are two names given to a high-level shading language developed by Nvidia and Microsoft for programming shaders. Cg/HLSL is based on the C programming language and although they share the same core syntax, some features of C were modified and new data types were added to make Cg/HLSL more suitable for programming graphics processing units.

References

  1. "D3DX Functions (Direct3D 11 Graphics)". Microsoft.
  2. 1 2 "Living without D3DX". MSDN. 20 August 2013.
  3. 1 2 3 Microsoft. "Where is the DirectX SDK?". Microsoft. Retrieved 28 June 2020.
  4. "DirectXMath". GitHub. 17 February 2022.
  5. "DirectX Tool Kit for DX11". GitHub. 18 February 2022.
  6. "DirectXTex texture processing library". GitHub. 16 February 2022.
  7. "DirectXMesh geometry processing library". GitHub. 18 February 2022.
  8. "UVAtlas isochart texture atlasing library". GitHub. 15 February 2022.
  9. "DXUT for Direct3D 11". GitHub. 12 February 2022.
  10. "Effects for Direct3D 11". GitHub. 12 February 2022.
  11. Microsoft. "Helper Structures and Functions for D3D12". Microsoft. Retrieved 28 June 2020.
  12. "D3DX12". GitHub.
  13. "DirectX Tool Kit for DX12". GitHub. 18 February 2022.