unity-game-engineshaderlab

What does "2..xxx" mean in shaderlab?


float3 f = float3(1,2,3);
f *= 2..xxx;

I have no idea what ..xxx does. I got the code from here


Solution

  • It's a "swizzle" operation. In this case of a scalar constant 2.0. 2..xxx is equivalent to float3(2.0, 2.0, 2.0)

    You can find more info here in the "Vector swizzle operator" section.