summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl6
2 files changed, 10 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 565c00ba79..14af657e67 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -96,7 +96,11 @@ 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;
+ if (temp2.y > 0.001f)
+ {
+ temp2.y = 1. / temp2.y;
+ }
+ temp2.y = max(0.001f, temp2.y);
sunlight *= exp(-light_atten * temp2.y);
// main atmospheric scattering line integral
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index bef7a8827a..6c4098b9fb 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -91,7 +91,11 @@ void calcAtmospherics(vec3 inPositionEye) {
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
temp2.y = max(0.0, tmpLightnorm.y);
- temp2.y = 1. / temp2.y;
+ if (temp2.y > 0.001f)
+ {
+ temp2.y = 1. / temp2.y;
+ }
+ temp2.y = max(0.001f, temp2.y);
sunlight *= exp( - light_atten * temp2.y);
// main atmospheric scattering line integral