Skip to content

OpenXR: Add support for render models extension - #107388

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
BastiaanOlij:openxr_render_models_ext
Jun 20, 2025
Merged

Repiteo merged 1 commit into
godotengine:masterfrom
BastiaanOlij:openxr_render_models_ext

Conversation

@BastiaanOlij

@BastiaanOlij BastiaanOlij commented Jun 11, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds support for the new XR_EXT_render_model and XR_EXT_interaction_render_model extensions introduced in OpenXR 1.1.49

These extensions, when enabled and supported, will give an application access to fully animated models of the controllers currently held by the users, including tracking data for these controllers.

This PR adds a new extension class called OpenXRRenderModelExtension that, when enabled, will keep track of all the render models detected by the XR runtime. This class also contains a number of lower level methods that allow custom consumption of the data and enables vendor extensions to register additional render models in the system.

The PR also adds two helper nodes, OpenXRRenderModels and OpenXRRenderModel that makes the render models logic easily accessible. A user simply adds the OpenXRRenderModels as a child node of the `XROrigin3D`` node to make the system work.

Documentation PR can be found here: godotengine/godot-docs#11014
Demo project that uses this feature: https://github.com/BastiaanOlij/godot-xr-flynn-demo

Note: implementations in runtimes are still locked preventing the general public from using these features, but support should be rolling out for headsets very soon.

Contributed by Khronos Group through the Godot Integration Project

@BastiaanOlij BastiaanOlij added this to the 4.6 milestone Jun 11, 2025
@BastiaanOlij BastiaanOlij self-assigned this Jun 11, 2025
@BastiaanOlij
BastiaanOlij requested review from a team as code owners June 11, 2025 04:21
@BastiaanOlij
BastiaanOlij force-pushed the openxr_render_models_ext branch 3 times, most recently from 89c5a70 to 6784e2d Compare June 11, 2025 04:51

@dsnopek dsnopek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

I did a quick skim of the code, and this is looking great! I only had a handful of minor comments

Comment thread modules/openxr/scene/openxr_render_models.h Outdated
Comment thread modules/openxr/scene/openxr_render_models.h Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated

@devloglogan devloglogan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Quick scan through the docs, planning to take a look through the rest tomorrow! 🙂

Comment thread doc/classes/ProjectSettings.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModel.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModel.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModels.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModels.xml Outdated
Comment thread modules/openxr/openxr_api.cpp Outdated
@BastiaanOlij
BastiaanOlij force-pushed the openxr_render_models_ext branch from 6784e2d to 1ba9394 Compare June 13, 2025 07:45
Comment thread modules/openxr/doc_classes/OpenXRRenderModel.xml Outdated
Comment on lines 347 to 377

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we expect the gltf extensions to change during runtime? If not, we can populate the list once and just reuse it.

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.

Honestly, I don't know for sure. I assume we could load this once and re-use but in theory there could be an order of execution issue as I believe plugins can add support for extensions.

That said, there isn't much overhead in this. It's not likely we would load more than a few individual models and the processing of the GLTF will far outweigh creating this list of extensions.

Comment thread modules/openxr/scene/openxr_render_model_manager.cpp Outdated
Comment thread modules/openxr/scene/openxr_render_model_manager.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.h Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/extensions/openxr_render_model_extension.cpp Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelManager.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModelExtension.xml Outdated
Comment thread modules/openxr/doc_classes/OpenXRRenderModel.xml Outdated
@BastiaanOlij
BastiaanOlij force-pushed the openxr_render_models_ext branch 2 times, most recently from 4b818e3 to 6b96fe9 Compare June 18, 2025 11:29
Comment thread modules/openxr/scene/openxr_render_model_manager.h Outdated
@BastiaanOlij
BastiaanOlij force-pushed the openxr_render_models_ext branch from 6b96fe9 to 60a9b88 Compare June 19, 2025 00:52
@BastiaanOlij

Copy link
Copy Markdown
Contributor Author

Got one more small fix coming in a few minutes after testing on Pico 4 ultra. Animatable child nodes can be any level deep so instead of get_node_or_null we need to use find_node, and as there is an extra cost to that I now cache those.

We had made that change some time ago but missed merging it into our main branch. Oops.

@BastiaanOlij
BastiaanOlij force-pushed the openxr_render_models_ext branch from 60a9b88 to b65b367 Compare June 19, 2025 09:16
@BastiaanOlij

Copy link
Copy Markdown
Contributor Author

Ok, verified the fix works! Tested it on two separate XR runtimes that will have support for this soon. Hopefully I can share when it is made public soon.

Anyway, I think this can be merged now.

@Repiteo Repiteo modified the milestones: 4.6, 4.5 Jun 20, 2025
@Repiteo
Repiteo merged commit c7d2ea4 into godotengine:master Jun 20, 2025
@Repiteo

Repiteo commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

Thanks!

@BastiaanOlij
BastiaanOlij deleted the openxr_render_models_ext branch June 21, 2025 10:31
BendyLand pushed a commit to BendyLand/voltaire that referenced this pull request Aug 2, 2026
…_models_ext

OpenXR: Add support for render models extension
wangshucheng pushed a commit to wangshucheng/godot that referenced this pull request Aug 27, 2026
…_models_ext

OpenXR: Add support for render models extension
Shane-Gadsby pushed a commit to Shane-Gadsby/godotwebgpu that referenced this pull request Sep 21, 2026
…_models_ext

OpenXR: Add support for render models extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants