Skip to content

Initial XR support - #3245

Open
AoGao-Kedoka wants to merge 4 commits into
f3d-app:masterfrom
AoGao-Kedoka:xr
Open

Initial XR support#3245
AoGao-Kedoka wants to merge 4 commits into
f3d-app:masterfrom
AoGao-Kedoka:xr

Conversation

@AoGao-Kedoka

@AoGao-Kedoka AoGao-Kedoka commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

Adding XR support in rendering. Interactions will be handled in another future PR.

Steps to build and test

  1. To build the branch, first clone, build and install the openxr, then build vtk with:
    https://www.kitware.com/using-vtk-with-the-meta-quest/

    To use VTK with XR devices, enable the CMake option VTK_MODULE_ENABLE_VTK_RenderingOpenXR when building VTK, and set the OpenXR_DIR variable to provide the path to the OpenXR SDK install directory.

  2. Build F3D with: -DF3D_MODULE_OPENXR=ON
  3. Choose between two and run with f3d ../testing/data/<data>.<datatype> --rendering-backend=xr
    1. Attatch a HMD, open steamvr or
#!/bin/bash
# set monado as active openxr runtime
rm ~/.config/openxr/1/active_runtime.json
ln -s /usr/share/openxr/1/openxr_monado.json ~/.config/openxr/1/active_runtime.json

# set simulated monado options
export XR_RUNTIME_JSON=/usr/share/openxr/1/openxr_monado.json
export QWERTY_ENABLE=1
export SIMULATED_ENABLE=1
export XRT_DEBUG_GUI=1
export XRT_COMPOSITOR_FORCE_XCB=1

# start service
monado-service
output

Checklist for finalizing the PR

  • I have performed a self-review of my code
  • I have added tests for new features and bugfixes
  • I have added documentation for new features
  • If it is a modifying the libf3d API, I have updated bindings
  • If it is a modifying the .github/workflows/versions.json, I have updated docker_timestamp

AI Disclosure

  • I did not use AI to generate any of the content of that pull request
  • I used AI to generate code in that pull request, if yes please disclose which part of the code was generated and with which model.
    GPT5.5 for Creating the bounding box and align objects to the bounding box. Reviewed and tested carefully.
  • ...

Continuous integration

Please write a comment to run CI, eg: \ci fast.
See here for more info.

@AoGao-Kedoka
AoGao-Kedoka requested a review from a team as a code owner June 16, 2026 19:17
@AoGao-Kedoka
AoGao-Kedoka marked this pull request as draft June 16, 2026 19:18
@github-actions

Copy link
Copy Markdown

You are modifying libf3d public API! ⚠️Please update bindings accordingly⚠️!
You can find them in their respective directories: c, python, java, webassembly.

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment thread vtkext/private/module/vtkF3DRenderer.cxx Outdated
Comment thread library/CMakeLists.txt Outdated
Comment thread library/src/interactor_impl.cxx Outdated
@AoGao-Kedoka

Copy link
Copy Markdown
Contributor Author

\ci fast

@AoGao-Kedoka
AoGao-Kedoka force-pushed the xr branch 2 times, most recently from c73a8a1 to f391604 Compare July 6, 2026 19:29
@AoGao-Kedoka
AoGao-Kedoka marked this pull request as ready for review July 6, 2026 19:33
@AoGao-Kedoka
AoGao-Kedoka force-pushed the xr branch 2 times, most recently from f9a4f4c to 7c9b1e4 Compare July 7, 2026 08:09

@Meakk Meakk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a first review. I'll try your branch before going more in depth.

Comment thread library/public/interactor.h Outdated
Comment thread library/public/engine.h Outdated
Comment thread vtkext/private/module/CMakeLists.txt Outdated
Comment thread vtkext/private/module/vtkF3DOpenXRFramebufferPass.h Outdated
Comment thread vtkext/private/module/vtkF3DRenderer.cxx Outdated
@AoGao-Kedoka
AoGao-Kedoka requested a review from Meakk July 13, 2026 14:22
@AoGao-Kedoka
AoGao-Kedoka force-pushed the xr branch 2 times, most recently from 88ac1e5 to 0228731 Compare July 13, 2026 14:27
@AoGao-Kedoka
AoGao-Kedoka requested a review from mwestphal July 22, 2026 20:14
@mwestphal

Copy link
Copy Markdown
Member

please rebase on master @AoGao-Kedoka

Comment thread library/src/window_impl.cxx
Comment thread library/src/window_impl.cxx Outdated
Comment thread library/src/engine.cxx

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick high level review.

Please capitalize it: XR or do not capitalize it at all xr depending of the context.

Comment thread library/src/interactor_impl.cxx Outdated
Comment thread library/src/interactor_impl.cxx Outdated
Comment thread application/F3DStarter.cxx
Comment thread vtkext/private/module/vtkF3DRenderer.h Outdated
Comment thread vtkext/private/module/vtkF3DRenderer.h Outdated
Comment thread vtkext/private/module/vtkF3DRenderer.h Outdated
Comment thread vtkext/private/module/vtkF3DRenderPass.cxx Outdated
Comment thread library/public/engine.h Outdated
@AoGao-Kedoka
AoGao-Kedoka requested a review from mwestphal July 26, 2026 14:00

@mwestphal mwestphal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc.

make sure to document which libf3d and cli options have no effect in XR mode

this->FrameBufferObject->StartNonOrtho(size[0], size[1]);
this->DelegatePass->Render(state);
this->FrameBufferObject->RemoveColorAttachments(1);
this->FrameBufferObject->UnBind();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a change in behavior ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in our use case. RenderDelegate supports rendering into an another image size, which it will create a new temporary camera. Copying a vtkOpenXRCamera into a vtkCamera would cause data loss, hence rendering result changes.
In our case we never render into an another image size, so the behavior should be the same.

Comment thread vtkext/private/module/vtkF3DRenderPass.h Outdated
Comment thread vtkext/private/module/vtkF3DRenderPass.h Outdated
Comment thread library/public/context.h Outdated
Comment thread library/private/interactor_impl.h Outdated
Comment thread library/src/window_impl.cxx
Comment thread library/src/window_impl.cxx Outdated
Comment thread library/src/window_impl.cxx Outdated
Comment thread library/CMakeLists.txt Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in resources/xr_actions_manifests/ add a .md file acknolowdging the origin of the files and their license and copyright.

@mwestphal mwestphal linked an issue Jul 29, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request: VR support for viewing and even manipulating models

3 participants