summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorWinston <44872771+winston-yallow@users.noreply.github.com>2019-12-29 17:22:34 +0100
committerGitHub <noreply@github.com>2019-12-29 17:22:34 +0100
commitc9fe11dec1c72f4c12c8a5ae848dbf2bb5930c46 (patch)
tree0e2180f1aef897122b28b9b2c7c8afa033074e3c /drivers
parent12482bf8840ce2fa84d6eea7999628be426cba8d (diff)
Use correct omni light attenuation
fixes godotengine/godot#34683
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/shaders/scene.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 63b2938551..a330dbef77 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1260,7 +1260,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
float normalized_distance = light_length * omni_lights[idx].light_pos_inv_radius.w;
float omni_attenuation;
if (normalized_distance < 1.0) {
- omni_attenuation = pow(normalized_distance, omni_lights[idx].light_direction_attenuation.w);
+ omni_attenuation = pow(1.0 - normalized_distance, omni_lights[idx].light_direction_attenuation.w);
} else {
omni_attenuation = 0.0;
}