-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Tighter shadow culling - fix light colinear to frustum edge #89714
Tighter shadow culling - fix light colinear to frustum edge #89714
Conversation
2dc1791
to
5598a57
Compare
5598a57
to
d64abff
Compare
In rare situations if a light is placed near colinear to a frustum edge, the extra culling plane derived can have an inaccurate normal due to floating point error. This PR detects colinear triangles, and prevents adding a culling plane in this situation.
d64abff
to
70cd25f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
7a42afb), this PR doesn't resolve the issue from the original MRP (#89702 (comment)):
simplescreenrecorder-2024-04-04_15.53.14.mp4
Even if the above video was recorded at 60 FPS, the Max FPS project setting was set to 20 for demonstration purposes.
Disabling the Tighter Shadow Caster Culling project setting resolves the issue. I'm using a 16:9 aspect ratio which is identical to the base window size, so I assume it's what mrjustaguy tested this with.
Ah I'll try again, it could be the epsilon needs adjusting. 👍 I was using a modified version of the scene as it didn't require all the models to show the bug. UPDATE: But given the MRP runs in fullscreen, there could be some small difference given that the bug is to do with float error and epsilons. I'll keep trying to replicate it. It's possible that I could expose the epsilon in a test build to confirm it fixes for you / tweak the value, as it's pretty empirical if I remember right. Or you could just bump it up in the source file, it should be the second epsilon currently set to (Also just to eliminate the obvious, it might be worth double checking you were running the PR build. It's pretty easy to e.g. run a release build after compiling dev build, etc, I've done this many times. 😁 ) Anything special you could mention about your build is useful, compiler, screen resolution, 32 or 64 bit build etc. UPDATE: So I guess @Calinou it would need you to try a few different epsilons and see at what point it is getting fixed on your system. But definitely double check it is running the correct build, |
This was indeed an outdated build issue, for the same reason as in #70766 (comment). Apologies. I've tested the PR locally and it works now. |
Thanks! |
In rare situations if a light is placed near colinear to a frustum edge, the extra culling plane derived can have an inaccurate normal due to floating point error. This PR detects colinear triangles, and prevents adding a culling plane in this situation.
Fixes #89702
Notes