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.
This commit is contained in:
lawnjelly 2024-05-18 14:29:16 +01:00 committed by Relintai
parent 150b8e5c02
commit f033baee93

View File

@ -165,14 +165,14 @@ private:
} }
// Prevent divide by zero. // Prevent divide by zero.
if (lc > 0.00001f) { if (lc > 0.001f) {
// If the summed length of the smaller two // If the summed length of the smaller two
// sides is close to the length of the longest side, // sides is close to the length of the longest side,
// the points are colinear, and the triangle is near degenerate. // the points are colinear, and the triangle is near degenerate.
float ld = ((la + lb) - lc) / lc; float ld = ((la + lb) - lc) / lc;
// ld will be close to zero for colinear tris. // ld will be close to zero for colinear tris.
return ld < 0.00001f; return ld < 0.001f;
} }
// Don't create planes from tiny triangles, // Don't create planes from tiny triangles,