MDLPhotometricLight
A light source whose shape, direction, and intensity of illumination are determined by a photometric profile.
Declaration
class MDLPhotometricLightOverview
You create a photometric light from a file in the IES format, containing physical measurements of a light source. Many manufacturers of real-world light fixtures publish such files describing the lighting characteristics of their products. This photometry data measures the light web surrounding a light source—measurements of the light’s intensity in all directions around the source.The MDLPhotometricLight provides two ways to interpret a light web:
As a cube map texture. Use the generateCubemap(fromLight:) method to generate a texture, then use the lightCubeMap property to access the texture. 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.
As spherical harmonics. Use the generateSphericalHarmonics(fromLight:) method to generate a set of spherical harmonic coefficients, and then use the sphericalHarmonicsLevel and sphericalHarmonicsCoefficients properties to access these coefficients. Spherical harmonic coefficients provide a more compact representation of the same information as the cube map texture, so you can use them during shading without the performance cost of a texture lookup.
Both the MDLPhotometricLight and MDLAreaLight classes can describe lights with interesting shapes—an area light offers a simpler design that can be implemented with better rendering performance, and a photometric light offers design that better models real-world light fixtures at the cost of higher computational complexity.