5.6 OpenXR Passthrough feedback

I tried out the 5.6 improvements to OpenXR passthrough using my SteamVR API layer, and (almost) everything seems to work correctly. I implemented XR_EXT_composition_layer_inverted_alpha into the layer, and Unreal enables it successfully.

This would be enough for publishing to platforms where you know what features are supported, but not for general use, like PCVR. It would be nice to have better Blueprint support to check for what features are supported and enabled. I suggest adding these nodes:

  • GetEnvironmentBlendMode for checking the current setting.
  • IsEnvironmentBlendModeSupported for checking if the runtime supports passthrough.
  • GetPreferredEnvironmentBlendMode to get the runtime-preferred mode from the top of the list.
  • IsCompositionLayerInvertedAlphaEnabled to check if the inverted extension is active (so we can use postprocess to invert it otherwise, or only enable passthrough features that don’t use scene alpha).

It would also be a good idea to set up an enum for the the blend modes, instead of using a magic integer.

Also, xr.OpenXRInvertAlpha and xr.OpenXREnvironmentBlendMode could be added to the project settings OpenXR plugin tab to make them easier to find. It’s very bare at the moment.

1 Like

I looked more at it, and found a bug. The engine submits the frames as being alpha-premultiplied (XR_COMPOSITION_LAYER_UNPREMULTIPLIED_ALPHA_BIT not set), but does not perform any premultiplication on the transparent pixels. This results in translucent materials being too bright, and color bleeding around any edges. You should either implement a premultiplication pass, or set the correct flag in the compositions layers.

Playing with the image levels also shows that bloom bleeds over, and dithering leaves non-black noise in the transparent areas.

Full frames with and without alpha:


1 Like

Thanks @Rectus_SA we appreciate the feedback! We got support in last minute for 5.6 and only tested on Android, great to see that it works on PC as well. Will you be sharing your updated SteamVR API layer w. support for XR_EXT_composition_layer_inverted_alpha? It would be useful to test with as there’s currently no OpenXR runtime for PC that supports it.

1 Like

I already released it a while ago when UE 5.6 released, with version 0.3.4. I didn’t get around to posting about it here until now though.

1 Like

Thanks! We’re going to implement the functions and take a look at the issue(s) you reported for 5.7. The goal is to also implement a passthrough option in the VR Template by default.

2 Likes

Thanks, that sounds great.

BTW, I reported a marginally related issue to the bug tracker when working on the layer. The OpenXR composition layer depth seems to get submitted with the far plane (nearZ) distance set to the maximum finite float value, rather than +INF. If I understand it correctly Unreal uses a reversed depth buffer with an infinite far plane.

It probably isn’t a huge issue, but it might break any potential code that relies on switching of the planes being infinite or not.