summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/windlight
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-02-11 09:36:01 -0800
committerGraham Linden <graham@lindenlab.com>2019-02-11 09:36:01 -0800
commitaafa561215b7b69a72d00ed709d6411f6438474d (patch)
treea9063b0bd31c0c1932b3193b1164f32e561c4975 /indra/newview/app_settings/shaders/class2/windlight
parent3e0c9087cd6b26a64831f99bf9be05daa1dec510 (diff)
SL-10500
Replace clamp on height in atmospherics calcs on fragment shader path. Fix colorspace conversions in material shaders in forward rendering mode. Fix deferred shaders not setting the sun_up_factor uniform and getting moonlight instead of sunlight.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight')
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl8
1 files changed, 6 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 efcf848ab1..565c00ba79 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -67,7 +67,11 @@ vec3 atmosLighting(vec3 light)
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten) {
vec3 P = inPositionEye;
-
+
+ //(TERRAIN) limit altitude
+ if (P.y > max_y) P *= (max_y / P.y);
+ if (P.y < -max_y) P *= (-max_y / P.y);
+
vec3 tmpLightnorm = lightnorm.xyz;
vec3 Pn = normalize(P);
@@ -93,7 +97,7 @@ 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;
- sunlight *= exp( - light_atten * temp2.y);
+ sunlight *= exp(-light_atten * temp2.y);
// main atmospheric scattering line integral
temp2.z = Plen * density_multiplier;