From dce488af92bf82b0ece3427cd365d8357a57ad2e Mon Sep 17 00:00:00 2001 From: wlbragg Date: Wed, 5 Oct 2016 14:47:44 -0500 Subject: [PATCH] ALS lightspot second projectable spot correction. --- Shaders/lightspot-ALS.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shaders/lightspot-ALS.frag b/Shaders/lightspot-ALS.frag index 923dd0f15..5a033d4fd 100644 --- a/Shaders/lightspot-ALS.frag +++ b/Shaders/lightspot-ALS.frag @@ -76,7 +76,7 @@ rotMat = mat2 (cos(lightspot_dir2), sin(lightspot_dir2), -sin(lightspot_dir2), c difference_vec.xy = rotMat * difference_vec.xy; difference_vec.x/= (1.0 + lightspot_project2); -lightspot_arg = (1.0 - smoothstep(lightspot_size2/3.0, lightspot_size2, length(relPos - eye_rel))); +lightspot_arg = (1.0 - smoothstep(lightspot_size2/3.0, lightspot_size2, length(difference_vec))) * (1.0 - 0.5* smoothstep(lightspot_size2/3.0, lightspot_size2/(1.0+lightspot_project2), -difference_vec.x)); lightspot_color += vec3 (lightspot_r2,lightspot_g2, lightspot_b2 ) * lightspot_arg;