Skip to content
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

[WIP] Integrate XR_META_environment_depth #230

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maunvz
Copy link
Contributor

@maunvz maunvz commented Dec 1, 2024

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
Copy link
Contributor Author

maunvz commented Dec 1, 2024

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

@dsnopek
Copy link
Collaborator

dsnopek commented Dec 2, 2024

Just a couple links to some of the earlier discussion about how to integrate this extension:

@erik-kallen
Copy link

@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

@maunvz
Copy link
Contributor Author

maunvz commented Dec 8, 2024

@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

@erik-kallen
Copy link

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.

@dsnopek dsnopek mentioned this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants