visionOS - AR Passthrough in Immersive Mode?

For the Vision Pro I want to create a mixed reality experience in Immersive Mode, however when I enter immersive mode in the Simulator, the background goes black when I want to continue seeing the living room (or whatever room someone is in). I notice in the ImmersiveView code it lists adding a skybox.

Does that mean ImmersiveView is VR or full visual takeover of the room, like with a skybox and not mixed reality, or I need to make changes? Thanks.

import SwiftUI import RealityKit import RealityKitContent

struct ImmersiveView: View { var body: some View { RealityView { content in // Add the initial RealityKit content if let immersiveContentEntity = try? await Entity(named: "Immersive", in: realityKitContentBundle) { content.add(immersiveContentEntity)

            // Add an ImageBasedLight for the immersive content
            guard let resource = try? await EnvironmentResource(named: "ImageBasedLight") else { return }
            let iblComponent = ImageBasedLightComponent(source: .single(resource), intensityExponent: 0.25)
            immersiveContentEntity.components.set(iblComponent)
            immersiveContentEntity.components.set(ImageBasedLightReceiverComponent(imageBasedLight: immersiveContentEntity))

            // Put skybox here.  See example in World project available at
            // https://developer.apple.com/
        }
    }
}

}

#Preview { ImmersiveView() .previewLayout(.sizeThatFits) }

From my understanding you want to still see the room while an Immersive Space space is active? For that, you can simply set the immersionStyle selection to .mixed, from where you register the ImmersiveSpace in your @main app body.

Here's an example I have:

ImmersiveSpace(id: "ImmersiveView") { ImmersiveView(viewModel: viewModel) }.immersionStyle(selection: .constant(.mixed), in: .mixed)

https://developer.apple.com/documentation/swiftui/immersionstyle

visionOS - AR Passthrough in Immersive Mode?
 
 
Q