<!--
{
  "availability" : [
    "iOS: 18.0.0 - 27.2.0",
    "iPadOS: 18.0.0 - 27.2.0",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 - 27.2.0",
    "tvOS: 26.0.0 - 27.2.0",
    "visionOS: 2.0.0 - 27.2.0"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/EnvironmentResource/init(equirectangular:withName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:17RealityFoundation19EnvironmentResourceC15equirectangular8withNameACSo10CGImageRefa_SSSgtYaKcfc::OverloadGroup"
  },
  "title" : "init(equirectangular:withName:)"
}
-->

# init(equirectangular:withName:)

Asynchronously generates an environment resource from an equirectangular image.

```
@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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)