<!--
{
  "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/MDLLightProbe",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLLightProbe"
  },
  "title" : "MDLLightProbe"
}
-->

# MDLLightProbe

A light source described in terms of the variations in color and intensity of its illumination in all directions.

```
class MDLLightProbe
```

## Overview

A light probe represents this variation either as a cube map texture or as a set of spherical harmonic coefficients. In addition to describing such light sources, the [`MDLLightProbe`](/documentation/ModelIO/MDLLightProbe) class provides methods for generating light probe textures based on the contents of a scene and for generating spherical harmonic coefficients from a texture.

A light probe consists of two cube map textures, where each texel represents the color and intensity of light in a particular direction from the cube’s center:

- The [`reflectiveTexture`](/documentation/ModelIO/MDLLightProbe/reflectiveTexture) cube map, also known as an *environment map*, contains a rendering of a scene as viewed from the light probe’s position. A renderer can use this texture to create reflections on surfaces with metallic materials.
- The [`irradianceTexture`](/documentation/ModelIO/MDLLightProbe/irradianceTexture) cube map contains samples of the total light arriving at the light probe’s position from every direction. A renderer can use this texture to create diffuse lighting effects. You can derive an irradiance map from an environment map with methods on the [`MDLTexture`](/documentation/ModelIO/MDLTexture) class, or when creating a light probe with the [`init(textureSize:forLocation:lightsToConsider:objectsToConsider:reflectiveCubemap:irradianceCubemap:)`](/documentation/ModelIO/MDLLightProbe/init(textureSize:forLocation:lightsToConsider:objectsToConsider:reflectiveCubemap:irradianceCubemap:)) method.

Using cube map textures for light-probe-based rendering offers great visual fidelity, but adversely affects performance due to the cost of texture lookups during rendering. In addition, a cube map texture often contains more detail than is necessary for lighting. A set of spherical harmonic coefficients can represent the same information with less detail, and can be used in shader calculations with much less performance cost. To use spherical harmonics, call the [`generateSphericalHarmonics(fromIrradiance:)`](/documentation/ModelIO/MDLLightProbe/generateSphericalHarmonics(fromIrradiance:)) method, then access the generated data in the [`sphericalHarmonicsCoefficients`](/documentation/ModelIO/MDLLightProbe/sphericalHarmonicsCoefficients) property.

## Topics

### Creating a Light Probe

[`-  initWithReflectiveTexture:irradianceTexture:`](/documentation/ModelIO/MDLLightProbe/init(reflectiveTexture:irradianceTexture:))

Initializes a light probe with the specified cube map textures.

### Working with Textures

[`reflectiveTexture`](/documentation/ModelIO/MDLLightProbe/reflectiveTexture)

A cube map texture that contains a rendering of a scene as seen from the light probe’s position.

[`irradianceTexture`](/documentation/ModelIO/MDLLightProbe/irradianceTexture)

A cube map texture that contains samples of the total light arriving at the light probe’s position from every direction.

### Working with Spherical Harmonics

[`-  generateSphericalHarmonicsFromIrradiance:`](/documentation/ModelIO/MDLLightProbe/generateSphericalHarmonics(fromIrradiance:))

Generates spherical harmonics information based on the light probe’s irradiance texture.

[`sphericalHarmonicsCoefficients`](/documentation/ModelIO/MDLLightProbe/sphericalHarmonicsCoefficients)

Data containing the spherical harmonics coefficients for the light.

[`sphericalHarmonicsLevel`](/documentation/ModelIO/MDLLightProbe/sphericalHarmonicsLevel)

The number of levels of spherical harmonics information in the light probe.

### Generating Light Probes from Scene Contents

[`+  lightProbeWithTextureSize:forLocation:lightsToConsider:objectsToConsider:reflectiveCubemap:irradianceCubemap:`](/documentation/ModelIO/MDLLightProbe/init(textureSize:forLocation:lightsToConsider:objectsToConsider:reflectiveCubemap:irradianceCubemap:))

Creates a light probe representing the shading environment at a specific point in a scene.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`MDLNamed`](/documentation/ModelIO/MDLNamed)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

### Inherits From

[`MDLLight`](/documentation/ModelIO/MDLLight)

---

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)