I have a little WebXR app that runs fine both on my PC with an Oculus Rift and on an Oculus Quest 2. This app is made in babylonjs version 4.2.
After updating the version of Babylonjs to 5.0.0-alpha.16 I noticed that the VR icon normally seen at the bottom right of the screen seems to be missing.
Are there any known issues with WebXR in version 5, or any extra steps that must be followed to get it working?
On pc, check the browser console for errors. On quest2, check console with remote debugger. Might show nothing, but you have to check.
My stuff ran with alpha 15, but never tried with 4,2. That is before I started.
Adding @RaananW our WebXR Guru which will be back online tomorrow but in theory it should work better in the latest beta vs 4.2.
Thanks for all the feedback
I think I have figured out the issue - it seems that in v5, the check for HTTPS within the constructor of webXREnterExitUI.ts exits the setup method prior to setting up the webXR buttons. This is fine, but it does bring up the following questions:
- I thought http was valid in WebXR if running on localhost (which is what my app is doing)
- Checking the baseExperience value of the object returned from scene.createDefaultXRExperienceAsync equates to true when the createDefaultXRExperienceAsync call exits early due to not running on HTTPS. Because of this, my code thought everything was ok when in truth it was not.
Would it be possible for the above issues to be addressed?
Also - I checked out both the latest master and the v4.2 tag, and I can confirm that in v4.2 the method did not exit if the http check fails, whereas the within master, it does.
There were some issues with that the last time i checked, but I have no problem allowing localhost calls with http through. Want to create a github issue for that? I will self-assign it and take care of it.
Good catch. The entire thing should reject if no https is present. I will need to see if that requires a small architectural change. You can add that to the ticket above, They are more than related.
I have created Github issue WebXR should run on http when using localhost in Babylonjs version 5 · Issue #10154 · BabylonJS/Babylon.js · GitHub as requested, please let me know if it needs tweaking.
Would you consider throwing rather than returning in the webXREnterExitUI constructor if the current address is not http and is not localhost?
Yeah, We should be throwing and not returning. This is the way. I just wonder why it wasn’t obvious to me when I implemented it back then