diff options
author | Graham Linden <graham@lindenlab.com> | 2019-04-04 17:19:59 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-04-04 17:19:59 -0700 |
commit | c699ee9a7f102aa541dcc102e8fa1de2d6c55bde (patch) | |
tree | def96651f72240631470b900e63858f79349ee53 /indra/newview/app_settings/shaders/class2 | |
parent | e4c281c134994a32cc006d7036aa811f9ed33799 (diff) |
SL-10854
Clamp ambient contrib to get darker shadows.
New PCF sampling func.
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 7f1d518dd6..0c9dc5da58 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -98,15 +98,18 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float da = dot(normalize(norm.xyz), light_dir.xyz); - da = clamp(da, 0.0, 1.0); - - float light_gamma = 1.0/1.3; - da = pow(da, light_gamma); vec4 diffuse = texture2DRect(diffuseRect, tc); scol = max(scol_ambocc.r, diffuse.a); + 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); vec3 col; float bloom = 0.0; @@ -123,9 +126,9 @@ void main() float ambient = abs(da); ambient *= 0.5; ambient *= ambient; - ambient = 1.0 - ambient; + ambient = 1.0 - max(0.9, ambient); - vec3 sun_contrib = min(da,scol) * sunlit; + vec3 sun_contrib = final_da * sunlit; col.rgb = amblit; col.rgb *= ambient; |