summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-02-06 16:42:23 -0800
committerGraham Linden <graham@lindenlab.com>2019-02-06 16:42:23 -0800
commit8890c3238ab4ae8bbf1bc123284f9c6d4db4f9d6 (patch)
tree6d250b8114eb4d39a7c5810813a06d730665372b /indra/newview/app_settings/shaders/class2/windlight
parentf8171a909cb2a18fcca47f6a0317919ece802aef (diff)
SL-10478
Fix side-effects of having both sun and moon as potential directional light contributors. We pass an int to the shader indicating which to prefer instead of making per-pixel decisions and pass the moonlight color/di independently. Obsolete llsettingssky fade color which was unused elsewhere and cached for no reason.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/skyV.glsl4
4 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 683ab794d3..efcf848ab1 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -29,6 +29,8 @@ vec3 getAtmosAttenuation();
uniform vec4 gamma;
uniform vec4 lightnorm;
uniform vec4 sunlight_color;
+uniform vec4 moonlight_color;
+uniform int sun_up_factor;
uniform vec4 ambient;
uniform vec4 blue_horizon;
uniform vec4 blue_density;
@@ -75,7 +77,7 @@ void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit,
vec3 temp2 = vec3(0);
vec4 blue_weight;
vec4 haze_weight;
- vec4 sunlight = sunlight_color;
+ vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 light_atten;
//sunlight attenuation effect (hue and brightness) due to atmosphere
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index 86cdae8768..a26752f741 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -44,6 +44,8 @@ uniform vec3 camPosLocal;
uniform vec4 lightnorm;
uniform vec4 sunlight_color;
+uniform vec4 moonlight_color;
+uniform int sun_up_factor;
uniform vec4 ambient;
uniform vec4 blue_horizon;
uniform vec4 blue_density;
@@ -74,7 +76,7 @@ void calcAtmospherics(vec3 inPositionEye) {
vec3 temp2 = vec3(0);
vec4 blue_weight;
vec4 haze_weight;
- vec4 sunlight = sunlight_color;
+ vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 light_atten;
//sunlight attenuation effect (hue and brightness) due to atmosphere
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 3e3bd929e1..fb978691da 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -46,6 +46,8 @@ uniform vec3 camPosLocal;
uniform vec4 lightnorm;
uniform vec4 sunlight_color;
+uniform vec4 moonlight_color;
+uniform int sun_up_factor;
uniform vec4 ambient;
uniform vec4 blue_horizon;
uniform vec4 blue_density;
@@ -93,7 +95,7 @@ void main()
vec4 temp2 = vec4(0.);
vec4 blue_weight;
vec4 haze_weight;
- vec4 sunlight = sunlight_color;
+ vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 light_atten;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index f9f1eb7355..a65cc09c73 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -39,6 +39,8 @@ uniform vec3 camPosLocal;
uniform vec4 lightnorm;
uniform vec4 sunlight_color;
+uniform vec4 moonlight_color;
+uniform int sun_up_factor;
uniform vec4 ambient;
uniform vec4 blue_horizon;
uniform vec4 blue_density;
@@ -82,7 +84,7 @@ void main()
vec4 temp2 = vec4(0.);
vec4 blue_weight;
vec4 haze_weight;
- vec4 sunlight = sunlight_color;
+ vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4 light_atten;
// Sunlight attenuation effect (hue and brightness) due to atmosphere