From 7c651f84234813eb0ceb2c72e0c19acf2bb15f55 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 27 Jun 2019 16:07:54 -0700 Subject: SL-11512 Modify method for nerfing additive on terrain so it doesn't trip up deferred lighting and make light artifacts. --- indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 3 ++- indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'indra') 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 } -- cgit v1.2.3