I am working on adding reflection to a grid, but I am having rather big problems understanding what is going wrong. The grid is a screen space grid made following this tutorial: http://jeremybouny.fr/en/articles/screen_space_grid/
I do like this to project the reflections:
vec3 eye_w = gl_ModelViewMatrixInverse.xyz; vec3 incident = gl_Vertex.xyz - eye_w; vec3 reflected = reflect(incident, gl_Vertex); refTexcoord =normalize(reflected);
vec4 color = texture2D(mainTex, vec2(refTexcoord.xy));
But the result:
Any idea what is happening?