diff options
author | Dave Parks <davep@lindenlab.com> | 2013-05-17 12:19:08 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2013-05-17 12:19:08 -0500 |
commit | e6c2a7652952f60f26cdee4484128c45340240ee (patch) | |
tree | 04a562385d722609735fe41b3e67e248d8fd2c0e /indra/newview | |
parent | f18fd226c32747dfb53f4d4f7b00b7d682133d5e (diff) |
NORSPEC-187 Directional ambient work in progress.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 10 |
1 files changed, 9 insertions, 1 deletions
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; |