OpenGL2: Fix TCGEN_ENVIRONMENT stages not rendering correctly.

This commit is contained in:
SmileTheory committed 2013-10-10 03:41:31 -07:00
1 parent a836c2db89
commit f8355ba2fb
7 files changed
+34 -19

No files matched your search

+2 -1
View File
@@ -22,6 +22,7 @@ attribute vec3 attr_LightDirection;
#if defined(USE_TCGEN) || defined(USE_NORMALMAP) || defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
uniform vec3 u_ViewOrigin;
uniform vec3 u_LocalViewOrigin;
#endif
#if defined(USE_TCGEN)
@@ -94,7 +95,7 @@ vec2 GenTexCoords(int TCGen, vec3 position, vec3 normal, vec3 TCGenVector0, vec3
}
else if (TCGen == TCGEN_ENVIRONMENT_MAPPED)
{
vec3 viewer = normalize(u_ViewOrigin - position);
vec3 viewer = normalize(u_LocalViewOrigin - position);
tex = -reflect(viewer, normal).yz * vec2(0.5, -0.5) + 0.5;
}
else if (TCGen == TCGEN_VECTOR)