What's New in DirectX Graphics
--------------------------------------------------------------------------------
This section describes Microsoft DirectX graphics features that are new or changed in the DirectX 9.0 SDK Update (Summer 2004).
Draw Multiple Instances of Geometry More Efficiently
Effect System Improvements Include Preshaders and Parameter Blocks
HLSL Supports Shader Model 3
Add User Intent to Effects with Standard Annotations and Semantics
Sample Framework
Investigating Performance with PIX
Precomputed Radiance Transfer
To convert applications from DirectX 8, see Converting to DirectX 9.0.
Some application programming interface (API) elements have been changed or removed. See D3DX API Changes.
Draw Multiple Instances of Geometry More Efficiently
Given a scene that contains many objects that use the same geometry, you can draw many instances of that geometry at different orientations, sizes, colors, and so on with dramatically better performance by reducing the amount of data you need to supply to the renderer.
This technique uses two vertex buffers: one to supply geometry data and one to supply per-object instance data. Instancing requires a device that supports vs_3_0. Because the Microsoft Direct3D runtime software vertex-processing implementation supports vs_3_0 (without the best performance available with a hardware implementation), you can use instancing with software vertex processing (see D3DCREATE_SOFTWARE_VERTEXPROCESSING). This style of instancing, which uses a vertex buffer for geometry and a vertex buffer for the instance data, is not supported in the fixed function pipeline but is available in vs_2_0 and vs_3_0 (though, again, only on devices that support vs_3_0). For more information, see Drawing Multiple Instances of Geometry Efficiently.
Effect System Improvements Include Preshaders and Parameter Blocks
There are a number of improvements with the effect system such as:
Effect Rendering
Effect Preshaders
Effect Parameter Sharing and Parameter Blocks
Effect Rendering
The sequence of calls for applying effect state to a device has changed to the following:
ID3DXEffect::Begin starts the active technique.
ID3DXEffect::BeginPass begins a pass.
ID3DXEffect::CommitChanges updates changes to any set calls in the pass.
ID3DXEffect::EndPass ends a pass.
ID3DXEffect::End ends the active technique.
You no longer call ID3DXEffect:
ass because it has been removed from the header file. For more information, see Render An Effect.
Effect Preshaders
Preshaders improve the efficiency of an effect. See PreShaders Improve Performance.
Effect Parameter Sharing and Parameter Blocks
Use an ID3DXEffectPool interface to share effect parameters. See Sharing Effect Parameters.
Use parameter blocks to help manage the parameters in one or more effects. See Use Parameter Blocks to Manage Effect Parameters.
HLSL Supports Shader Model 3
High-level shader language (HLSL) now supports shader model 3 for vertex and pixel shaders (see Shader Model 3). The shader models are simplified considerably from earlier shader versions. As a result, if you are implementing shaders in hardware, you may only use vs_3_0 with ps_3_0, and you may not use either shader type with the fixed function pipeline. These changes make it possible to simplify drivers and the runtime.
HLSL pixel shader input semantics must have matching semantics in vertex shader output semantics. Some examples are shown in Match Semantics on vs_3_0 and ps_3_0 Shaders.
For additional improvements, see Shader Model 3.
Add User Intent to Effects with Standard Annotations and Semantics
To communicate information about effect parameters that are intended to be shared between effects and applications, Microsoft is working with its partners to create a set of industry-standard semantics and annotations. These can be attached to shared parameters to allow applications to understand standardized effects.
The reference section has a list of these Standard Semantics Reference and Standard Annotations Reference which can be attached to effect parameters, techniques, and passes. For information about using them, see Using Standard Semantics and Standard Annotations.
Sample Framework
The DirectX software development kit (SDK) samples are now authored in a new function-based Sample Framework. In addition to looking at the new Samples, you can also see documentation on the sample framework at Sample Framework Reference.
Investigating Performance with PIX
A new tool designed to capture detailed performance information from a running application is now available. It is called PIX for Windows and is available at the following location:
(SDK root)\Utilities\PIX\PIX.exe
To help get started, see the PIX for Windows Tutorial.
Precomputed Radiance Transfer
To simulate scenes with precomputed radiance transfer (PRT), use the following D3DX interfaces and functions, which largely replace previous PRT functions:
ID3DXPRTBuffer
ID3DXPRTCompBuffer
ID3DXPRTEngine
ID3DXTextureGutterHelper
Precomputed Radiance Transfer Functions
Also see PRT Overview.