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

Oculus Quest native support #15659

Merged
merged 32 commits into from
Jul 31, 2022
Merged

Oculus Quest native support #15659

merged 32 commits into from
Jul 31, 2022

Conversation

lvonasek
Copy link
Contributor

@lvonasek lvonasek commented Jul 7, 2022

Introduction

Initial work on OpenXR integration. Target of this PR is to have a working build for Oculus Quest with 2D screen in VR space controlled by Oculus Touch controllers.

Tasks for this PR

  • Initialize OpenXR
  • Rendering into OpenXR framebuffer
  • Controllers OpenXR integration
  • Hide settings which does not fit VR
  • Update default settings

Tasks for the future PR(s)

  • 6DoF movement
  • 3D stereo view
  • Do not use OPENXR define
  • Use build variant instead of build module

Related #11979, #15427

@hrydgard
Copy link
Owner

hrydgard commented Jul 7, 2022

Cool!

Yeah, with OpenXR I don't think there are any licensing issues like there were with OpenVR and the old Oculus SDK. I think pushing early WIP code to an open PR like this is totally fine for something that might get kinda big, it's good for visibility and early reviews etc.

Presumably once this is a bit more developed it could be extended to support other OpenXR platforms like Vive etc.

@hrydgard hrydgard added the User Interface PPSSPP's own user interface / UX label Jul 7, 2022
@lvonasek
Copy link
Contributor Author

lvonasek commented Jul 8, 2022

Let's see how far I'll get. I saw there was a version for Oculus Rift but I cannot find the source codes. If you could point me on that fork I might get some parts from there (e.g. integration into the renderer).

@iota97
Copy link
Contributor

iota97 commented Jul 8, 2022

I think this might be the fork you are talking about: https://github.com/CarlKenner/ppsspp/tree/VR?

@lvonasek
Copy link
Contributor Author

lvonasek commented Jul 8, 2022

Yes, thank you @iota97.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Jul 8, 2022

Please just remember that:

  • most people aren't interested in getting VR,
  • among those that do, most aren't interested in running games never designed with VR in mind in their VR headsets.

And keeping that in mind don't try to clutter the project for everyone with thousands of ini files and hacks as the existing/abandoned project did. Thanks.

@lvonasek
Copy link
Contributor Author

lvonasek commented Jul 8, 2022

Thanks @LunaMoo. I do not have high expectations. I saw the previous PCVR integration on videos so I know what you mean.

I can imagine Lego games might be quite playable (bit like Moss game on Quest) but we will see...

@hrydgard
Copy link
Owner

hrydgard commented Jul 9, 2022

It will add some complexity, but I think it's not too big of a deal if we manage to keep the code fairly contained. As for the stereo rendering, in Vulkan there are convenient ways to draw into two layers of a render target, so only a few localized changes will be needed to get real stereo.

Unfortunately, of course, things like stereo separation etc will need to be tweaked per game indeed. A single large ini with some defaults shouldn't be too bad as a start.

@lvonasek
Copy link
Contributor Author

lvonasek commented Jul 9, 2022

As I didn't contribute into PPSSPP never before.
I am considering to split this PR into two. For the begining I would add Oculus Quest as a new platform (that means rendering 2D using OpenXR and support for the Quest Touch controllers). In the second PR I would integrate the stereo itself.

@hrydgard
Copy link
Owner

hrydgard commented Jul 9, 2022

That would be perfectly fine. I don't think the old VR build actually did proper stereo anyway?

@lvonasek
Copy link
Contributor Author

lvonasek commented Jul 9, 2022

Not sure about it, I didn't use it myself. I saw YouTube videos of it only.

@lvonasek
Copy link
Contributor Author

Minimal integration works, bug fixing rounds starting. Changing it from draft to PR in hopes that it will start the build tests.

@lvonasek lvonasek marked this pull request as ready for review July 17, 2022 18:32
@unknownbrackets
Copy link
Collaborator

Haven't looked at this much, but I feel like VR/ and quest/ needn't be on the root, maybe under GPU or quest under android or something. Not sure if things can just be shared with overrides.

Approved the workflow run.

-[Unknown]

@lvonasek
Copy link
Contributor Author

Haven't looked at this much, but I feel like VR/ and quest/ needn't be on the root, maybe under GPU or quest under android or something. Not sure if things can just be shared with overrides.

Approved the workflow run.

-[Unknown]

Thanks. VR folder could be definetely moved. However with quest folder it is bit tricky. The repository root is an Android Studio project. The android folder is a module of that project and quest is another module. Not sure how to do it better

@lvonasek lvonasek requested a review from hrydgard July 24, 2022 13:39
@lvonasek
Copy link
Contributor Author

Note this PR waits on review/approval. The work continues here: https://github.com/lvonasek/ppsspp/commits/feature_openxr_6dof

@hrydgard hrydgard added this to the v1.14.0 milestone Jul 25, 2022
@hrydgard
Copy link
Owner

It's looking pretty good now.

Tomorrow I'll be kicking off the 1.13 release process, so unfortunately, while this theoretically shouldn't have any impact, I can't take the risk of merging until it's done, which might ideally take a week (need to wait for crash report to come in and fix any issues) but can take little longer.

Sorry for this delay, but thanks to git's branching flexibility you should have no problem keeping working on your branch on top of this as usual in the meantime.

@lvonasek
Copy link
Contributor Author

Sure, no problem, I fully understand that.

Btw I got five early builds testers and they are pretty excited about it. To the video from Flatout, I shared in your Discord, the tester mentioned that it works much better than the old PPSSPP PC VR version already.

Copy link
Collaborator

@unknownbrackets unknownbrackets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I mentioned this before, but I still think VR should be somewhere else. Debugging, CPU emulation, input processing, software rendering, and file handling for example are all very important features of PPSSPP but they're not on the root.

We already have more files on the root than I think we should, but I don't think we need VR on the root. It could maybe be under GPU or UI, IMHO. I get quest because it's more of a port, which we do keep on the root.

-[Unknown]

UI/MainScreen.cpp Outdated Show resolved Hide resolved
VR/VRFramebuffer.cpp Outdated Show resolved Hide resolved
VR/VRInput.h Outdated Show resolved Hide resolved
android/jni/app-android.cpp Outdated Show resolved Hide resolved
VR/VRBase.cpp Outdated Show resolved Hide resolved
@lvonasek
Copy link
Contributor Author

@unknownbrackets I resolved some of the comments. Two of them I have a bit problem (at least ATM). Could you close them if you don't require it for this PR?

I moved the VR folder under common, I do not want to put it into GPU|Input|UI simply because it wouldn't be right. I am completely fine to move it out of root.

@unknownbrackets
Copy link
Collaborator

Common seems fine, sure. Thanks, sorry for being pedantic.

-[Unknown]

@lvonasek
Copy link
Contributor Author

Common seems fine, sure. Thanks, sorry for being pedantic.

All good, I understand it is important to keep high code standards.

@hrydgard
Copy link
Owner

Agree with Common as a pretty reasonable place for it, thanks!

@lvonasek
Copy link
Contributor Author

@hrydgard I managed to get rid of the quest module in the root folder (by adding a new build variant):
https://github.com/lvonasek/ppsspp/commit/4691b376d1b7c15b250c532ac15a49f74f65d2e4

Shall I add it into this PR?

@hrydgard
Copy link
Owner

Yes please!

Sorry I haven't gotten around to merging yet, but might as well get that into the branch too then - promise I'll merge after :)

@lvonasek
Copy link
Contributor Author

Yes please!

Sorry I haven't gotten around to merging yet, but might as well get that into the branch too then - promise I'll merge after :)

No need to sorry. Done, the quest module is gone.

@hrydgard hrydgard merged commit 392d83f into hrydgard:master Jul 31, 2022
@lvonasek lvonasek deleted the feature_openxr_quest branch July 31, 2022 14:42
@lvonasek lvonasek mentioned this pull request Jul 31, 2022
3 tasks
@lvonasek lvonasek mentioned this pull request Aug 24, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User Interface PPSSPP's own user interface / UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants