Better light attenuation

This commit is contained in:
Joshua Barretto 2019-09-25 13:42:56 +01:00
parent 499344ccab
commit 6dbeda3267

View File

@ -43,7 +43,7 @@ vec3 light_at(vec3 wpos, vec3 wnorm) {
// Pre-calculate difference between light and fragment
vec3 difference = light_pos - wpos;
float strength = attenuation_strength(difference);
float strength = pow(attenuation_strength(difference), 0.6);
// Multiply the vec3 only once
vec3 color = srgb_to_linear(L.light_col.rgb) * (strength * L.light_col.a);