From 9d20e66a0972d1405378a44b779483dad02bcff3 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 10 Aug 2022 14:52:13 -0700 Subject: SL-17763: Cleanup legacy multiSpotLight to use ambiance utility --- .../shaders/class3/deferred/multiSpotLightF.glsl | 27 +++------------------- 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index d061b3984e..86235f3b89 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -119,20 +119,6 @@ vec3 colorized_dot(float x) return vec3( 0, 0, 1 ); } -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - vec4 getPosition(vec2 pos_screen); void main() @@ -336,7 +322,7 @@ void main() proj_tc.x > 0.0 && proj_tc.y > 0.0) { - float amb_da = proj_ambiance; + float amb_da = 0; float lit = 0.0; if (nl > 0.0) @@ -351,15 +337,8 @@ void main() amb_da += (nl*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance; } - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - // use unshadowed for consistency between forward and deferred? - amb_da += (nl*nl*0.5+0.5) /* * (1.0-shadow) */ * proj_ambiance; - amb_da *= dist_atten * noise; - amb_da = min(amb_da, 1.0-lit); - - final_color += amb_da*color.rgb*diffuse.rgb*amb_plcol.rgb*amb_plcol.a; + amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, noise, proj_tc.xy ); + final_color += diffuse.rgb * amb_rgb; } if (spec.a > 0.0) -- cgit v1.2.3