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

OpenXR - Anti-flickering rendering flow added #19361

Merged
merged 3 commits into from
Jul 22, 2024
Merged

OpenXR - Anti-flickering rendering flow added #19361

merged 3 commits into from
Jul 22, 2024

Conversation

lvonasek
Copy link
Contributor

@lvonasek lvonasek commented Jul 22, 2024

Many games do not render at 60FPS. That causes in VR flickering because of the way OpenXR works.

In CitraVR there is an "Immersive mode" which extends the viewport and map it on a cylinder. The advantage of that flow is even on low FPS there is no flickering. The approach has a few glitches in Citra and would have much more glitches in PPSSPP.

This PR got inspired by that idea but instead of extending viewport, I render a custom view and map it on a cylinder. The user can turn the head left-right up to 45° without noticing it isn't real VR.

With this much more games are playable in VR. It works slightly better with 6DoF disabled.

Edit: I made iCameraPitch config as a floating point value. Sorry for putting two things into one PR.

@hrydgard
Copy link
Owner

Can you explain a little bit clearer what this does in detail, and how that prevents flickering? It's not entirely clear to me.

That said, this sounds like a good improvement and I'm happy to merge if I understand it :)

@hrydgard hrydgard added this to the v1.18.0 milestone Jul 22, 2024
@hrydgard hrydgard added the VR OpenXR VR support label Jul 22, 2024
@lvonasek
Copy link
Contributor Author

Of course. A game renders a frame with camera pose based on user's head pose. When there is a small framedrop OpenXR reprojects an old frame to the new head pose. That works great if the framedrop is small. With games running 30FPS with XR session running 72Hz there are way too much framedrops and due to reprojection inaccuracies user gets flickery frames when moving the head around.

With the toggle in this PR, the game renders a frame with the unmodified camera pose. There is modified projection matrix to render bit more of the scene and with aspect ratio 2:1. The user sees a curved stereoscopic cinema around him and it doesn't matter if it runs 12 or 120FPS, there are no reprojections which would cause flickering (except if user activates 6DoF, then the cinema translates as the user translates)

@hrydgard
Copy link
Owner

OK! I get it. I'll try to get around to testing it myself soon :) In the meantime, let's get it in.

@hrydgard hrydgard merged commit 0d8f194 into hrydgard:master Jul 22, 2024
18 checks passed
@lvonasek lvonasek deleted the feature-openxr-antiflickering branch July 22, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VR OpenXR VR support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants