summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index efcf848ab1..565c00ba79 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -67,7 +67,11 @@ vec3 atmosLighting(vec3 light)
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten) {
vec3 P = inPositionEye;
-
+
+ //(TERRAIN) limit altitude
+ if (P.y > max_y) P *= (max_y / P.y);
+ if (P.y < -max_y) P *= (-max_y / P.y);
+
vec3 tmpLightnorm = lightnorm.xyz;
vec3 Pn = normalize(P);
@@ -93,7 +97,7 @@ void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit,
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
temp2.y = max(0.0, tmpLightnorm.y);
temp2.y = 1. / temp2.y;
- sunlight *= exp( - light_atten * temp2.y);
+ sunlight *= exp(-light_atten * temp2.y);
// main atmospheric scattering line integral
temp2.z = Plen * density_multiplier;