Microsoft DirectX 8.1 (vertex shader versions 1.0, 1.1) |
Vertex shader output registers provide the inputs to the rasterizer. Output data from the vertex shader arithmetic logic unit (ALU) is written into the output registers, which have write-only access. The following table identifies the output register types.
Name | Type | I/O Permissions | Count | Versions |
---|---|---|---|---|
oD0, oD1 | Vertex color registers | write-only | 2 4-D vectors | 1.0, 1.1 |
oFog | Fog register | write-only | 1 scalar float | 1.0, 1.1 |
oPos | Position register | write-only | 1 4-D vector | 1.0, 1.1 |
oPts | Point size register | write-only | 1 scalar float | 1.0, 1.1 |
oT0 - oT7 | Texture coordinate registers | write-only | 8 4-D vectors | 1.0, 1.1 |
Register names are preceded by a lowercase o (oh), indicating that the output registers are write-only.
oD0 is the diffuse color register. oD1 is the specular color register. The oD0 value is interpolated and is written to the input color register 0 (v0) of the pixel shader. The oD1 value is interpolated and written to the input color register 1 (v1) of the pixel shader. For more information about pixel shader color registers, see Registers.
The output fog value registers. The value is the fog factor to be interpolated and then routed to the fog table. Only the scalar x-component of the fog is used. Values are clamped between zero and one before passing to the rasterizer.
The output position registers. The value is the position in homogeneous clipping space. This value must be written by the vertex shader.
The output point-size registers. Only the scalar x-component of the point size is used.
The output texture coordinates registers. Specifically, these are an array of output data registers that are iterated and used as texture coordinates by the texture sampling stages routing data to the pixel shader.
When writing to a texture coordinate register, it is recommended to pass only as many floating point values as the dimension of the corresponding texture map. Control the values passed with a modifier. For example, use .xy for a two-dimensional (2-D) texture map.
When texture projection is enabled for a texture stage, all four floating point values must be written to the corresponding texture register.
Any of the D3DTTFF* texture transform flags should be zero when the programmable pipeline is being used.
Texture Coordinate Range
Object vertex data supplies input texture coordinates. Objects that do not used tiled textures commonly have texture coordinates in the range [0,1]. Objects that use tiled textures, such as terrain, typically have texture coordinates that range from [-?,+?] where ? can be a large floating point number.
If texture coordinates are read directly into a pixel shader (using texcoord or texcrd), the texture coordinate range depends on the instruction and the pixel shader version.