-
Notifications
You must be signed in to change notification settings - Fork 130
WebXR Integration 🥽 (again) #408
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
base: main
Are you sure you want to change the base?
Conversation
Thanks @abcamiletto for the PR! I'm also interested in thoughts from @cvachha. My initial feelings:
|
Hi! I think it is reasonable to ship a pair of keys instead of having A more detailed proposal could be
This seems feasible to me and I don't foresee major blockers. |
I think the solution to use HTTPS to get webxr working looks great! It probably would be useful to have a method to toggle/activate the webxr buttons in the python script if the develop prefers instead of having them on by default since certain applications like Nerfstudio won't be able to directly use webxr for most functionality (panels, nerf/splat rendering). There's also a list of features I'm planning on working on including features to make this more than just a vr viewer like controller support, hand tracking, and panels (though adding 2D floating panels might be difficult since I believe HTML can't render in webxr). |
Hey @abcamiletto , thanks for the great work! I wanted to raise your attention that when I try to build it, I get this error
Commenting out line 52 resolves it. :) I still need to test it in VR, on mobile in AR mode it is not working properly (just renders the view on a plane), but VR does, I am happy :) |
Ok, tested in VR, it says "This page isn't responding" My setup is Meta Quest 3, connected with Meta Quest Link (AirLink) to my PC, running Chrome (134.0.6998.178). Please let me know if you need any further input on this, I am happy to provide logs or whatever you might need :) |
Hi! I will work again on this soon. The setup I was testing with was Meta Quest 3, wireless, using Quest native browser. |
Oh, I see. It didn't occur to me, because my 20 thousand iteration is 1.8Gb, so I thought my best chance to visualize it is in tethered mode, but I will try that too. |
Okay, so I tested with the same setup. For me the view in VR is simply on a 2D plane, so basically the same as before hitting "Enter VR", and everything else is just black. Similar to the behavior on mobile when hitting "Enter AR". Also, once I exit this view with the menu button and close the immersive experience, I can't re-open it until I restart the browser, so something is not exiting gracefully. |
be9fb67
to
a704ac6
Compare
This PR adds out-of-the-box support for VR devices.
The pain point is that VR devices require HTTPS for WebXR to function, as noted in the react-three/xr documentation. This appears to be a strict requirement.
While this is not a problem for someone using a viser export for a webpage, it is for anyone using viser as a 3D visualizer as the default server is in HTTP.
To address this, the current draft implementation dynamically generates self-signed certificates and uses them to launch an HTTPS server, enabling VR mode. It's ugly but it works.
If you're open to supporting HTTPS and merging this PR, I'm happy to refine the implementation further.
There are a couple of open points:
cryptography
as an optional dependency? For users that just want to have an https visualizer without having to provide their own SSL certificate. Alternatively, we could keep the https functionality only by passing explicitlyssl_context
Currently, there is only an (ugly)
https=False
flag toViserServer
From my perspective as a viser user myself, developing a downstream library, I would like to have something along the lines
I am also open to splitting this PR into two, one for HTTPS and one for WebXR support.
Let me know what you think!
To Do:
Enter VR
/Enter AR
buttons optional, appearing only when a VR environment is detected.cryptography
an optional dependency.