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


@interface MDLLightProbe : MDLLight


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 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:

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 generateSphericalHarmonicsFromIrradiance: method, then access the generated data in the sphericalHarmonicsCoefficients property.


Creating a Light Probe

- initWithReflectiveTexture:irradianceTexture:

Initializes a light probe with the specified cube map textures.

Working with Textures


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


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:

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


Data containing the spherical harmonics coefficients for the light.


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

Generating Light Probes from Scene Contents

+ lightProbeWithTextureSize:forLocation:lightsToConsider:objectsToConsider:reflectiveCubemap:irradianceCubemap:

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


Inherits From

See Also



The abstract superclass for objects that describe light sources in a scene.


A light source that illuminates a 3D scene from an area with a specific shape.


Adopt this protocol to provide information for use in automatic placement of light probes around a scene.


A light source whose shape, direction, and intensity of illumination are determined by a photometric profile.


A light source for use in shading models based on real-world physics.