diff options
author | Graham Linden <graham@lindenlab.com> | 2019-06-27 16:07:54 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-06-27 16:07:54 -0700 |
commit | 7c651f84234813eb0ceb2c72e0c19acf2bb15f55 (patch) | |
tree | f8fb300bf93931191a27dcd71872e4d6e0ad6367 /indra/newview | |
parent | 4b8ec2f11f94d8fe253abd5228320c545f353b58 (diff) |
SL-11512
Modify method for nerfing additive on terrain so it doesn't trip up deferred lighting and make light artifacts.
Diffstat (limited to 'indra/newview')
3 files changed, 5 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 fd1191547b..4825418fe3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -176,8 +176,9 @@ vec3 post_env = color.rgb; if (norm.w < 1) { #if !defined(SUNLIGHT_KILL) + additive *= spec.a; 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 = atmosFragLighting(color, additive * additive_angular_atten, 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 5f345078b6..b7bc92c460 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,1.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 ee39fa81f5..d4d69f07e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -185,8 +185,9 @@ vec3 post_env = color.rgb; { #if !defined(SUNLIGHT_KILL) vec3 p = normalize(pos.xyz); + additive *= spec.a; 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 = atmosFragLighting(color, additive * additive_angular_atten, atten); color = scaleSoftClipFrag(color); #endif } |