From 09bb0336f15027e907fbd28130b4ffda28a830cd Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 5 Apr 2019 09:19:46 -0700 Subject: SL-10854 part 2 Clamp ambient to keep shadows dark. Apply min with shadow value after we've pow'd by light gamma consistently between forward and deferred. --- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/deferred') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 0c9dc5da58..92888e0fd2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -94,6 +94,7 @@ void main() vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; + float light_gamma = 1.0/1.3; float scol = 1.0; vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; @@ -102,12 +103,10 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); scol = max(scol_ambocc.r, diffuse.a); + //scol = pow(scol, light_gamma); float final_da = da; - final_da = min(final_da, scol); final_da = clamp(final_da, 0.0, 1.0); - - float light_gamma = 1.0/1.3; final_da = pow(final_da, light_gamma); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); @@ -126,9 +125,10 @@ void main() float ambient = abs(da); ambient *= 0.5; ambient *= ambient; - ambient = 1.0 - max(0.9, ambient); + ambient = max(0.9, ambient); + ambient = 1.0 - ambient; - vec3 sun_contrib = final_da * sunlit; + vec3 sun_contrib = min(scol, final_da) * sunlit; col.rgb = amblit; col.rgb *= ambient; -- cgit v1.2.3