Turbonoob question, I’m trying to make sense out of shaders so I’m starting out small. I apologize in advance if the question is missplaced or pointless.
I create this very small shader with a VertexNormalWs and a mask on the red channel, this makes the rendering sphere white on the x-axis and black on the other side, as that is -1:
Why does it do this? Why does it become colored when multiple channels are turned on, but only white according to its axis when singular channels are turned on?
It’s because you’re mixing the 2 or 3 channels of data from the VertexNormal in to the RGB - in the example of 2 channels (masking R&G) , it’s black where both R and G are -1, Red where R is 1 and Green is -1, and when Red is 1 and Green is 1 - thats RGB=1,1,0 - mixed together, that’s yellow. Think of it like you’re adding “1” part of Green Paint and “1” part of Red Paint…
The same applies for the 3 channel mix, but with all 3 channels combining.
I suspected this, but if this is the case, why are the first two pictures white? Surely, picture number 1 (showing red channel mask) should be red and black, and picture number 2 (green) should be green and black? This is the part I can’t wrap my head around.