godot_openxr_vendors
godot_openxr_vendors copied to clipboard
[WIP] Integrate XR_META_environment_depth
Starting a draft for integrating XR_META_environment_depth, based on the documentation / samples:
https://developers.meta.com/horizon/documentation/native/android/mobile-depth https://github.com/meta-quest/Meta-OpenXR-SDK/tree/main/Samples/XrSamples/XrPassthroughOcclusion
As written, the plugin can initialize the depth extension, allocate the swapchain, and receive depth buffer updates every frame. Testing on a Quest 3, debug logs showed valid OpenGL texIds, resolution as 512x512, and the swapchain index updates every few frames.
Next step is to integrate the depth buffer into the rendering pipeline so it can occlude (hole punch?) the godot scene based on environment depth info. I haven't quite figure out where / how to plug that in, or if it's even possible from an extension instead of the main engine source
Some more notes: The swapchain's format / intended usage isn't exactly clear from the documentation, which just says "The format and convention is the same as for regular OpenGL depth textures."
The fragment shader in the sample is a bit more helpful: https://github.com/meta-quest/Meta-OpenXR-SDK/blob/main/Samples/XrSamples/XrPassthroughOcclusion/Src/XrPassthroughOcclusionGl.cpp#L641
Just a couple links to some of the earlier discussion about how to integrate this extension:
- https://github.com/GodotVR/godot_openxr_vendors/issues/224
- https://github.com/GodotVR/godot_openxr_vendors/issues/133
@maunvz I also made a draft PR (#232) for this. I don't think we should compete, but I started work before this PR was up
@erik-kallen oh nice, looks like yours is farther along as well. I'll leave some notes/comments on there if you plan to keep working on this, I probably won't have time to make more progress on mine in the near future
I think they are in similar states, since neither of them actually works. I won't have time to work on it for the rest of the year, either.
Superseded by https://github.com/GodotVR/godot_openxr_vendors/pull/273