I don't understand how semantics are used in shaders. While reading Unity's shader tutorials, I come across this
struct v2f {
float worldPos: TEXCOORD0;
half3 worldNormal: TEXCOORD1;
float4 pos : SV_POSITION;
};
and also this
struct v2f {
float3 worldPos : TEXCOORD0;
half3 tspace0 : TEXCOORD1;
half3 tspace1 : TEXCOORD2;
half3 tspace2 : TEXCOORD3;
float2 uv : TEXCOORD4;
float4 pos : SV_POSITION;
};
Microsoft's documentation says
A semantic is a string attached to a shader input or output that conveys information about the intended use of a parameter.
I know there is some kind of interpolation of data because vertices and pixels aren't one to one, thus I think semantics are used for telling the graphics library what to do about the data. But here it uses TEXCOORDX for things like world position and tangent space vectors. They don't seem to have anything to do with UV coordinates. So how are these semantics actully used?