Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Tight shadow culling - increase epsilon to prevent flickering #92079

Merged
merged 1 commit into from
May 20, 2024

Conversation

lawnjelly
Copy link
Member

Near colinear triangles were still causing inaccuracy in culling planes, so the threshold for colinearity is bumped up.

Fixes #91976
3.x version of #92078

Notes

  • In the MRP in the issue, the spotlight was placed on the exact boundary of the top and bottom frustum planes, this was causing sometimes frustum places to be added and sometimes not (due to float error). This in itself was not a problem.
  • The triangles formed between the light position and the edges however were proving too close to colinear, which as before when converted to a Plane caused inaccurate normal and d values.
  • Originally I set the epsilon for colinearity deliberately very low, to see what we could get away with. It turns out it needs to be higher so I've gone for quite a conservative value here.

Near colinear triangles were still causing inaccuracy in culling planes, so the threshold for colinearity is bumped up.
@lawnjelly lawnjelly added this to the 3.6 milestone May 18, 2024
@lawnjelly lawnjelly requested a review from a team as a code owner May 18, 2024 13:31
@lawnjelly lawnjelly merged commit 0dcab10 into godotengine:3.x May 20, 2024
14 checks passed
@lawnjelly lawnjelly deleted the increase_tight_cull_epsilon3 branch May 20, 2024 19:47
@lawnjelly
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants