- Home /
The question is answered, right answer was accepted
TEXCOORD 0 1 2 3 for cg shader scripting?
I was wondering what the differences were between TEXCOORD0 TEXCOORD1 TEXCOORD2 and TEXCOORD3 in cg shader scripting. What exactly is each one used for and when do you use it? Thanks in advance
Answer by karljj1 · Mar 01, 2015 at 12:17 AM
TEXCOORD0 is the first texture coordinate channel, TEXCOORD1 is the second and so on. Unity currently only supports 2 channels(I think 5.0 may support more).
I think the amount of supported TEXCOORDs depends on the shader level you are building for.
$$anonymous$$r Telford in the Noob to Pro shader tutorials uses 4 in a dx9 shader.
I originally thought the channels were fixed in function but I notice he interchanges them occasionally without breaking anything.
That's strange there seems to be a consensus that 2 is the limit. I know in a unity mesh you can only get to 2 in code. 4 is mentioned for 5 here http://forum.unity3d.com/threads/bindchannels-maximum-two-uv-sets.177669/
Follow this Question
Related Questions
How to force the compilation of a shader in Unity? 5 Answers
UnityObjectToClipPos is inverted? 0 Answers
Unity 5 upgrade broke lightmapped shader 1 Answer
How to get view space position of a pixel 0 Answers
Sizeof float in cg shader 1 Answer