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

<span class="mw-page-title-main">DirectX</span> 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.

<span class="mw-page-title-main">OpenGL</span> 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.

<span class="mw-page-title-main">Allegro (software library)</span> Software library for video game development

Allegro is a software library for video game development. The functionality of the library includes support for basic 2D graphics, image manipulation, text output, audio output, MIDI music, input and timers, as well as additional routines for fixed-point and floating-point matrix arithmetic, Unicode strings, file system access, file manipulation, data files, and 3D graphics. The library is written in the C programming language and designed to be used with C, C++, or Objective-C, with bindings available for Python, Lua, Scheme, D, Go, and other languages. Allegro comes with extensive documentation and many examples.

<span class="mw-page-title-main">Rasterisation</span> Conversion of a vector-graphics image to a raster image

In computer graphics, rasterisation or rasterization is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image. The rasterized image may then be displayed on a computer display, video display or printer, or stored in a bitmap file format. Rasterization may refer to the technique of drawing 3D models, or to the conversion of 2D rendering primitives, such as polygons and line segments, into a rasterized format.

DirectDraw (ddraw.dll) is an API that used to be a part of Microsoft's DirectX API. DirectDraw is used to accelerate rendering of 2D graphics in applications. DirectDraw also allows applications to run fullscreen or embedded in a window such as most other MS Windows applications. DirectDraw uses hardware acceleration if it is available on the client's computer. DirectDraw allows direct access to video memory, hardware overlays, hardware blitters, and page flipping. Its video memory manager can manipulate video memory with ease, taking full advantage of the blitting and color decompression capabilities of different types of display adapters.

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.

<span class="mw-page-title-main">High-Level Shader Language</span> 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.

<span class="mw-page-title-main">Shader</span> Type of program in a graphical processing unit (GPU)

In computer graphics, a shader is a computer program that calculates the appropriate levels of light, darkness, and color during the rendering of a 3D scene—a process known as shading. Shaders have evolved to perform a variety of specialized functions in computer graphics special effects and video post-processing, as well as general-purpose computing on graphics processing units.

<span class="mw-page-title-main">Torque (game engine)</span> 3D computer game engine

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.

A shading language is a graphics programming language adapted to programming shader effects. Shading languages usually consist of special data types like "vector", "matrix", "color" and "normal".

<span class="mw-page-title-main">Free and open-source graphics device driver</span> Software that controls computer-graphics hardware

A free and open-source graphics device driver is a software stack which controls computer-graphics hardware and supports graphics-rendering application programming interfaces (APIs) and is released under a free and open-source software license. Graphics device drivers are written for specific hardware to work within a specific operating system kernel and to support a range of APIs used by applications to access the graphics hardware. They may also control output to the display if the display driver is part of the graphics hardware. Most free and open-source graphics device drivers are developed by the Mesa project. The driver is made up of a compiler, a rendering API, and software which manages access to the graphics hardware.

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 is the graphic driver architecture for video card drivers running Microsoft Windows versions beginning with Windows Vista.

<span class="mw-page-title-main">WebGL</span> JavaScript bindings for OpenGL in web browsers

WebGL is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics, image processing, and effects in the HTML canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.

<span class="mw-page-title-main">Vertex (computer graphics)</span>

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.

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.

This is a glossary of terms relating to computer graphics.

<span class="mw-page-title-main">Art of Illusion</span>

Art of Illusion is a free software, and open source software package for making 3D graphics.

<span class="mw-page-title-main">Cg (programming language)</span> 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.