How to create a transparent immersive space in visionOS?

In visionOS, once an immersive space is opened, the background color is solid black, is it possible to make this background transparent?

FYI, The Immersive spaces on visionOS uses Compositor Services for drawing 3D content.

Answered by Vision Pro Engineer in 822050022

Hello @ZhengWeiX:

If you are using Compositor Services, there are a few things to check if you are seeing a black background:

  1. Ensure that you're specifying a "mixed" immersion style (versions "full").
  2. Ensure that you're specifying the correct clear color (alpha: 0) and load action.

For additional detail, please see Render Metal with passthrough in visionOS (WWDC 2024).

Thanks, Steve

Accepted Answer

Hello @ZhengWeiX:

If you are using Compositor Services, there are a few things to check if you are seeing a black background:

  1. Ensure that you're specifying a "mixed" immersion style (versions "full").
  2. Ensure that you're specifying the correct clear color (alpha: 0) and load action.

For additional detail, please see Render Metal with passthrough in visionOS (WWDC 2024).

Thanks, Steve

Hi Steve @Vision Pro Engineer , Thanks for the pointers, setting the immersionStyle to “mixed” did the trick. Even more, immersionStyle can be changed dynamically before ImmersiveSpace opened.

How to create a transparent immersive space in visionOS?
 
 
Q