fixed reflections in VR
[laserbrain_demo] / sdr / lightmap.p.glsl
index 37b2abb..034da25 100644 (file)
@@ -5,6 +5,7 @@ uniform sampler2D texmap;
 uniform sampler2D lightmap;
 #ifdef USE_MIRROR
 uniform sampler2D mirrortex;
+uniform vec2 mirtex_offs;
 uniform vec2 mirtex_scale;
 uniform float reflectivity;
 #endif
@@ -23,7 +24,7 @@ void main()
 #endif
 
 #ifdef USE_MIRROR
-       vec3 refl = texture2D(mirrortex, gl_FragCoord.xy * mirtex_scale).rgb;
+       vec3 refl = texture2D(mirrortex, (gl_FragCoord.xy + mirtex_offs) * mirtex_scale).rgb;
        diffuse += refl * reflectivity; // just add it to diffuse until we get another source of specularity
 #endif