From e531c596063178553060f1776898c5369468edc5 Mon Sep 17 00:00:00 2001 From: Dmitry Kostenko Date: Sun, 13 Feb 2022 19:45:34 +0100 Subject: [PATCH] Ensure nightRatio is greater than zero in object shader --- client/shaders/object_shader/opengl_fragment.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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