From b5ba56c863184538bf45e99df81dd0b0aa5209b4 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Fri, 26 Apr 2019 08:03:17 -0700 Subject: Make alpha projectors do projector clip test for consistency with deferred spot behavior. --- .../app_settings/shaders/class1/deferred/alphaF.glsl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3