Skip to content

[Bug] WebXR Examples Default To Undesired Session Type #2862

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

Closed
EricMoerthVis opened this issue Jun 27, 2023 · 4 comments · Fixed by #2868
Closed

[Bug] WebXR Examples Default To Undesired Session Type #2862

EricMoerthVis opened this issue Jun 27, 2023 · 4 comments · Fixed by #2868
Assignees
Labels
module: example Affect example module: webxr Issues related to VR and AR type: bug 🐞 Errors in functionality

Comments

@EricMoerthVis
Copy link

Bug description

It seems like the WebXR Examples on the webpage https://kitware.github.io/vtk-js/docs/develop_webxr.html are the same for AR and VR. I would like to try the Head Visualizations in VR but the button only says AR, no matter which example I open.

Steps to reproduce

https://kitware.github.io/vtk-js/docs/develop_webxr.html go to the head visualizations in the VR section, the button only states Switch to AR instead of VR

Detailed Behavior

No response

Expected Behavior

I would assume that the VR examples would allow me to see the head visualizations in VR.

Environment

  • vtk.js version:
  • Browsers:
  • OS:
@EricMoerthVis EricMoerthVis added the type: bug 🐞 Errors in functionality label Jun 27, 2023
@finetjul finetjul added module: webxr Issues related to VR and AR module: webgl Issues related to WebGL module: example Affect example and removed module: webgl Issues related to WebGL labels Jun 28, 2023
@tbirdso
Copy link
Contributor

tbirdso commented Jun 28, 2023

Hi @EricMoerthVis , thank you for entering an issue here. It would help me to have a few more details on your setup:

  1. What AR device are you using to test the examples?
  2. Is WebXRVolume the example that you are having difficulty in running?
  3. What browser are you using to visit the example page?
  4. Are there any errors in the browser console log?

The WebXRVolume example attempts to auto-detect whether the hosted device is an AR or VR device and run accordingly. In the case of devices that support both AR and VR scenes, such as the Meta Quest 2 headset, it defaults to AR. However, we can set the xrSessionType=0 browser parameter to explicitly request that the scene renders in a VR headset. Other supported vtk.js XR session types are enumerated at OpenGL/RenderWindow/Constants.js.

Would you please try the following link and let us know whether you are able to launch the VR scene successfully:

https://kitware.github.io/vtk-js/examples/WebXRVolume/WebXRVolume.html?fileURL=https://data.kitware.com/api/v1/file/624320e74acac99f42254a25/download&xrSessionType=0

You can also add ?xrSessionType=0 or &xrSessionType=0 to the URL of most other WebXR examples to request rendering with a VR HMD. If the link above works for you, I will work to update and clarify our documentation for requesting a specific XR session type.

@tbirdso tbirdso changed the title [Bug] WebXR Examples [Bug] WebXR Examples Default To Undesired Session Type Jun 28, 2023
@EricMoerthVis
Copy link
Author

  1. The Meta Quest Pro
  2. Yes
  3. The built in Browser on the Meta Quest Pro
  4. Will check again

It seams like from time to time the examples can be opened but at other times they load forever and I don't see any rendering happening. I will check again for error loggs in the Browser within the goggles (if I manage to open them)

The example you stated here works on the goggles and I can go into VR Mode, but the controls then don't work any more. Before I go into VR mode I can use the controllers to move the cube and rotate it and such. But as soon as I go into the VR mode the cube just moves out of frame when I press the button on the right controller.

Maybe you could add the flagg xrSessionType for the examples on the page you have there? You already have two categories there with VR and AR but both examples lead to the same URL without the xrSessionType flag.

I will try further and keep you posted if I was able to get the medical imaging data running in VR on the Goggles.

@tbirdso
Copy link
Contributor

tbirdso commented Jun 29, 2023

Thank you for the details here.

It seams like from time to time the examples can be opened but at other times they load forever and I don't see any rendering happening. I will check again for error loggs in the Browser within the goggles (if I manage to open them)

Some of the volume files are rather large and may take a moment to load. I wonder if there are memory constraints for the Meta Quest Pro built-in browser causing this behavior. Errors in the console log would indeed help us better understand this issue.

The example you stated here works on the goggles and I can go into VR Mode, but the controls then don't work any more. Before I go into VR mode I can use the controllers to move the cube and rotate it and such. But as soon as I go into the VR mode the cube just moves out of frame when I press the button on the right controller.

Yes, while rendering is supported on multiple devices, unfortunately XR interaction support is still rather limited. For now WebXR examples only support translation in the direction of the Quest controller when the trigger is pressed. Interaction support is tracked on the vtk.js WebXR feature roadmap at #2571.

Maybe you could add the flagg xrSessionType for the examples on the page you have there? You already have two categories there with VR and AR but both examples lead to the same URL without the xrSessionType flag.

I agree, it would be clearer to add explicit links for each type. I will work on updating example pages accordingly.

tbirdso added a commit to tbirdso/vtk-js that referenced this issue Jul 5, 2023
Updates general documentation for WebXR support. Adds example links to target specific XR session
types for supported platforms, including "VR", handheld mobile AR, head-mounted AR, and holographic
sessions. Updates FAQ with questions on launching XR experiences in vtk.js.

re Kitware#2861
re Kitware#2862
@tbirdso tbirdso linked a pull request Jul 5, 2023 that will close this issue
4 tasks
github-merge-queue bot pushed a commit that referenced this issue Jul 6, 2023
Updates general documentation for WebXR support. Adds example links to target specific XR session
types for supported platforms, including "VR", handheld mobile AR, head-mounted AR, and holographic
sessions. Updates FAQ with questions on launching XR experiences in vtk.js.

re #2861
re #2862
@tbirdso
Copy link
Contributor

tbirdso commented Jul 6, 2023

Hi @EricMoerthVis , we have updated WebXR example pages for better clarity concerning XR session types. The page should update within the next hour or two. Please re-open this issue if you find that you still have trouble launching scenes in your Quest Pro headset.

EDIT: WebXR documentation link: https://kitware.github.io/vtk-js/docs/develop_webxr.html

tbirdso added a commit to tbirdso/vtk-js that referenced this issue Jul 12, 2023
Updates the default XR session type preference in WebXRVolume and GeometryViewer examples to better
reflect our current XR supported devices list. Previously single-screen mobile devices were the only
devices supporting both VR (Cardboard) and AR sessions with AR generally favored, so AR mode was
made the default. Recently vtk.js added support for HMDs compatible with both VR and AR
(passthrough) mode, which require stereoscopic AR rendering different from the mobile AR approach.
Under the status quo the default behavior on such an HMD was to attempt to render in AR mobile as if
it were a mobile device, which would produce incorrect renderings. This change prefers rendering in
VR mode such that default HMD behavior will be rendering in full virtual reality and some mobile
devices may render in Cardboard VR mode by default. AR HMD and AR mobile experiences may still be
accessed through explicit, non-default links in the WebXR documentation landing page.

re Kitware#2862
github-merge-queue bot pushed a commit that referenced this issue Jul 13, 2023
Updates the default XR session type preference in WebXRVolume and GeometryViewer examples to better
reflect our current XR supported devices list. Previously single-screen mobile devices were the only
devices supporting both VR (Cardboard) and AR sessions with AR generally favored, so AR mode was
made the default. Recently vtk.js added support for HMDs compatible with both VR and AR
(passthrough) mode, which require stereoscopic AR rendering different from the mobile AR approach.
Under the status quo the default behavior on such an HMD was to attempt to render in AR mobile as if
it were a mobile device, which would produce incorrect renderings. This change prefers rendering in
VR mode such that default HMD behavior will be rendering in full virtual reality and some mobile
devices may render in Cardboard VR mode by default. AR HMD and AR mobile experiences may still be
accessed through explicit, non-default links in the WebXR documentation landing page.

re #2862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: example Affect example module: webxr Issues related to VR and AR type: bug 🐞 Errors in functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants