Skip to content

Add WebXR support#30

Merged
jourdain merged 5 commits into
Kitware:masterfrom
munozco:webxr
Apr 20, 2026
Merged

Add WebXR support#30
jourdain merged 5 commits into
Kitware:masterfrom
munozco:webxr

Conversation

@munozco
Copy link
Copy Markdown
Contributor

@munozco munozco commented Jun 19, 2025

These changes add support for WebXR.
This PR depends on the following VTK merge request: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12221

The autoResize property has been added to address an issue when using an XR device. Setting it to false should prevent trame from resizing the render window on the server side based on the client component size. When autoResize is set to true, the server will match the size of the client's render window and won't fit perfectly on a VR/AR headset display.

Commit dd87cdf is unrelated but it fixed a bug I encountered when making these changes.

Cc: @LucasGandel @finetjul

Comment thread examples/demo/webxr.py Outdated
Comment thread vue-components/src/components/VtkLocal.js
@jourdain
Copy link
Copy Markdown
Collaborator

If the CI come back green, should we merge? If so, remove the draft flag.

@munozco
Copy link
Copy Markdown
Contributor Author

munozco commented Jun 26, 2025

Should I wait for the VTK WebXR MR (https://gitlab.kitware.com/vtk/vtk/-/merge_requests/12221) to be merged to remove the draft flag ?

@jourdain
Copy link
Copy Markdown
Collaborator

We can either wait, or you could test the vtk version in start_xr (py) at runtime to make sure the xr capability is available. If not you can warn to use a newer version of vtk.

@jspanchu
Copy link
Copy Markdown
Member

jspanchu commented Mar 28, 2026

@munozco i saw that you merged the upstream VTK MR this week. Let's move forward with this. After the weekly release artifacts become available, you can check against that version 9.6.20260328 like Seb said.

@munozco
Copy link
Copy Markdown
Contributor Author

munozco commented Apr 3, 2026

I'm afraid WebXR support in trame will be limited (unless using the WebXR emulator). When synchronizing the vtk state (when the slider is changed in the webxr example) while a WebXR session is active, the render window is resized to 10x10 (I think?). I tried to change a few things in vtk-wasm, but I wasn't able to find a solution...

@jourdain @jspanchu Are you okay with merging this ? I'll open an issue about this bug.

@munozco munozco marked this pull request as ready for review April 3, 2026 16:00
@jspanchu
Copy link
Copy Markdown
Member

jspanchu commented Apr 3, 2026

i see, let's try to fix the resize issue before merging this.

Comment thread src/trame_vtklocal/widgets/vtklocal.py Outdated
Comment thread src/trame_vtklocal/widgets/vtklocal.py Outdated
Comment thread vue-components/src/components/VtkLocal.js
Comment thread vue-components/src/components/VtkLocal.js
@munozco
Copy link
Copy Markdown
Contributor Author

munozco commented Apr 16, 2026

@jspanchu I found a way to fix this, but this requires a small change in vtk-wasm. Here's the PR Kitware/vtk-wasm#38.

I don't really know if I'm breaking something else with this change. Is there some way I could test it ?

@jspanchu
Copy link
Copy Markdown
Member

We do not have e2e tests so my suggestion will be to run the different examples and check if anything odd happens when resizing the browser window.

Comment thread examples/demo/webxr.py Outdated
Comment thread examples/demo/webxr.py Outdated
Comment thread examples/demo/webxr.py Outdated
Comment thread examples/demo/webxr.py Outdated
@munozco
Copy link
Copy Markdown
Contributor Author

munozco commented Apr 20, 2026

i see, let's try to fix the resize issue before merging this.

I tried a few and it seems to be working well.

@munozco munozco requested a review from jourdain April 20, 2026 14:16
@jourdain
Copy link
Copy Markdown
Collaborator

Should we merge it?

@munozco
Copy link
Copy Markdown
Contributor Author

munozco commented Apr 20, 2026

Should we merge it?

I'd like to have @jspanchu approval

@jspanchu jspanchu self-requested a review April 20, 2026 15:37
@jourdain jourdain merged commit 7415b02 into Kitware:master Apr 20, 2026
4 checks passed
@munozco munozco deleted the webxr branch April 21, 2026 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants