diff options
3 files changed, 6 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 0d180e5798..fd1191547b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -176,7 +176,8 @@ vec3 post_env = color.rgb; if (norm.w < 1) { #if !defined(SUNLIGHT_KILL) - color = atmosFragLighting(color, additive, atten); + float additive_angular_atten = max(0.0, dot(light_dir, normalize(pos.xyz))); + color = atmosFragLighting(color, additive * additive_angular_atten * (1.0 - spec.a), atten); color = scaleSoftClipFrag(color); #endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl index b49d86b2a2..5f345078b6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl @@ -69,7 +69,7 @@ void main() #endif frag_data[0] = outColor; - frag_data[1] = vec4(0.0,0.0,0.0,0.0); + frag_data[1] = vec4(0.0,0.0,0.0,1.0); vec3 nvn = normalize(vary_normal); frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, 0.0); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 23ed3fb3d9..ee39fa81f5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -184,7 +184,9 @@ vec3 post_env = color.rgb; if (norm.w < 1) { #if !defined(SUNLIGHT_KILL) - color = atmosFragLighting(color, additive, atten); + vec3 p = normalize(pos.xyz); + float additive_angular_atten = max(0.0, dot(light_dir.xyz, p.xyz)); + color = atmosFragLighting(color, additive * additive_angular_atten * (1.0 - spec.a), atten); color = scaleSoftClipFrag(color); #endif } |