diff options
author | Dave Parks <davep@lindenlab.com> | 2013-05-17 13:54:58 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2013-05-17 13:54:58 -0500 |
commit | 88a42cd453b19e66551a36d635981da5aaa04933 (patch) | |
tree | 23e2172367f957cb8905e04fcdb32403f27c5e56 /indra/newview/app_settings/shaders/class2 | |
parent | 559934705fd766430ccdd4b4e41e26a277f63637 (diff) |
NORSPEC-187 Add directionality to ambient lighting.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-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; |