summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
diff options
context:
space:
mode:
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 1bc576a4ec..68a735e813 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -194,7 +194,8 @@ void main()
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);
+
float final_da = da;
final_da = clamp(final_da, 0.0f, 1.0f);
final_da = pow(final_da, 1.0/1.3);
@@ -204,13 +205,13 @@ void main()
color.rgb = amblit;
color.a = final_alpha;
- float ambient = abs(da);
+ float ambient = da;
ambient *= 0.5;
ambient *= ambient;
ambient = max(0.9, ambient); // keeps shadows dark
ambient = 1.0 - ambient;
- vec3 sun_contrib = min(final_da, shadow) * sunlit;
+ vec3 sun_contrib = mix(final_da, min(final_da, shadow), 0.1) * sunlit;
color.rgb *= ambient;
color.rgb += sun_contrib;