summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-04-26 08:03:17 -0700
committerGraham Linden <graham@lindenlab.com>2019-04-26 08:03:17 -0700
commitb5ba56c863184538bf45e99df81dd0b0aa5209b4 (patch)
treec2491082f3b8283058802b7077b8eb3a022e8087 /indra
parentca2f3dfd662bc70a187604b3cd638c97e0507843 (diff)
Make alpha projectors do projector clip test for consistency with deferred spot behavior.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl14
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index a63b9dec75..f49f274de0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -58,6 +58,7 @@ VARYING vec3 vary_norm;
VARYING vec4 vertex_color;
#endif
+uniform mat4 proj_mat;
uniform mat4 inv_proj;
uniform vec2 screen_res;
uniform int sun_up_factor;
@@ -89,11 +90,22 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec
{
//get light vector
vec3 lv = lp.xyz-v;
-
+
+ vec4 proj_tc = proj_mat * lp;
+
//get distance
float d = length(lv);
float da = 1.0;
vec3 col = vec3(0);
+ if (proj_tc.z < 0
+ || proj_tc.x < 0
+ || proj_tc.z > 1
+ || proj_tc.y < 0
+ || proj_tc.y > 1)
+ {
+ return col;
+ }
+
if (d > 0.0)
{
//normalize light vector