-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Correct occlusion culling viewport location calculation when projection uses asymmetric FOV #104249
Conversation
5cdc7d4
to
b929b67
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.
In its current state this PR will introduce inconsistent jittering on the Y-axis for OpenXR users, in addition to some performance penalty to everyone.
I believe there's a cleaner way to solve it - see my detailed comments.
As a side effect, this will also fix occlusion culling with FRUSTUM
camera mode as it likely suffers from the same issue.
I can confirm that this PR fixes the issue as shown in the MRP on #104193 I'd be happy to re-test again after it's been updated |
get_endpoints()
to calculate the viewport location in occlusion jitter
get_endpoints()
to calculate the viewport location in occlusion jitter
Something I'm a little confused about with this PR, is that it appears to only be changing the jitter calculation, but isn't changing the code from PR #98758 that apparently caused the regression. That code still uses |
I believe it's not OK (I just left a comment there). I didn't look close enough yet to explain why this PR alone seems to resolve the issue. |
I had to put the fix in the calling function at the current HEAD because the change in #98758 has actually been refactored here: c7895ca |
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.
I find it now in a pretty good shape speaking of the code. I left a few comments.
I didn't check it against the MRP yet.
6fc180e
to
11c6593
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.
Last last round - please don't hate me, it's done with good intentions for the sake of code clarity.
Also I did it on my smartphone, so forgive any typo.
Thank you for your patience !
I don't think this improves anything. (I previously commented but it probably got lost in the churn) I believe |
Look, it's pretty much the same either way so it's fine by me if you don't make the change. It's just that changing where the jitter is added doesn't contribute to the fix anymore. I couldn't test whether this still solves the issue because I don't have a XR device, but I'm pretty confident. Thanks ! |
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.
Thanks, this is working in my testing on Quest 3!
I think the code is fine as it is, even without Flarkk's suggested refactor to return Rect2
. The priority at this point is fixing the regression - a re-organization can be discussed in a follow-up.
But I think the changes to the comments that Akien suggests should be made, so that if we don't change this, we don't end up with out-of-date comments
Looks good! Could you squash the commits? See PR workflow for instructions. |
While squashing, it would be nice if you could also rewrite the commit message to match the PR title - the message on the current 1st commit is out-of-date. Thanks! |
Fixes godotengine#104193 In OpenXR the viewport location is not centered on the transform origin
Thanks! |
Cherry-picked for 4.4.1. |
Fixes #104193
In OpenXR the viewport location is not centered on the transform origin