<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLPhotometricLight/generateCubemap(fromLight:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLPhotometricLight(im)generateCubemapFromLight:"
  },
  "title" : "generateCubemap(fromLight:)"
}
-->

# generateCubemap(fromLight:)

Generates a cube map texture from the light’s photometry data.

```
func generateCubemap(fromLight textureSize: Int)
```

## Parameters

`textureSize`

The size (side length in pixels) of cube map texture to generate.

## Discussion

After generating a texture, use the [`lightCubeMap`](/documentation/ModelIO/MDLPhotometricLight/lightCubeMap) property to access it. In this texture, each texel represents the light’s intensity in the direction from the cube’s center to the texel’s position on the cube.

---

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)