summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-03-15 08:13:04 -0700
committerGraham Linden <graham@lindenlab.com>2019-03-15 08:13:04 -0700
commita10ec81e82d79bd79d5b058fda1b370073bfb480 (patch)
treea6e7f5be307197ace5b0a58429a99d2ecfd55dac /indra/newview/app_settings/shaders/class2
parent7021c7a8db9610e0d1866c2c4cbc644e2243367e (diff)
SL-10743, SL-10744
Don't step on SUNLIGHT_COLOR uniform w/ syncLightState competing set. Put drawpool alpha render loop lighting setup changes as they were (this will give back some performance and possibly require reopening 10566).
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