Contents

init(equirectangular:options:)

Synchronously creates an environment resource from an equirectangular image.

Declaration

@MainActor convenience init(equirectangular cgImage: CGImage, options: EnvironmentResource.CreateOptions) throws

Parameters

  • cgImage:

    The source equirectangular (latitude, longitude) image. To preserve all details use an image where the width is half the height.

Discussion

Loading an EnvironmentResource with this method blocks the main actor because it’s synchronous, so only call it from a command-line application. The method can stall a regular app, which makes it visibly hitch, and the system terminates an app if its UI becomes unresponsive.

See Also

Creating an environment resource