I notice today, that the
reflect function of the VectorMath node, uses the Normal as if it was a surface Tangent.
In mathematical terms, the reflected vector is supposed to be
R = 2*dot(I, N) - I;;
But I quickly discovered that the fuctions
reflect()(cycles/kernel/shaders/stdosl.h), they all output
R = I - 2*dot(I, N);
In math_vector.c, it was even added an ascii graphic and a note that for “bouncing” we should negate the result…
Going further, since stdosl.h should be very similar to the one from ImageWorks, I found out that they did the same thing (and also a clarification in the specs).
I wonder why this choice? Is there any reason to output the inverted vector (instead of the real ‘reflected’ one)?