diff options
author | lawnjelly <lawnjelly@gmail.com> | 2024-05-18 14:14:27 +0100 |
---|---|---|
committer | lawnjelly <lawnjelly@gmail.com> | 2024-05-18 14:14:27 +0100 |
commit | 512b0f16a3fcd3f9e8325928c70361dcc6b6ea76 (patch) | |
tree | f29cfe0bd3988983c86522e32b9a2dd44c518764 | |
parent | bd2300d77a6008167043f23fd91bcc562cde0a19 (diff) | |
download | redot-engine-512b0f16a3fcd3f9e8325928c70361dcc6b6ea76.tar.gz |
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.
-rw-r--r-- | servers/rendering/rendering_light_culler.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/rendering_light_culler.h b/servers/rendering/rendering_light_culler.h index 0bf975430b..b0437d2310 100644 --- a/servers/rendering/rendering_light_culler.h +++ b/servers/rendering/rendering_light_culler.h @@ -181,14 +181,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, |