Screen Fading using XR Composition Layers (Color Scale and Bias)

Is it possible to use Color Scale and Bias (from XR Composition Layers) for screen fading? E.g., fade to black, white, clear, etc.

In previous projects with OculusXR, we utilized the SetColorScaleAndOffset function. Is this the same concept? And is there a way to target the base composition layer with a Color Scale and Bias component?

1 Like

I spent some time with it and can say that this works.

E.g., a quad composition layer using a plain white texture set to render after the default scene layer. The quad has a Color Scale and Bias component whose color scale allows the screen fade color to be controlled.

I got stuck trying to use the Equirect layer type which seemingly doesn’t support transparency. The emulated composition layer does and works perfect, but in headset it was always fully opaque.

1 Like

Are you testing the equirect transparency with the link cable? It is a known issue that there is an equirect alpha bug with the PC runtime.

If you make a build to the Quest, the equirect should show transparency correctly.

2 Likes

Ahh, I was unaware. Thanks for the comment, @Du_Hoang_Unity

That’s correct, I was using Quest with the link cable. I probably should’ve suspected this was the issue as there are other differences between PC runtime and Quest native (e.g., capsense hand models not showing up unless it’s a build).

Would it be worth adding this gotcha to the XR Composition Layers Known Issues page, even if it’s an issue on Meta’s end?

1 Like