godot_openxr_vendors icon indicating copy to clipboard operation
godot_openxr_vendors copied to clipboard

[WIP] Integrate XR_META_environment_depth

Open maunvz opened this issue 11 months ago • 5 comments
trafficstars

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

maunvz avatar Dec 01 '24 01:12 maunvz

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

maunvz avatar Dec 01 '24 01:12 maunvz

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

dsnopek avatar Dec 02 '24 14:12 dsnopek

@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 avatar Dec 07 '24 09:12 erik-kallen

@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

maunvz avatar Dec 08 '24 03:12 maunvz

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.

erik-kallen avatar Dec 08 '24 10:12 erik-kallen

Superseded by https://github.com/GodotVR/godot_openxr_vendors/pull/273

dsnopek avatar Jun 09 '25 19:06 dsnopek