---
title: FadeEnvironmentCommand
framework: Immersive Media Support
role: symbol
role_heading: Structure
platforms: [iOS 26.4+, iPadOS 26.4+, Mac Catalyst 26.4+, macOS 26.0+, visionOS 26.0+]
path: immersivemediasupport/fadeenvironmentcommand
---

# FadeEnvironmentCommand

A command type for opacity fading environment backdrops during immersive media playback.

## Declaration

```swift
struct FadeEnvironmentCommand
```

## Overview

Overview Opacity fade is used to apply requested opacity to the AIV environment backdrops. Fade environment commands can be absolute time based or offset based. If fade commands are absolute time based, then property time dictates the time it needs to start executing and keep fading until the duration property value. On the other hand if they are offset based, then offset property dictates the fade percentage from the start time of the fade command till the duration of the fade. If the fade has to start at time 0.0 second of the playback for duration of 1.0 seconds and if the media FPS is 90, then first frame should be accompanied with presentation metadata with fade command which has 0.011 as offset. Second frame should have fade command with offset 0.022 and so on. For the 90th frame, we should receive offset 1.0.

## Topics

### Initializers

- [init(from:)](immersivemediasupport/fadeenvironmentcommand/init(from:).md)
- [init(id:time:duration:direction:opacity:offset:)](immersivemediasupport/fadeenvironmentcommand/init(id:time:duration:direction:opacity:offset:).md)

### Instance Properties

- [direction](immersivemediasupport/fadeenvironmentcommand/direction.md)
- [duration](immersivemediasupport/fadeenvironmentcommand/duration.md)
- [id](immersivemediasupport/fadeenvironmentcommand/id.md)
- [offset](immersivemediasupport/fadeenvironmentcommand/offset.md)
- [opacity](immersivemediasupport/fadeenvironmentcommand/opacity.md)
- [time](immersivemediasupport/fadeenvironmentcommand/time.md)

### Instance Methods

- [encode(to:)](immersivemediasupport/fadeenvironmentcommand/encode(to:).md)

### Enumerations

- [FadeEnvironmentCommand.FadeDirection](immersivemediasupport/fadeenvironmentcommand/fadedirection.md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Presentation commands

- [PresentationCommand](immersivemediasupport/presentationcommand.md)
- [FadeCommand](immersivemediasupport/fadecommand.md)
- [SetCameraCommand](immersivemediasupport/setcameracommand.md)
- [ShotFlopCommand](immersivemediasupport/shotflopcommand.md)
- [ShotFlipCommand](immersivemediasupport/shotflipcommand.md)
- [PresentationDescriptor](immersivemediasupport/presentationdescriptor.md)
- [PresentationDescriptorReader](immersivemediasupport/presentationdescriptorreader.md)
