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_v3_v3v3()(blenlib/intern/math_vector.c), reflect()(cycles/util/util_math_float3.c) and 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)?
The operation of exchanging all points of a mathematical object with their mirror images (i.e., reflections in a mirror).
The term reflection can also refer to the reflection of a ball, ray of light, etc. off a flat surface.