summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-10 14:50:59 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-10 14:50:59 -0700
commit664722168d7016d8bf80a65626bbff542913dc24 (patch)
tree688a2097614bb99d9e0c982a42db98ea6aed0560 /indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
parentd23bf2c16e2d36b18c920bbd42f49c47f3c58bd9 (diff)
SL-1491
Make sun additive contribition depend on facing the sun (without breaking fog). Put back scaling factor keeping sun contrib from blowing out with new FS param range for glow.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl7
1 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 15408b3475..759c49a0fa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -75,7 +75,7 @@ vec2 encode_normal (vec3 n);
vec3 scaleSoftClipFrag(vec3 l);
vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten);
-void calcAtmosphericVars(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive, bool use_ao);
+void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 atten, out vec3 additive, bool use_ao);
#ifdef HAS_SHADOW
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
@@ -201,6 +201,8 @@ void main()
}
#else
+ vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
+
float final_alpha = diffuse_linear.a * vertex_color.a;
diffuse_srgb.rgb *= vertex_color.rgb;
diffuse_linear.rgb *= vertex_color.rgb;
@@ -210,11 +212,10 @@ void main()
vec3 additive;
vec3 atten;
- calcAtmosphericVars(pos.xyz, 1.0, sunlit, amblit, additive, atten, false);
+ calcAtmosphericVars(pos.xyz, light_dir, 1.0, sunlit, amblit, additive, atten, false);
vec2 abnormal = encode_normal(norm.xyz);
- vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
float da = dot(norm.xyz, light_dir.xyz);
da = clamp(da, -1.0, 1.0);