From a5f9f581faa5912d00550236b8a63e71e192573d Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 18 May 2024 14:29:16 +0100 Subject: [PATCH] Tight shadow culling - increase epsilon to prevent flickering Near colinear triangles were still causing inaccuracy in culling planes, so the threshold for colinearity is bumped up. --- servers/visual/visual_server_light_culler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/visual/visual_server_light_culler.h b/servers/visual/visual_server_light_culler.h index 7f5c311d5a0..22982e2388d 100644 --- a/servers/visual/visual_server_light_culler.h +++ b/servers/visual/visual_server_light_culler.h @@ -164,14 +164,14 @@ private: } // Prevent divide by zero. - if (lc > 0.00001f) { + if (lc > 0.001f) { // If the summed length of the smaller two // sides is close to the length of the longest side, // the points are colinear, and the triangle is near degenerate. float ld = ((la + lb) - lc) / lc; // ld will be close to zero for colinear tris. - return ld < 0.00001f; + return ld < 0.001f; } // Don't create planes from tiny triangles,