Skip to content

Conversation

@tbirdso
Copy link
Contributor

@tbirdso tbirdso commented Dec 17, 2021

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Context

First step in adding AR support as part of our WebXR investigation.

Changes

  • Updates OpenGL/vtkRenderWindow to support immersive-ar sessions via the WebXR AR module
  • Forks VR cone example for a basic AR example

Results

  • AR is functional in WebXR emulator and in mobile device testing

cone-ar-emulator

Testing

  • All tests complete without errors on the following environment:
    • vtk.js: v21.3.0
    • OS: Windows 10
    • Browser: Chrome 96.0.4664.110
  • AR example functions on mobile and in WebXR emulator
    • See WebXR emulator extension repo for install instructions
    • For testing on mobile, run the example with npm test example -- AR and visit the displayed LAN address in your mobile browser. May require adjusting firewall rules on your host machine.

@tbirdso tbirdso requested review from floryst and martinken December 17, 2021 20:06
@martinken
Copy link
Member

Only thing I would suggest is adding basic (just empty or similar) startXR methods (or some query for the feature) to RenderWindowViewNode which is the superclass for API specific RenderWindows. Otherwise with WebGPU I think it will cause console errors yes?

@tbirdso
Copy link
Contributor Author

tbirdso commented Jan 4, 2022

@martinken I haven't specifically tested for WebGPU behavior, are there resources I could use to look into this?

In any case, isn't it reasonable to throw a console error if we try to enter XR on an unsupported backend?

@martinken
Copy link
Member

martinken commented Jan 4, 2022

If we only call them when someone is asking to go into VR then sure (which looks like the case here) , though the console message will be that the method doesn't exist as opposed to something nicer. Might be nice to have a query method for if the API supports it so we could hide the toggle. e.g. if on an API (e.g. WebGPU) that doesn't support XR, don;t show the toggle. So even if the browser supports WebXR, if the backend doesn;t support it we don;t show the GUI toggle. It could be something like RenderWindowViewNode.supportsFeature('WebXR') and defaults to false for everything. Then in WebGL we return true for that.

@martinken
Copy link
Member

Love it!

@tbirdso tbirdso merged commit 9084a56 into Kitware:master Jan 4, 2022
@github-actions
Copy link

github-actions bot commented Jan 4, 2022

🎉 This PR is included in version 21.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Jan 4, 2022
@tbirdso tbirdso mentioned this pull request Sep 9, 2022
46 tasks
@tbirdso tbirdso deleted the test-ar branch February 26, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Automated label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants