mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 10:03:45 +01:00
Make sure nightRatio is always greater than zero.
To avoid underfined behavior of GLSL pow()
This commit is contained in:
parent
f8cef52ea0
commit
71317b8579
@ -512,7 +512,7 @@ void main(void)
|
|||||||
// turns out that nightRatio falls off much faster than
|
// turns out that nightRatio falls off much faster than
|
||||||
// actual brightness of artificial light in relation to natual light.
|
// actual brightness of artificial light in relation to natual light.
|
||||||
// Power ratio was measured on torches in MTG (brightness = 14).
|
// Power ratio was measured on torches in MTG (brightness = 14).
|
||||||
float adjusted_night_ratio = pow(nightRatio, 0.6);
|
float adjusted_night_ratio = pow(max(0.0, nightRatio), 0.6);
|
||||||
|
|
||||||
if (f_normal_length != 0 && cosLight < 0.035) {
|
if (f_normal_length != 0 && cosLight < 0.035) {
|
||||||
shadow_int = max(shadow_int, 1 - clamp(cosLight, 0.0, 0.035)/0.035);
|
shadow_int = max(shadow_int, 1 - clamp(cosLight, 0.0, 0.035)/0.035);
|
||||||
|
Loading…
Reference in New Issue
Block a user