GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
110 stars 24 forks source link

Extension needs to execute code between xrBeginFrame and xrEndFrame #224

Open erik-kallen opened 2 weeks ago

erik-kallen commented 2 weeks ago

Hi!

I'm trying (like others, it seems) to implement the XR_META_environment_depth extension. I'm making decent progress, but I appear to have hit a wall:

There is a method (xrAcquireEnvironmentDepthImageMETA) that must be called between xrBeginFrame and xrEndFrame. I can't find any way to do this. _on_pre_render() is invoked before xrBeginFrame.

Is there anything I'm missing? Or is it possible to do this in some way I'm not thinking of?

dsnopek commented 2 weeks ago

I think that OpenXRExtensionWrapper::on_pre_draw_viewport() runs in-between xrBeginFrame() and xrEndFrame(), but it looks like we aren't exposing that to OpenXRExtensionWrapperExtension - I'm not sure why? It should be relatively easy to expose that! I'll make a PR and see if anyone on the XR team has any objections.

dsnopek commented 2 weeks ago

I just posted PR https://github.com/godotengine/godot/pull/98831 for Godot which exposes both of those virtual methods to GDExtension. Please let me know if they end up working for your use-case or not!

erik-kallen commented 2 weeks ago

Thank you, though I probably won't have the time to check it out this week.