---
title: "init(equirectangular:withName:)"
framework: realitykit
role: symbol
role_heading: Initializer
path: "realitykit/environmentresource/init(equirectangular:withname:)"
---

# init(equirectangular:withName:)

Asynchronously generates an environment resource from an equirectangular image.

## Declaration

```swift
@MainActor @preconcurrency convenience init(equirectangular cgImage: CGImage, withName resourceName: String? = nil) async throws
```

## Parameters

- `cgImage`: The source equirectangular (latitude, longitude) image. To preserve all details use an image where the width is half the height.
- `resourceName`: A unique name the method assigns to the resource it loads, for use in network synchronization.
