HLSL着色器可接受的输入输出语义

顶点着色器

These semantics have meaning when attached to a vertex-shader parameters. These semantics are supported in both Direct3D 9 and Direct3D 10.

InputDescriptionType
BINORMAL[n]Binormalfloat4
BLENDINDICES[n]Blend indicesuint
BLENDWEIGHT[n]Blend weightsfloat
COLOR[n]Diffuse and specular colorfloat4
NORMAL[n]Normal vectorfloat4
POSITION[n]Vertex position in object space.float4
POSITIONTTransformed vertex position.float4
PSIZE[n]Point sizefloat
TANGENT[n]Tangentfloat4
TEXCOORD[n]Texture coordinatesfloat4
OutputDescriptionType
COLOR[n]Diffuse or specular colorfloat4
FOGVertex fogfloat
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
PSIZEPoint sizefloat
TESSFACTOR[n]Tessellation factorfloat
TEXCOORD[n]Texture coordinatesfloat4

 

n is an optional integer between 0 and the number of resources supported. For example, POSITION0, TEXCOOR1, etc.

像素着色器

Pixel Shader Semantics

These semantics have meaning when attached to a pixel-shader input parameter. These semantics are supported in both Direct3D 9 and Direct3D 10.

InputDescriptionType
COLOR[n]Diffuse or specular color.float4
TEXCOORD[n]Texture coordinatesfloat4
VFACEFloating-point scalar that indicates a back-facing primitive. A negative value faces backwards, while a positive value faces the camera.float
VPOSThe 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
OutputDescriptionType
COLOR[n]Output colorfloat4
DEPTH[n]Output depthfloat

 

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).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值