Ver Fonte

Use correct omni light attenuation

fixes godotengine/godot#34683
Winston há 5 anos atrás
pai
commit
c9fe11dec1
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      drivers/gles3/shaders/scene.glsl

+ 1 - 1
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;
 	}