summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
index 05e6e6a9f9..ea2690ba09 100644
--- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
@@ -49,7 +49,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
vec3 rel_pos = inPositionEye;
//(TERRAIN) limit altitude
- rel_pos.y = clamp(rel_pos.y, -max_y, max_y);
+ if (abs(rel_pos.y) > max_y) rel_pos *= (max_y / rel_pos.y);
vec3 rel_pos_norm = normalize(rel_pos);
float rel_pos_len = length(rel_pos);