---
title: "generateSkybox(using:fromEquirectangular:quality:into:)"
framework: realitykit
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, tvOS 27.0+, visionOS 27.0+]
path: "realitykit/skyboxgenerator/generateskybox(using:fromequirectangular:quality:into:)"
---

# generateSkybox(using:fromEquirectangular:quality:into:)

Adds commands for generating a cube from an equirectangular image, including generating mipmaps.

## Declaration

```swift
func generateSkybox(using commandBuffer: any MTLCommandBuffer, fromEquirectangular texture: any MTLTexture, quality: TextureSamplingQuality = .low, into destination: any MTLTexture) throws
```

## Parameters

- `commandBuffer`: The command buffer to dispatch GPU work to generate cubemap
- `texture`: The source image equirectangular texture, also known as “latitude longitude” texture.
- `quality`: The sampling quality the method applies as it generates the cube texture.
- `destination`: The destination cube texture. Use doc://com.apple.RealityKit/documentation/RealityKit/SkyboxGenerator/makeDescriptor(fromEquirectangular:) to get a recommended descriptor for creating the destination texture.

## Discussion

Discussion note: If texture is not a 2D Metal texture, if destination is not a cube texture, or if destination’s pixel format does not support shader writes on this device.

## See Also

### Generating a skybox

- [makeDescriptor(fromEquirectangular:)](realitykit/skyboxgenerator/makedescriptor(fromequirectangular:).md)
