Merge pull request #34685 from winston-yallow/fix_omnilight_attenuation

Use correct omni light attenuation
This commit is contained in:
Rémi Verschelde 2019-12-30 16:11:58 +01:00 committed by GitHub
commit a96c95f1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}