summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-08-31 21:04:45 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-08-31 21:04:45 -0700
commit539fd5fcf9fa1872996fbb687b49307737f1c8b5 (patch)
treefe6b9f3322bd07aabf696d5a50400e00ef739018 /indra/newview/app_settings
parent17a957fe44539a3d076e67ffc352036051814359 (diff)
SL-17975: PBR: Don't process point light if outside light radius
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl7
1 files changed, 3 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
index 679d3dacca..c7c241b76e 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
@@ -30,7 +30,7 @@
#define DEBUG_ANY_LIGHT_TYPE 0 // Output red light cone
#define DEBUG_PBR_LIGHT_TYPE 0 // Output PBR objects in red
#define DEBUG_LEG_LIGHT_TYPE 0 // Show Legacy objects in red
-#define DEBUG_POINT_ZERO 0 // Output zero for spotlight
+#define DEBUG_POINT_ZERO 0 // Output zero for point lights
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
@@ -113,11 +113,10 @@ void main()
vec3 lv =(light [ light_idx ].xyz - pos);
calcHalfVectors(lv, n, v, h, l, nh, nl, nv, vh, lightDist);
- if (nl > 0.0)
+ float dist = lightDist / lightSize;
+ if (dist <= 1.0 && nl > 0.0)
{
- float dist = lightDist / lightSize;
float dist_atten = calcLegacyDistanceAttenuation(dist, falloff);
-
vec3 intensity = dist_atten * nl * lightColor;
colorDiffuse += intensity * BRDFLambertian (reflect0, reflect90, c_diff , specWeight, vh);
colorSpec += intensity * BRDFSpecularGGX(reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh);