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

Tight shadow culling - increase epsilon to prevent flickering #92078

Merged
merged 1 commit into from
May 21, 2024

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented May 18, 2024

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

Fixes #91976

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 planes 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.
@akien-mga akien-mga merged commit 008fd5f into godotengine:master May 21, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@lawnjelly lawnjelly deleted the increase_tight_cull_epsilon branch May 21, 2024 11:08
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.

SpotLight3D shadows exhibit flickering when moved around.
3 participants