Added point light ambiance

This commit is contained in:
Joshua Barretto 2020-01-27 01:51:38 +00:00
parent 509fcc8ad2
commit 4eb5b76d5f

View File

@ -48,7 +48,7 @@ vec3 light_at(vec3 wpos, vec3 wnorm) {
// Multiply the vec3 only once
vec3 color = srgb_to_linear(L.light_col.rgb) * (strength * L.light_col.a);
light += color * (max(0, dot(normalize(difference), wnorm) + 0.15) + LIGHT_AMBIENCE);
light += color * (max(0, max(dot(normalize(difference), wnorm), 0.15)) + LIGHT_AMBIENCE);
}
return light;
}