---
title: "generateSpecular(using:fromSkyboxCube: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/imagebasedlighttexturegenerator/generatespecular(using:fromskyboxcube:quality:into:)"
---

# generateSpecular(using:fromSkyboxCube:quality:into:)

Adds commands for generating an image based light specular texture from a skybox cube.

## Declaration

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

## Parameters

- `commandBuffer`: The command buffer to dispatch GPU work to generate Image Based Light Specular
- `texture`: The source image cube skybox texture, which must have mipmaps.
- `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/ImageBasedLightTextureGenerator/makeSpecularDescriptor(fromCube:) to get a recommended descriptor for creating the destination texture.

## Discussion

Discussion note: If destination’s pixel format does not support shader writes on this device, or if a per-mip texture view cannot be created.

## See Also

### Generating IBL textures

- [generateDiffuse(using:fromSkyboxCube:quality:into:)](realitykit/imagebasedlighttexturegenerator/generatediffuse(using:fromskyboxcube:quality:into:).md)
