?/TD> |
Microsoft DirectX 9.0 |
When in operation, a programmable vertex shader replaces the transformation and lighting module in the Microsoft?Direct3D?geometry pipeline. In effect, state information regarding transformation and lighting operations are ignored. However, when the vertex shader is disabled and fixed function processing is returned, all current state settings apply.
Any tessellation of high-order primitives should be done before execution of the vertex shader. Implementations that perform surface tessellation after the shader processing must do so in a way that is not apparent to the application and shader code. Because no semantic information is normally provided before the shader, a special token is used to identify which input stream component represents the base position relative to which all other components are interpolated. No noninterpolable data channels are supported.
On output, the vertex shader must generate vertex positions in homogeneous clip space. Additional data that can be generated includes texture coordinates, colors, fog factors and so on.
The standard graphics pipeline processes the vertices output by the shader, including the following tasks.
Clipping space is the same for Microsoft DirectX?9.0 vertex shaders and fixed function vertex processing. For details, see Clipping Volumes.
Programmable geometry is a mode within the Direct3D application programming interface (API). When it is enabled, it partially replaces the vertex pipeline. When it is disabled, the API switches back to fixed function vertex processing. Execution of vertex shaders does not change the internal Direct3D state, and no Direct3D state is available for shaders.
Use IDirect3DDevice9::CreateVertexShader to create a vertex shader, and IDirect3DDevice9::SetVertexShader to set the programmable shader before making any Draw calls.