HLSL semantics POSITION vs SV_POSITION,
Members - Reputation: 125
Posted 14 August 2010 - 10:37 AM
I do not understand the difference between some of the semantics used in HLSL.
What is the difference between POSITION and SV_POSITION Semantics? It is explained in http://msdn.microsoft.com/en-us/library/bb509647(VS.85).aspx. But I do not understand it well. Is there a precision or speed difference?
DirectX SDK has a sample called DetailTessellation11. It uses semantics WORLDPOS, LIGHTVECTORTS in its shader. Where is it defined? What do they do?
Moderators - Reputation: 17741
Posted 14 August 2010 - 11:48 AM
Any other semantics are defined completely by the user, and have no specific meaning. Their only purpose is to match the outputs from one stage of the pipeline to the inputs of another stage.
Prior to DX10, all semantics were essentially system vale semantics and they were all predefined. Back then, the POSITION semantic was used for both the input vertex position as well as the transformed output vertex position. So you'll see it a lot in older shader code, or DX10 code compiled in compatibilty mode.