VisionOS Destination question

I've been pouring over the code for Apple's visionOS demo: "Destination" trying to figure out something about its skybox. (not really a box, there, Apple).

The skybox contains a 360deg panorama, but only one half shows with the other half fades out to nothing. I cannot find anywhere there is an alpha channel being set, a lighting or material effect causing that. But "alpha" doesn't show up and the only gradients are use to make controls standout a little more in its window.

I need a full panorama that shows., no fading.

The level of immersion is controlled by the immersionStyle view modifier applied to the ImmersiveSpace.

The supported levels of immersion are mixed, progressive and full. More information can be found on the supported immersion styles here: https://developer.apple.com/documentation/swiftui/immersionstyle. In short, the mixed immersion style means you can show your content in the real world; the progressive immersion style allows a background to be placed to occlude parts of the real world, with the user turning the Digital Crown to control the level of immersion; and finally full immersion which uses your content to fully occlude the real world.

As you can imagine, the progressive mode used by the Destination Video app means that the video partially occludes the world, but doesn't cover the full 360 degrees around the user by default. You can change this behaviour by opening the DestinationVideo.swift file in the project (where the @main entry point is defined), and replacing the following code:

.immersionStyle(selection: .constant(.progressive), in: .progressive)

with...

.immersionStyle(selection: .constant(.full), in: .full)

However, unless you need to enforce a full immersion, for example for the purposes of a game, it is perhaps better to support progressive immersion and allow the user to decide by turning the Digital Crown to control the level of immersion.

For more information, I'd suggest the WWDC 23 session "Getting started with building apps for spatial computing".

VisionOS Destination question
 
 
Q