-
-
Notifications
You must be signed in to change notification settings - Fork 22.7k
OpenXR: Add support for render models extension #107388
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
OpenXR: Add support for render models extension #107388
Conversation
89c5a70
to
6784e2d
Compare
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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! 🙂
6784e2d
to
1ba9394
Compare
Vector<const char *> supported_gltf_extensions = { | ||
"KHR_lights_punctual", | ||
"KHR_materials_pbrSpecularGlossiness", | ||
"KHR_texture_transform", | ||
"KHR_materials_unlit", | ||
"KHR_materials_emissive_strength" | ||
}; | ||
|
||
// Now find anything we support through plugins, which is a bit of a pain as they are converted to Strings | ||
// and we need to convert them back. | ||
Vector<CharString> char_extensions; // Just for temp storage of our c-strings. | ||
Vector<Ref<GLTFDocumentExtension>> gltf_document_extensions = GLTFDocument::get_all_gltf_document_extensions(); | ||
for (Ref<GLTFDocumentExtension> &gltf_document_extension : gltf_document_extensions) { | ||
Vector<String> supported_extensions = gltf_document_extension->get_supported_extensions(); | ||
for (String &extension : supported_extensions) { | ||
char_extensions.push_back(extension.utf8()); | ||
} | ||
} | ||
|
||
// Now we can add them to our supported extensions list. | ||
for (CharString &cs : char_extensions) { | ||
supported_gltf_extensions.push_back(cs.get_data()); | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
1ba9394
to
f344b86
Compare
4b818e3
to
6b96fe9
Compare
6b96fe9
to
60a9b88
Compare
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 We had made that change some time ago but missed merging it into our main branch. Oops. |
60a9b88
to
b65b367
Compare
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. |
Thanks! |
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
andOpenXRRenderModel
that makes the render models logic easily accessible. A user simply adds theOpenXRRenderModels
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