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

Add support for the Meta Quest #37

Merged
merged 2 commits into from
Mar 1, 2025
Merged

Add support for the Meta Quest #37

merged 2 commits into from
Mar 1, 2025

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Feb 26, 2025

Thanks for this amazing project! ❤️

This PR adds support for the Meta Quest - it's working for me on the Quest 3 :-)

Using a new export preset that defines a custom "meta_quest" feature tag, and project settings overrides for this feature tag, it re-configures a bunch of settings that will only take effect on Quest.

For performance, I had to switch the renderer to Compatibility, which changes the color and the lighting intensity and a number of other things, such that it doesn't look quite right. But it works!

So, I'm marking this as a DRAFT for now, because more could be done to improve the visuals by re-tuning them for the Compatibility renderer. I'll experiment with that a bit in the coming days.

For anyone who wants to test, here's an APK you can sideload on to your Quest.

Please let me know if you'd like any help getting this app on to the Quest store! It would be so cool to have it there, so that anyone with a Quest could easily try it :-)

@dsnopek dsnopek marked this pull request as draft February 26, 2025 22:49
@@ -205,11 +205,16 @@ common/enable_pause_aware_picking=true
[rendering]

occlusion_culling/bvh_build_quality=0
renderer/rendering_method.mobile="gl_compatibility"
Copy link
Owner

Choose a reason for hiding this comment

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

Does this only affect the export on quest/android?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one affects all mobile, so Android and if you ever made an iOS export, but none of the desktop exports.

In this case I did the ".mobile" one rather than ".meta_quest", because Godot includes a default for ".mobile" which I can't remove (only change), and Quest would also match ".mobile". Not ideal, but should be fine until you have an iOS export some day :-)

@m4ym4y
Copy link
Owner

m4ym4y commented Feb 27, 2025

This is awesome to see! I'm so grateful that you're helping get this work with quest as it seems like one of the most common ways people are going to want to use VR! I'd ideally like at least one or two others to weigh in and confirm that it works well (I know this is just a draft for now though) as I don't have a way of testing it myself

@akien-mga
Copy link
Contributor

akien-mga commented Feb 27, 2025

I tested the PR (via the pre-built APK that David made) on Quest 3 and it seems to work fairly well. I got lost quickly learning about the rules and history of the game of Go :P

There are a few quirks which might warrant some further work, but possibly in follow-up PRs as the current state is already usable and the PR is quite minimal:

  • There's a bit of lag when teleporting. I don't know if this happens on other XR setups or is just due to the Quest being less powerful and struggling a bit. It's not a deal breaker though.
  • Lights on panels turn on and off depending on the direction of the camera. That's not unexpected as the GL Compatibility renderer supports less concurrent lights than Forward+ - but some tweaks might be doable so that it's the lights outside the view frustum that turn off, and not the ones in view. I know David wants to experiment with more graphics tweaks for Quest/Compatibility.
  • Font rendering at a distance isn't the best, but that's visible on PC too, it's just worse in VR. Probably not Quest specific either.
  • Going up stairs or turning in sharp corridors with teleport isn't the best experience just yet, but that's also not Quest specific.

Note for testers who like me, may not sideload APKs on a daily basis: You can do this with SideQuest, or with adb: adb install MuseumOfAllThings_Quest.apk. You need to enable developer mode for this on the Quest.

@devloglogan
Copy link

Wanted to give this a quick look as well. Side loading the APK @dsnopek provided works great. :)

I did also want to try exporting from the editor onto the headset myself. Using Godot 4.3 it exported onto my Quest 3 just fine, but every time it loads up I immediately fall infinitely below the building into the abyss. Not sure why that's the case for my export! I can look into it further later.

@dsnopek
Copy link
Contributor Author

dsnopek commented Feb 28, 2025

I've just pushed a commit that I think gets the visual fidelity over an acceptable threshold, so I'm going to take this out of draft! 🎉

What it does is:

  • Adds a DirectionalLight3D with very low energy (0.35) just to give shape to all the geometry in low light. This isn't necessary with Forward+, because the scene can be sufficiently lit by all the SpotLight3Ds and OmniLight3Ds, but we can't have all those enabled in compatibility, and so having the new directional light makes sure things don't look too flat.
  • Adds a system to manage which lights are enabled, based on camera direction and distance. Also, it doesn't just turn the lights on and off - it does a nice fade - and it only checks the lights every 1.0 second, so the lights won't flicker the way they did previously. The system aims to ensure that only 8 lights are enabled at a time, but could technically allow up to 16, including the lights that are in the process of fading out. This system is only active when using the compatibility renderer.

There's a print_verbose() message (you have to enable "Verbose Stdout" in project settings to see it), that will show the number of enabled and total lights every 1.0 second, and I was really astonished to see that there are literally hundreds of lights at all times. The number goes up and down, depending on which exhibits are loaded, but even the baseline is over 100. But somehow the Forward+ renderer can handle it without noticeable issues! If there are performance problems in the future, though, I'd recommend looking at using similar light management system for Forward+ as well :-)

Anyway, there's more that could be done to improve the visuals on the compatibility renderer, but I think this is a good start!

Here's a new APK for testing

@devloglogan I have no idea why you are falling through the floor! That's not an issue I've seen yet

@dsnopek dsnopek changed the title [DRAFT] Add support for the Meta Quest Add support for the Meta Quest Feb 28, 2025
@dsnopek dsnopek marked this pull request as ready for review February 28, 2025 23:50
@m4ym4y
Copy link
Owner

m4ym4y commented Mar 1, 2025

Thank you so much for this I'm going to take a look at the code today and see about merging and distributing along with the existing release.

Will people know how to sideload the APK if I distribute it on github and itch? I'm not sure the convention but I'm assuming there's some kind of store that Meta operates. OTOH I would prefer not to support meta financially if uploading to their store requires a payment :/

@dsnopek
Copy link
Contributor Author

dsnopek commented Mar 1, 2025

Will people know how to sideload the APK if I distribute it on github and itch?

Other developers and VR super enthusiasts will! Folks upload Quest APKs to Itch.io for game jams, like the Godot XR Jam nr 3 that just finished a week ago or so. So, it's worth doing.

But most Quests users won't know how to it.

I'm not sure the convention but I'm assuming there's some kind of store that Meta operates. OTOH I would prefer not to support meta financially if uploading to their store requires a payment :/

Yes, there is a store, and I'd be happy to help you get your app into it. This is such a cool project, and I'd really love for as many people as possible to be able to experience it!

You don't have to pay to release an app on the store (not like Steam's $100/game thing), but you do have to verify a legal entity (like a business or non-profit) with them and have a privacy policy. If you didn't want to go through that yourself, there's some options for other organizations I know that have existing store accounts that may be willing to host it for you, but that's probably something better to chat about privately. :-) Do you mind if I email you at the email address on your personal site?

@m4ym4y
Copy link
Owner

m4ym4y commented Mar 1, 2025

Sure, go ahead! I am likely going to create an entity just so that I have something to publish under on those sorts of platforms.

@dsnopek dsnopek mentioned this pull request Mar 1, 2025
@m4ym4y
Copy link
Owner

m4ym4y commented Mar 1, 2025

OK tested this and it looks great so I'm going to merge

@m4ym4y m4ym4y merged commit ac46ba9 into m4ym4y:main Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants