What's New in DirectX Graphics
--------------------------------------------------------------------------------
This section describes Microsoft® DirectX® graphics features that are new in DirectX 9.0. See what's new in all of DirectX at What's New in DirectX 9.0.
Programming Guide
The programming guide has been reorganized into the following sections to help you find a topic.
Converting to DirectX 9.0 - This page contains hints for converting applications to DirectX 9.0. See Converting to DirectX 9.0.
Getting Started - Fundamental topics for getting started with Microsoft Direct3D®.
Added a new page about DirectX 9.0 style vertex declarations. See Vertex Declaration.
Fixed Function - Covers the functionality of the fixed function pipeline.
Textures section - Added automatic generation of mipmaps. See Automatic Generation of Mipmaps.
Programmable Pipeline - Many new features have been added to the shader models.
Vertex and pixel shaders are no longer referred to with handles; they are objects. There is also a new section detailing the decoupling of vertex shaders and vertex declarations. See Component Object Model (COM) interfaces IDirect3DVertexShader9 and IDirect3DPixelShader9.
Shaders and vertex stream declarations are no longer bound together at creation time. Vertex stream declarations are now expressed as an array of D3DVERTEXELEMENT9 elements. For more information, see Mapping Vertex Declarations and IDirect3DDevice9::SetFVF.
Version 2 vertex shaders (vs_2_0) adds a limited form of flow control (loop...endloop, if...else...endif, and subroutines). Other features include more registers, constant setting methods (IDirect3DDevice9::SetVertexShaderConstantB, IDirect3DDevice9::SetVertexShaderConstantF, and IDirect3DDevice9::SetVertexShaderConstantI), new macro-ops for power, cross product, sign, absolute value, and linear interpolation. See Vertex Shader 2_0.
Version 2 pixel shaders (ps_2_0) decoupled texture data and sampling by creating sampler registers in addition to the texture registers. Increased the instruction count and number of registers. Added float data types. Texture address and arithmetic instructions can now be intermixed. Eliminated all modifiers except negate. New macros and instructions include sincos (sine and cosine), normalization, cross product, power, linear interpolation, projected texture load, and biased level of detail (LOD) texture load. See Pixel Shader 2_0.
Software shaders have been implemented to facilitate shader development without hardware support. The following software versions have been added: vs_2_sw, vs_3_sw, ps_2_sw, ps_3_sw.
Extended shader versions take existing shader versions and extend their functionality if certain caps are set by the hardware. Extended functionality includes features like dynamic flow control, static flow control nesting, gradient instructions, and arbitrary swizzle. For more information, see Vertex Shader 2_0 Extended and Pixel Shader 2_0 Extended.
Version 3 shaders further enhance the functionality of the extended shader versions without requiring caps to be set. Vertex shaders also add new support for vertex texturing, and control over how often vertex shader registers can be set during render calls. For more information, see Vertex Shader 3_0 and Pixel Shader 3_0.
Advanced Topics - Lots of new tools and techniques.
Adaptive tessellation can be applied to high-order primitives including N-patches, rectangle patches, and triangle patches based on the depth value of the control vertex in eye space. See Adaptive Tessellation.
Asynchronous notifications - There are a number of interesting asynchronous queries that could be made on driver status. This new functionality uses new interfaces to add asynchronous query capability. See Asynchronous Notification and IDirect3DQuery9.
Direct3D extensions (D3DX) - Added new functionality to the D3DX library to support new features, things like mesh functions, antialiased line drawing, pixel and vertex shaders, effects, math, and texturing functions. See Other Direct3D Extentions (D3DX).
Displacement mapping - Added support for displacement maps using several single-channel signed formats. See Displacement Mapping.
Gamma correction - Applications can indicate whether a texture is gamma 2.2 corrected (sRGB) or not so that the pipeline can perform gamma-correct blending. See Gamma.
Line drawing - A new interface was added for drawing antialiased lines. See Direct3D Extentions (D3DX) Line Drawing or ID3DXLine.
Multielement textures - This features allows applications to write out multiple elements of a texture simultaneously from a pixel shader. See Multielement Texture.
Multiple render targets - Support for a single render target has been extended to support multiple render targets. See Multiple Render Target.
Multihead - Multihead video cards use a common frame buffer and independent digital-to-analog converters (DACs) to offer more usable multiple-monitor support. See Multihead.
Surface locking behavior - A new locking flag, D3DLOCK_DONOTWAIT, allows an application to gain back CPU cycles if the driver cannot lock the surface immediately. See D3DLOCK.
Scissor test - The pipeline supports a scissor test, implemented with IDirect3DDevice9::SetScissorRect, IDirect3DDevice9::GetScissorRect, and a new render state, D3DRS_SCISSORTESTENABLE.
Tessellation - Tessellator support has been extended to adaptively tessellate and look up per-vertex displacement values from a displacement map. See Tessellation.
Two-sided stencil support - New support is available for adding shadows due to occluding geometry using shadow volumes. See Two-Sided Stencil.
Tutorials, Samples, Tools, and Tips - All the samples and other helpful tips and tools are gathered here. See Tutorials, Samples, Tools, and Tips.
Reference
Many new pages have been added to the reference section including:
Effects - ID3DXEffectCompiler, ID3DXBaseEffect, ID3DXEffect, ID3DXFragmentLinker, and ID3DXInclude. ID3DXSkinMesh was renamed ID3DXSkinInfo.
Effects framework. A new interface, ID3DXEffectCompiler, allows the user to compile an effect from a function or from a vertex shader. The function can be written using the High-Level Shader Language.
High-Level Language Reference - A high-level shader language exists for creating effects from vertex shaders. This gives developers the ability to create effects from a C-like language. For more information, see High-Level Shader Language.
Shader Debugger - An extension to Microsoft Visual Studio® exists to support debugging some types of vertex shaders. For more information, see Shader Debugger.
Other Features
Other new features include the following:
Dirty Regions. IDirect3DDevice9::Present now supports a dirty region by means of the fourth parameter, a pointer to a region.
2-D Support. Added support for a color-converting blit between most types of D3DPOOL_DEFAULT surfaces while using IDirect3DDevice9::StretchRect, and a color fill operation for D3DPOOL_DEFAULT surfaces while using IDirect3DDevice9::ColorFill.
Microsoft Windows® Graphics Device Interface (GDI) Interoperability. Two new methods have been added to get access to device contexts: IDirect3DSurface9::GetDC and IDirect3DSurface9::ReleaseDC.
DrawIndexedPrimitive. IDirect3DDevice9:

rawIndexedPrimitive has been changed to allow batching multiple primitives in the same index buffer without requiring multiple calls to IDirect3DDevice9::SetIndices.
Texgen Mode. The new texgen mode is to support the OpenGL-style sphere map texgen. Requires a new render state: D3DVTXPCAPS_TEXGEN_SPHEREMAP. See D3DVTXPCAPS.
ProcessVertices Behavior Change. This change enables multipass vertex processing and software pre-tessellation shaders. It enables IDirect3DDevice9::ProcessVertices to bypass the clipper and hence not compute the screen coordinates.
Mesh Copy and Update Methods. ID3DXBaseMesh::CloneMesh is used to reformat and change the vertex data layout. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before. ID3DXBaseMesh::UpdateSemantics provides a method for updating the vertex declaration with different semantic information, without changing the layout of the vertex buffer. For example, use it to re-label a 3-D texture coordinate as a binormal or tangent, or vice versa.
32-Bit Texture Formats. Two new 32-bit texture formats were added: D3DFMT_A8B8G8R8, D3DFMT_X8B8G8R8. See D3DFORMAT.
Multisampling. A new multisampling control was added to give users control over performance versus quality. See SetDialogBoxMode, SetSampler, GetSamplerState, and D3DSAMPLERSTATE
CreateImageSurface. Removed as a result of adding D3DPOOL_SCRATCH.
Enumeration. IDirect3D9::EnumAdapterModes now takes a D3DFORMAT to support an expanding set of display modes.
Sample Framework. The sample framework now includes a dialog box for supporting user selection of processing type, device type, etc. The sample framework has improved the enumeration of device caps also. See Sample Framework.
Windowed Back Buffers. They can now be of a different format than the display. Added display modes with 10 bits per color channel. Added direct support for multihead adapters.
CopyRects. This has been replaced by IDirect3DDevice9::UpdateSurface.
State Blocks. These are no longer referred to with handles. They are now objects. See IDirect3DStateBlock9.