diff options
author | Oz Linden <oz@lindenlab.com> | 2013-05-17 18:06:24 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-05-17 18:06:24 -0400 |
commit | 9ef64494559dce5f7c0afb271b591036054f01ce (patch) | |
tree | 4815b3852eaf7c4465958a8c9c03865d3d84317b /indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | |
parent | 4d62a56ff9bc9f2db5d85d5549e6bb7d8a84d04a (diff) | |
parent | 2ff880ddb151ee3bb074f507f58f60bdebc458e8 (diff) |
merge changes for lastest integrations
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | 9 |
1 files changed, 9 insertions, 0 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; |