From 2826bec5d49eb8656aecc2e90b9d5bbefab6083a Mon Sep 17 00:00:00 2001
From: Hugo Locurcio <hugo.locurcio@hugo.pro>
Date: Tue, 12 Oct 2021 21:58:55 +0200
Subject: [PATCH] Fix lights flickering in GLES3 when new light attenuation is
 disabled

Co-authored-by: Clay John <claynjohn@gmail.com>
---
 drivers/gles3/shaders/scene.glsl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 72d6d120f79..1d3c26225f7 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1356,7 +1356,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
 #ifdef USE_PHYSICAL_LIGHT_ATTENUATION
 		spot_attenuation = get_omni_attenuation(light_length, spot_lights[idx].light_pos_inv_radius.w, spot_lights[idx].light_direction_attenuation.w);
 #else
-		spot_attenuation = pow(1.0 - normalized_distance, omni_lights[idx].light_direction_attenuation.w);
+		spot_attenuation = pow(1.0 - normalized_distance, spot_lights[idx].light_direction_attenuation.w);
 #endif
 	} else {
 		spot_attenuation = 0.0;