Hello,
I’ve read the shader reference Unity - Manual: ShaderLab, particularly the surface shader reference, but I didn’t find the answer to some questions:
-
how can I obtain the individual channels of the hsl (hue, saturation, lightness) model from a color vector? Alternatively the individual rgb channels.
-
what’s the magnitude of the built-in vectors like lightDir and viewDir and Normal? If viewDir is a unit vector, what’s the actual distance from the pixel to the camera?
-
viewDir and such are part of the lighting models function arguments, yet what about the “pixel” part (typically “surf”). How can I use them there?
-
How do I multiply a vector (eg half3) with a scalar (eg. half) ? Simply half * half3 ?
The program probably uses Cg as the shading language (the same as in the examples of the reference and tutorials on the Website )
This is all for now, thank you and have fun!