aboutsummaryrefslogtreecommitdiff
path: root/client/shaders/object_shader/opengl_fragment.glsl
diff options
context:
space:
mode:
authorDmitry Kostenko <codeforsmile@gmail.com>2022-02-13 19:45:34 +0100
committerx2048 <codeforsmile@gmail.com>2022-03-07 23:45:26 +0100
commite531c596063178553060f1776898c5369468edc5 (patch)
treec6dec7f86b2b5735d3081a5b9de27a7968082340 /client/shaders/object_shader/opengl_fragment.glsl
parent8f652f4e31e865c856dd45f9f7fc43e99fcc0f1c (diff)
downloadminetest-e531c596063178553060f1776898c5369468edc5.tar.gz
minetest-e531c596063178553060f1776898c5369468edc5.tar.bz2
minetest-e531c596063178553060f1776898c5369468edc5.zip
Ensure nightRatio is greater than zero in object shader
Diffstat (limited to 'client/shaders/object_shader/opengl_fragment.glsl')
-rw-r--r--client/shaders/object_shader/opengl_fragment.glsl2
1 files changed, 1 insertions, 1 deletions
diff --git a/client/shaders/object_shader/opengl_fragment.glsl b/client/shaders/object_shader/opengl_fragment.glsl
index 3cbf4347a..e1d7a3574 100644
--- a/client/shaders/object_shader/opengl_fragment.glsl
+++ b/client/shaders/object_shader/opengl_fragment.glsl
@@ -508,7 +508,7 @@ void main(void)
// turns out that nightRatio falls off much faster than
// actual brightness of artificial light in relation to natual light.
// 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);
// cosine of the normal-to-light angle when
// we start to apply self-shadowing