GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
82 stars 17 forks source link

Add support for HTC passthrough #151

Closed BastiaanOlij closed 1 month ago

BastiaanOlij commented 1 month ago

This PR adds support for HTCs version of passthrough in a way that is transparent to the user. Here we also react to our blend mode.

I did have to add some extra checks to the Meta implementation because while the HTC implementation became active, Metas implementation wasn't checking whether it was actually active and just started error spamming as a result :P

Note that there is an interesting difference here as well, while Meta explicitly requires us to start and stop passthrough, HTC doesn't. We do need to create a passthrough handle once the session is setup, but from then on passthrough is purely switched on whether the passthrough composition layer is added.

I am making the assumption here, and I think that's a fairly safe assumption, that no device is going to support both Metas and HTCs passthrough extensions. If this does become an issue we may need to do something like set_emulate_environment_blend_mode_alpha_blend returning an error when another extension has already claimed it.

Tested this on my HTC Elite XR and seems to work fine.

Note, thanks to @seichter (PR https://github.com/godotengine/godot/pull/86407) for doing much of the ground work. Made it really easy to implement this in the vendor plugin.

dsnopek commented 1 month ago

Looks like this needs a rebase on conflicts in CHANGES.md