diff options
author | Graham Linden <graham@lindenlab.com> | 2019-04-05 14:35:55 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-04-05 14:35:55 -0700 |
commit | fff2aecf7f96de9e53620887210487a48dd45580 (patch) | |
tree | c49ec5b62bbcd87069916212aab3506405efd2e3 /indra/newview/app_settings/shaders/class2 | |
parent | 39803f29c6b8dec710fb4b0244a81734bd95644a (diff) |
SL-10821
Fix directionality of da and preserve bumps on completely shadowed areas.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 92888e0fd2..688e4e1d59 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -99,6 +99,7 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float da = dot(normalize(norm.xyz), light_dir.xyz); + da = clamp(da, -1.0, 1.0); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -122,13 +123,13 @@ void main() calcFragAtmospherics(pos.xyz, ambocc, sunlit, amblit, additive, atten); - float ambient = abs(da); + float ambient = da; ambient *= 0.5; ambient *= ambient; ambient = max(0.9, ambient); ambient = 1.0 - ambient; - vec3 sun_contrib = min(scol, final_da) * sunlit; + vec3 sun_contrib = mix(final_da, min(scol, final_da), 0.1) * sunlit; col.rgb = amblit; col.rgb *= ambient; |