diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index dac93cee3a..d560a49c1f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -194,8 +194,12 @@ void main() vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir; float da = dot(norm.xyz, light_dir.xyz); - da = clamp(da, 0.0, 1.0); - da = pow(da, 1.0 / 1.3); + + float final_da = da; + final_da = min(final_da, shadow); + final_da = max(final_da, 0.0f); + final_da = min(final_da, 1.0f); + final_da = pow(final_da, 1.0/1.3); vec4 color = vec4(0,0,0,0); @@ -205,9 +209,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, shadow) * sunlit; + vec3 sun_contrib = final_da * sunlit; color.rgb *= ambient; color.rgb += sun_contrib; |