-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Get WebXR fully working in Godot 4! #68870
Conversation
0b11b5f
to
bc7f298
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.
Approved for the rendering changes only. Everything in drivers/GLES3 and renderer_scene_cull.cpp look good to me!
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.
The Web parts look good 👍 awesome work 🏆 , see my comment on the (unrelated) sys_env["JS_PRE"]
, but it's not a blocker, it can be addressed in its own PR.
bc7f298
to
600b28e
Compare
sorry @dsnopek , totally forgot to look at this, saw your message on #XR and then totally lost track of it... Generally speaking everything looks good but I do think we need a few changes around controllers. There are a few hardcoded names that we assume to make things portable, though the tough part here is that OpenXR has a whole binding system that result in us not knowing what the raw inputs are, and giving complete control over the naming of actions to the developer. That does make it pretty hard to allow projects to move between WebXR and OpenXR but worth discussing further. I'm also missing the head tracker but I may just be overlooking it. I added a head tracker for updating the XRCamera3D, this allows us to do proper predictive positioning for the frame being rendered while the rendering itself can use fresher data. ping me on Discord and lets have some time to look at things together and nail the final bits. |
Thanks, @BastiaanOlij!
Sure, if there's better names for the buttons, axes, and pressure on standard controllers, I can change them! (There can be "non-standard input" as well, which there isn't much we can do about, all we get is IDs with no semantic meaning.)
It'd be really cool if the action map system could work for both OpenXR and WebXR! But I haven't actually had a chance to really use action maps (aside from just poking around), so I'm not sure what the challenges would be there.
The head tracker isn't in this PR, that was done earlier (I think by you, actually :-)). Here's the relevant code:
Will do! |
600b28e
to
310bf39
Compare
I chatted with @BastiaanOlij and he requested some changes to how some of the inputs were named, and that it also provide We also discussed how the OpenXR action map system could be generalized into the "XR action map system" so it could also be used by WebXR, but that's material for Godot 4.1 :-) |
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'm very happy with this implementation. @dsnopek and myself spend some time doing the best to get some parity between OpenXR and WebXR so there is a path for developers to create a game that can be deployed on both systems.
We've also mapped out a future to see if we can bring WebXR into the action map system for those who wish to customise the actions, but that will be a 4.1 thing.
If @clayjohn is happy with the changes in the GLES3 driver, I'd say lets get this merged :)
Thanks, @BastiaanOlij!
He's already reviewed and approved those changes :-) |
Thanks! |
This PR gets WebXR fully working in Godot 4, pretty much on par with how it works in Godot 3!
It's working in my testing with:
There's a lot of good stuff in here:
use_closure_compiler=yes
The only way this is inferior to Godot 3, is that XR (not just WebXR) in Godot 4 requires multiview and there are devices which don't support multiview that work with Godot 3, but won't work now. For example, with Godot 3, I could use Google Cardboard with my smartphone, but with Godot 4, I can't because it doesn't support multiview. It would certainly be possible to refactor XR to work both with or without multiview, but that's a problem for another day
In every other way, this implementation of WebXR is superior to what we have in Godot 3! :-)