---
title: "generateCubemap(fromLight:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlphotometriclight/generatecubemap(fromlight:)"
---

# generateCubemap(fromLight:)

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

## Declaration

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

## Parameters

- `textureSize`: The size (side length in pixels) of cube map texture to generate.

## Discussion

Discussion After generating a texture, use the 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.

## See Also

### Interpreting the Light Web as a Cube Texture

- [lightCubeMap](modelio/mdlphotometriclight/lightcubemap.md)
