List of Common Semantics

在应用程序中,我们知道调用特定的接口为shader文件提供所需的数据或者语义,例如WorldViewProjection、CameraPosition等等

而在平时的Shader实践中,更多是只是使用例如RenderMonkey和FX Composer这样的IDE,因此初学者常常会不明白一些计算所需的数据从何而来

在使用RenderMonkey中,由于RenderMonkey的可视化做的比较好,我们可以在当前的工程中加入语义

List of Common Semantics_第1张图片

FX Composer中,则需要知道它的语义的具体定义,在Nvidia官网上有一篇文档里有说明 Using SAS in FX and CgFX File Formats

在此罗列如下:

Hardware Semantics

Register Names in vertex buffers and vertex‐output connections
COLOR0
COLOR1
TEXCOORD0
TEXCOORD1
TEXCOORD2
TEXCOORD3
TEXCOORD4
TEXCOORD5
TEXCOORD6
TEXCOORD7
TEXCOORD8 (synonym for COLOR0)
TEXCOORD9 (synonym for COLOR1)

ATTR0 (synonym for TEXCOORD0 sometimes seen in Cg)
ATTR1 (synonym for TEXCOORD1)
ATTR2 (synonym for TEXCOORD2)
ATTR3 (synonym for TEXCOORD3)
ATTR4 (synonym for TEXCOORD4)
ATTR5 (synonym for TEXCOORD5)
ATTR6 (synonym for TEXCOORD6)
ATTR7 (synonym for TEXCOORD7)
register(hardware_register_specifier)
POSITION
NORMAL
NORMAL0
TANGENT
TANGENT0
BINORMAL
BINORMAL0

Particle Size and Polygon Facing Flag Inputs for Pixel Shaders
PSIZE
FACE (OpenGL equivalent to VFACE)
VFACE (DirectX equivalent to FACE)

Pixel Shader Output Values
COLOR (synonym for COLOR0)
COLOR0
COLOR1
COLOR2
COLOR3

Standard Software Semantics

 

Common Material and Light Characteristics
POSITION
DIRECTION
DIFFUSE
SPECULAR

 

AMBIENT
POWER
SPECULARPOWER
CONSTANTATTENUATION
LINEARATTENUATION
QUADRATICATTENUATION
FALLOFFANGLE
FALLOFFEXPONENT
EMISSION
EMISSIVE
OPACITY
REFRACTION

 

Texture‐Related
RENDERDEPTHSTENCILTARGET
RENDERCOLORTARGET
VIEWPORTPIXELSIZE
DIFFUSEMAP
SPECULARMAP
NORMAL
ENVIRONMENT
ENVMAP
ENVIRONMENTNORMAL

 

Transforms & Locations
WORLD
VIEW
PROJECTION
WORLDVIEW
VIEW PROJECTION
WORLDVIEWPROJECTION
WORLDINVERSE
VIEWINVERSE
PROJECTIONINVERSE
WORLDVIEWINVERSE
VIEW PROJECTIONINVERSE

 

WORLDVIEWPROJECTIONINVERSE
WORLDTRANSPOSE
VIEWTRANSPOSE
PROJECTIONTRANSPOSE
WORLDVIEWTRANSPOSE
VIEW PROJECTIONTRANSPOSE
WORLDVIEWPROJECTIONTRANSPOSE
WORLDINVERSETRANSPOSE
VIEWINVERSETRANSPOSE
PROJECTIONINVERSETRANSPOSE
WORLDVIEWINVERSETRANSPOSE
VIEW PROJECTIONINVERSETRANSPOSE
WORLDVIEWPROJECTIONINVERSETRANSPOSE
TRANSFORM
LIGHTPOSITION

 

Others
STANDARDSGLOBAL
HEIGHT
UNITSSCALE

FXComposer Specific Semantics

 

FXComposer Specific Semantics
Resetting Views
FXCOMPOSER_RESETPULSE
Mouse Interactions
MOUSEPOSITION
LEFTMOUSEDOWN
RIGHTMOUSEDOWN
Timing
TIME
ELAPSEDTIME

Other Semantics Sometimes Encountered

SI_EYEPOS (use VIEWINVERSE instead)
WORLD_CAMERA_POSITION (likewise)
COS_TIME (just call cos())

 

你可能感兴趣的:(List of Common Semantics)