WebXR fix frustum culling (right eye)#7411
Conversation
|
I thought this was interesting: |
Perhaps a different method for culling (not frustrum) should be used in such edge cases. And that would be a separate PR. |
|
I think that over the 180 degree threshhold, you need to cull per eye. But below that, I think we simply need to have a |
As mentioned:
For now, this PR improves a current situation, by removing culling issues on right eye on most XR devices I've tested. Future PR's can improve that. I believe that this issue been there for far too long, and decided to fix it within my mathematical abilities. |
Fixes #5787
This PR changes the way view projection matrix is calculated when in stereo XR, by constructing average view matrix and offsetting it slightly backwards. This solves an issue where in right view (eye) objects were frustum culled too early (at the edge of right eye's frustum).
There is potentially a better way, by constructing a frustum that is based on left plane of left's frustum and right plane of right's frustum, but I'm not that smart to figure it out 😃
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.