summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
authorGraham Madarasz (Graham) <graham@lindenlab.com>2013-05-17 14:28:29 -0700
committerGraham Madarasz (Graham) <graham@lindenlab.com>2013-05-17 14:28:29 -0700
commit2ff880ddb151ee3bb074f507f58f60bdebc458e8 (patch)
tree7450fa452069abe625ec28933d71032bacda7e48 /indra/newview/app_settings/shaders/class2/deferred
parent74c1bc29e7dc566c7bb1a654b1dbf632d39dcb17 (diff)
parent0ed964fd20c4b55e41d933b41f47583224754025 (diff)
Merge vwr-dev-mat
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/alphaV.glsl9
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl10
2 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index 127c1709b8..13c6ffc607 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -83,6 +83,8 @@ uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
uniform vec3 light_diffuse[8];
+uniform vec3 sun_dir;
+
vec3 calcDirectionalLight(vec3 n, vec3 l)
{
float a = max(dot(n,l),0.0);
@@ -190,6 +192,13 @@ void main()
// Add windlight lights
col.rgb = atmosAmbient(col.rgb);
+ float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0);
+ ambient *= 0.5;
+ ambient *= ambient;
+ ambient = (1.0-ambient);
+
+ col.rgb *= ambient;
+
vary_directional.rgb = atmosAffectDirectionalLight(1.0f);
vary_ambient = col.rgb*dff;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 10a598a85c..ee6aaddb00 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -296,7 +296,7 @@ void main()
float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
vec4 diffuse = texture2DRect(diffuseRect, tc);
-
+
vec3 col;
float bloom = 0.0;
@@ -310,6 +310,14 @@ void main()
calcAtmospherics(pos.xyz, ambocc);
col = atmosAmbient(vec3(0));
+
+ float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0);
+ ambient *= 0.5;
+ ambient *= ambient;
+ ambient = (1.0-ambient);
+
+ col *= ambient;
+
col += atmosAffectDirectionalLight(max(min(da, scol) * 2.6, diffuse.a));
col *= diffuse.rgb;