Smooth fade in and out from passthrough mode on Oculus Quest 3

I am not sure this is the correct forum to post this question, but since passthrough is enabled on Oculus with the ARCameraManager component, I think it is.

The way to toggle passthrough using ARFoundation is as simple as this

private void togglePassthrough(bool turnOn) {
        arCameraManager.enabled = turnOn;//disable passthrough
        Camera.main.clearFlags = turnOn ? CameraClearFlags.SolidColor : CameraClearFlags.Skybox;
    }

However, I want to have a smooth transition. A fade in/out, similar to when you step out of the boundaries you set the virtual content fades away.

Is there a way to accomplish this with ARFoundation and/or XR Interaction Toolkit?

Answering myself again…one can use a transparent skybox at all times, always use skybox clear flag, and always leave the passthrough enabled.

This enables one to animate the transparency from the skybox and hence switch from AR/VR smoothly.

Still if there’s an official API for ARFoundation to do this let me know.

That’s a pretty clever way to do it. No there is no AR Foundation API for this.