Contents

preferredSurroundingsEffect(_:)

Applies an effect to passthrough video.

Declaration

nonisolated func preferredSurroundingsEffect(_ effect: SurroundingsEffect?) -> some CompositorContent

Parameters

  • effect:

    The effect that you want to apply.

Return Value

A CompositorContent that exhibits the specified preference.

Discussion

Use this modifier to indicate a preference for the appearance of passthrough video when displaying the modified compositor content. For example, you can enhance the immersiveness of a scene that uses the default mixed immersion style by applying the systemDark preference to a compositor content inside the scene.

This also dims passthrough video, which helps to draw attention to the scene’s virtual content while still enabling people to remain aware of their surroundings.

Use a value of nil to indicate that you have no preference. You typically do this to counteract a preference expressed by something lower in the view hierarchy.