diff options
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 1acb8d08eb..b38f488a1f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -82,6 +82,7 @@ void main() vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); + da = pow(da, 1.0/1.3); vec4 diffuse_srgb = texture2DRect(diffuseRect, tc); vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); @@ -99,7 +100,7 @@ void main() calcAtmosphericVars(pos.xyz, light_dir, ambocc, sunlit, amblit, additive, atten, false); - float ambient = da; + float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); ambient *= 0.5; ambient *= ambient; ambient = (1.0 - ambient); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 6f5b0981f9..da78691861 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -86,7 +86,7 @@ void main() vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float da = clamp(dot(normalize(norm.xyz), light_dir.xyz), 0.0, 1.0); - + da = pow(da, 1.0/1.3); vec4 diffuse_srgb = texture2DRect(diffuseRect, tc); vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); @@ -107,7 +107,7 @@ void main() calcAtmosphericVars(pos.xyz, light_dir, ambocc, sunlit, amblit, additive, atten, true); - float ambient = da; + float ambient = min(abs(dot(norm.xyz, sun_dir.xyz)), 1.0); ambient *= 0.5; ambient *= ambient; ambient = (1.0 - ambient); |