From 5766325290974ee2cfa30fd655060ef396d1e87a Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 25 Apr 2019 13:02:24 -0700 Subject: SL-10904, SL-10998, SL-11018 Fix handling of 1/light_y when y was tiny but getting even tinier. Add similar adjustment to shader version of same calc. --- .../app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/windlight') diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 09fb3e4c8a..93513acabe 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -81,12 +81,12 @@ void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, o haze_weight = vec4(haze_density) / temp1; //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) - temp2.y = max(0.0, tmpLightnorm.z); - if (temp2.y > 0.001f) + temp2.y = max(0.0, tmpLightnorm.y); + if (abs(temp2.y) > 0.000001f) { - temp2.y = 1. / temp2.y; + temp2.y = 1. / abs(temp2.y); } - temp2.y = max(0.001f, temp2.y); + temp2.y = max(0.0000001f, temp2.y); sunlight *= exp(-light_atten * temp2.y); // main atmospheric scattering line integral -- cgit v1.2.3