diff --git a/Effects/model-combined.eff b/Effects/model-combined.eff
index 09ff0a567..a8d8f8c73 100644
--- a/Effects/model-combined.eff
+++ b/Effects/model-combined.eff
@@ -129,10 +129,10 @@ please see Docs/README.model-combined.eff for documentation
-
+
-
+
diff --git a/Environment/interpolator.xml b/Environment/interpolator.xml
index 23b702670..881df6d6f 100644
--- a/Environment/interpolator.xml
+++ b/Environment/interpolator.xml
@@ -245,6 +245,22 @@
+
+ EnvironmentInterpolator:model:latitude
+ /position/latitude-deg
+
+ gain
+ 1
+
+
+
+ EnvironmentInterpolator:model:longitude
+ /position/longitude-deg
+
+ gain
+ 1
+
+
EnvironmentInterpolator:wave:amp
gain
diff --git a/Shaders/ubershader-gbuffer.frag b/Shaders/ubershader-gbuffer.frag
index 9dde7f670..6df4e754a 100644
--- a/Shaders/ubershader-gbuffer.frag
+++ b/Shaders/ubershader-gbuffer.frag
@@ -142,12 +142,12 @@ void main (void)
float latRad = radians(90. - latDeg);
float lonRad = radians(lonDeg);
- mat3 rotCorrX = rotX(-lonRad);
mat3 rotCorrY = rotY(latRad);
- mat3 reflCorr = rotCorrX * rotCorrY;
+ mat3 rotCorrZ = rotZ(lonRad);
+ mat3 reflCorr = rotCorrY * rotCorrZ;
wRefVec = reflect(wVertVec,wNormal);
wRefVec = normalize(reflCorr * wRefVec);
- } else if (refl_enabled > 0) { ///static reflection
+ } else { ///static reflection
wRefVec = normalize(reflMatrix * vec4(wRefVec,0.0)).xyz;
}
diff --git a/Shaders/ubershader.frag b/Shaders/ubershader.frag
index 14d245b26..1a8507ee4 100644
--- a/Shaders/ubershader.frag
+++ b/Shaders/ubershader.frag
@@ -139,12 +139,12 @@ void main (void)
vec3 wVertVec = normalize(reflMatrix * vec4(viewVec,0.0)).xyz;
vec3 wNormal = normalize(reflMatrix * vec4(N,0.0)).xyz;
- float latRad = radians(90. - latDeg);
+ float latRad = radians(90.-latDeg);
float lonRad = radians(lonDeg);
- mat3 rotCorrX = rotX(-lonRad);
mat3 rotCorrY = rotY(latRad);
- mat3 reflCorr = rotCorrX * rotCorrY;
+ mat3 rotCorrZ = rotZ(lonRad);
+ mat3 reflCorr = rotCorrY * rotCorrZ;
wRefVec = reflect(wVertVec,wNormal);
wRefVec = normalize(reflCorr * wRefVec);
} else { ///static reflection