顶点着色器
These semantics have meaning when attached to a vertex-shader parameters. These semantics are supported in both Direct3D 9 and Direct3D 10.
Input | Description | Type |
---|---|---|
BINORMAL[n] | Binormal | float4 |
BLENDINDICES[n] | Blend indices | uint |
BLENDWEIGHT[n] | Blend weights | float |
COLOR[n] | Diffuse and specular color | float4 |
NORMAL[n] | Normal vector | float4 |
POSITION[n] | Vertex position in object space. | float4 |
POSITIONT | Transformed vertex position. | float4 |
PSIZE[n] | Point size | float |
TANGENT[n] | Tangent | float4 |
TEXCOORD[n] | Texture coordinates | float4 |
Output | Description | Type |
COLOR[n] | Diffuse or specular color | float4 |
FOG | Vertex fog | float |
POSITION[n] | Position of a vertex in homogenous space. Compute position in screen-space by dividing (x,y,z) by w. Every vertex shader must write out a parameter with this semantic. | float4 |
PSIZE | Point size | float |
TESSFACTOR[n] | Tessellation factor | float |
TEXCOORD[n] | Texture coordinates | float4 |
n is an optional integer between 0 and the number of resources supported. For example, POSITION0, TEXCOOR1, etc.
像素着色器
These semantics have meaning when attached to a pixel-shader input parameter. These semantics are supported in both Direct3D 9 and Direct3D 10.
Input | Description | Type |
---|---|---|
COLOR[n] | Diffuse or specular color. | float4 |
TEXCOORD[n] | Texture coordinates | float4 |
VFACE | Floating-point scalar that indicates a back-facing primitive. A negative value faces backwards, while a positive value faces the camera. | float |
VPOS | The pixel location (x,y) in screen space. To convert a Direct3D 9 shader (that uses this semantic) to a Direct3D 10 shader, see Direct3D 9 VPOS and Direct3D 10 SV_Position) | float2 |
Output | Description | Type |
COLOR[n] | Output color | float4 |
DEPTH[n] | Output depth | float |
n is an optional integer between 0 and the number of resources supported. For example, PSIZE0, COLOR1, etc.
The COLOR semantic is only valid in shader compatibility mode (that is, when the shader is created using D3D10_SHADER_ENABLE_BACKWARDS_COMPATIBILITY).