diff --git a/Compositor/Effects/building.eff b/Compositor/Effects/building.eff
index 7298777ff..5ddeec3e7 100644
--- a/Compositor/Effects/building.eff
+++ b/Compositor/Effects/building.eff
@@ -63,12 +63,6 @@
Aircraft/Generic/Effects/CubeMaps/buildings/D.png
-
-
- 2d
- clamp
- clamp
-
0.0
0
diff --git a/Compositor/Shaders/ALS/building-default.vert b/Compositor/Shaders/ALS/building-default.vert
index 813b2040c..0640592a7 100644
--- a/Compositor/Shaders/ALS/building-default.vert
+++ b/Compositor/Shaders/ALS/building-default.vert
@@ -35,6 +35,8 @@ varying vec3 relPos;
varying float yprime_alt;
varying float mie_angle;
+varying float flogz;
+
uniform int colorMode;
uniform float hazeLayerAltitude;
uniform float terminator;
@@ -116,6 +118,7 @@ void main()
position = position + instancePosition.xyz;
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
+ flogz = 1.0 + gl_Position.w;
// Texture coordinates are stored as:
// - a separate offset (x0, y0) for the wall (wtex0x, wtex0y), and roof (rtex0x, rtex0y)
diff --git a/Compositor/Shaders/ALS/building-model-ultra.vert b/Compositor/Shaders/ALS/building-model-ultra.vert
index af1489c25..84e6ebe2b 100644
--- a/Compositor/Shaders/ALS/building-model-ultra.vert
+++ b/Compositor/Shaders/ALS/building-model-ultra.vert
@@ -16,6 +16,8 @@ varying vec3 vViewVec;
varying vec3 vertVec;
varying vec3 reflVec;
+varying float flogz;
+
varying float alpha;
attribute vec3 tangent;
@@ -184,4 +186,5 @@ void main(void)
gl_FrontColor = vec4(1.0,1.0,1.0,1.0);
}
gl_Position = gl_ModelViewProjectionMatrix * vec4(rawpos,1.0);
+ flogz = 1.0 + gl_Position.w;
}