21 Jul
2006
21 Jul
'06
9:20 p.m.
On Friday 21 July 2006 11:19, Jason Green wrote:
+ /* Calculate reflection vector (Assume normal is normalized): RF = 2*(N.E)*N -E */ + shader_addline(buffer, "tmp0.w = dot(vec3(tmp0), %s);\n", src1_str); + shader_addline(buffer, "tmp0 = tmp0.w * tmp0;\n"); + shader_addline(buffer, "tmp0 = (2.0 * tmp0) - %s;\n", src1_str);
I'm hardly an expert, but couldn't this be simplified to: shader_addline(buffer, "tmp0 = reflect(-%s, vec3(tmp0));\n", src1_str);