diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl | 6 |
1 files changed, 5 insertions, 1 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 |