WebGL light source and cube map rotate with the viewer
I was trying to implement lighting and environment mapping in WebGL. I got this weird bug that my light source and cube map rotate with my eye position. For example, when I "fly" to the back of my object I can still see the specular reflection and the front of my cube map... This is the code for calculating the reflection vector..
vec4 N = invertMVM*vNormal; R = reflect(eyePos.xyz, N.xyz);
I got it.. Using the modleViewMat to transform the reflection vector works.