From ede7b04f87806278ab7615f90958b9e7b2ff9584 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Wed, 11 Oct 2023 15:25:43 -0500 Subject: SL-20440 Followup -- fix for non-normalized vector and balance PBR spotlight with legacy spotlight --- indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index 357f3b6e3b..d31b37fb60 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -164,18 +164,19 @@ void main() float lit = 0.0; float amb_da = 0.0; + lv = normalize(lv); + if (nl > 0.0) { amb_da += (nl*0.5 + 0.5) * proj_ambiance; dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); - vec3 intensity = dist_atten * dlit * 3.9 * shadow; // Legacy attenuation, magic number to balance with legacy materials - lv = normalize(lv); + vec3 intensity = dist_atten * dlit * 3.25 * shadow; // Legacy attenuation, magic number to balance with legacy materials final_color += intensity*pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, lv); } - amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, 1.0, proj_tc.xy ); + amb_rgb = getProjectedLightAmbiance( amb_da, dist_atten, lit, nl, 1.0, proj_tc.xy ) * 3.25; //magic number to balance with legacy ambiance final_color += amb_rgb * pbrPunctual(diffuseColor, specularColor, perceptualRoughness, metallic, n.xyz, v, -lv); } } -- cgit v1.2.3