D3dx
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, D3DX (Direct3D Extension) is a high level API
Application programming interface
An application programming interface is a source code based specification intended to be used as an interface by software components to communicate with each other...

 library which is written to supplement Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

's Direct3D
Direct3D
Direct3D is part of Microsoft's DirectX application programming interface . Direct3D is available for Microsoft Windows operating systems , and for other platforms through the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems...

 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/sphere generators.

The D3DX library contains pre-written routines for doing things common to most 2D/3D applications, such as games. Since the Direct3D
Direct3D
Direct3D is part of Microsoft's DirectX application programming interface . Direct3D is available for Microsoft Windows operating systems , and for other platforms through the open source software Wine. It is the base for the graphics API on the Xbox and Xbox 360 console systems...

 API is relatively low-level, using the D3DX library is usually much simpler.

Interfaces

The D3DX library follows the COM
Component Object Model
Component Object Model is a binary-interface standard for software componentry introduced by Microsoft in 1993. It is used to enable interprocess communication and dynamic object creation in a large range of programming languages...

 object oriented programming model. Functionality is accessed using C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

-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
Precomputed Radiance Transfer
Precomputed Radiance Transfer is a computer graphics technique used to render a scene in real time with complex light interactions being precomputed to save time...

 - 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
Sprite (computer graphics)
In computer graphics, a sprite is a two-dimensional image or animation that is integrated into a larger scene...

 in computer graphics
Computer graphics
Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer with help from specialized software and hardware....

. In DirectX 7
DirectX
Microsoft DirectX is a collection of application programming interfaces 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,...

 this was typically done using the DirectDraw
DirectDraw
DirectDraw is part of Microsoft's DirectX API. DirectDraw is used to render graphics in applications where top performance is important. DirectDraw also allows applications to run fullscreen or embedded in a window such as most other MS Windows applications. DirectDraw uses hardware acceleration if...

 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.

D3DXComputeTangentFrame

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.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK