<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/ImageBasedLightTextureGenerator/generateSpecular(using:fromSkyboxCube:quality:into:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:28RealityCoreTextureProcessing015ImageBasedLightC9GeneratorC16generateSpecular5using14fromSkyboxCube7quality4intoySo16MTLCommandBuffer_p_So10MTLTexture_pAA0C15SamplingQualityOSoAJ_ptKF"
  },
  "title" : "generateSpecular(using:fromSkyboxCube:quality:into:)"
}
-->

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

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

```
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 [`makeSpecularDescriptor(fromCube:)`](/documentation/RealityKit/ImageBasedLightTextureGenerator/makeSpecularDescriptor(fromCube:)) to get a recommended
descriptor for creating the destination texture.

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

---

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)