A component that defines a point light source.
The strength of a point light depends on a combination of its
``intensity`` and ``attenuationRadius``.
The default values for these properties make this light
comparable to high-power streetlights, or outdoor floodlights.
This table shows a few examples of common scenarios similar to a point light source:
| Scenario | Approximate lumens | Attenuation radius | Description |
|-|-|-|-|
| Candle flame | 10-15 lumens | ~1 meter | Very small light source |
| Nightlight | 20-30 lumens | 1-2 meters | Low-level lighting |
| 25W lightbulb | 200-300 lumens | 2-3 meters | Small room lighting |
| 40W lightbulb | 400-500 lumens | 3-4 meters | Moderate room lighting |
| 60W lightbulb | 700-800 lumens | 4-5 meters | General-purpose lighting |
| 100W lightbulb | 1,500-1,700 lumens | 5-6 meters | Bright room lighting |
| LED flashlight | 300-600 lumens | 50-70 meters | Long distance illumination |
| Car headlights (each, low-beam) | 700-1,200 lumens | 100-150 meters | Illuminates the road ahead |
| LED streetlight | 8,000-10,000 lumens | 20-30 meters | Illuminates large outdoor areas |
| Stadium lighting | ~100,000 lumens | 100-200 meters | Lights-up large outdoor areas |
Use this component by applying it to an entity's ``Entity/components`` set.
In this example, the light's color is red:
```swift
let lightEntity = Entity()
let redLightComponent = PointLightComponent(color: .red)
lightEntity.components.set(redLightComponent)
```
The point light illuminates entities based on its distance from them.
Here is a visual example of how a red `PointLightComponent` illuminates elements based on distance:
|  |  | 
|-|-|-|
- Note: The green dot in the above illustrations is only a visual representation of the light's position.
## Dynamic light capacity
On older hardware, only a limited number of dynamic lights can affect each object.
Devices that support `MTLGPUFamily.apple6` or later lift this limit.
Excessive use of dynamic lights may contribute to user-noticeable frame drops and
can cause the device to heat up in graphically demanding situations. Both the number
of lights and each light's coverage affect performance, so use properties like
``attenuationRadius`` to keep a light's influence no larger than your scene needs.
Monitor the thermal state and reduce usage as a mitigation, if necessary.
Because this behavior varies by device, verify your scene's lighting on the oldest
hardware you support. You can check for this support at runtime with
`MTLDevice.supportsFamily(.apple6)`.
Members (9)
get · iOS 13.0+
attenuationRadius
TypeScript
get attenuationRadius(): number
Swift declaration
var attenuationRadius: Float
The distance from the light source where its intensity reaches zero.
Any objects at or beyond this distance do not receive illumination.
The default value is `10.0` meters.
See ``PointLightComponent`` for more information about how the
``intensity`` and `attenuationRadius` properties affect this light.
set · iOS 13.0+
attenuationRadius
TypeScript
set attenuationRadius(value: number)
Swift declaration
var attenuationRadius: Float
The distance from the light source where its intensity reaches zero.
Any objects at or beyond this distance do not receive illumination.
The default value is `10.0` meters.
See ``PointLightComponent`` for more information about how the
``intensity`` and `attenuationRadius` properties affect this light.
get · iOS 18.0+
attenuationFalloffExponent
TypeScript
get attenuationFalloffExponent(): number
Swift declaration
var attenuationFalloffExponent: Float { get set }
The exponent value for the light's intensity falloff-transition curve.
set · iOS 18.0+
attenuationFalloffExponent
TypeScript
set attenuationFalloffExponent(value: number)
Swift declaration
var attenuationFalloffExponent: Float { get set }
The exponent value for the light's intensity falloff-transition curve.
get · iOS 27.0+
layers
TypeScript
get layers(): RenderLayer_Set
Swift declaration
var layers: RenderLayer.Set { get set }
The layers this light illuminates.
A point light illuminates an entity when the layers of the entity's
``RenderLayerComponent`` intersect with this set. Entities without a
``RenderLayerComponent`` belong to ``RenderLayer/defaultLayer``, which is
the only member of `layers` by default.
For an example of layer-based light linking, see
``DirectionalLightComponent/layers``.
Lights can be restricted by layer on devices with Apple6 GPU family feature support.
set · iOS 27.0+
layers
TypeScript
set layers(value: RenderLayer_Set)
Swift declaration
var layers: RenderLayer.Set { get set }
The layers this light illuminates.
A point light illuminates an entity when the layers of the entity's
``RenderLayerComponent`` intersect with this set. Entities without a
``RenderLayerComponent`` belong to ``RenderLayer/defaultLayer``, which is
the only member of `layers` by default.
For an example of layer-based light linking, see
``DirectionalLightComponent/layers``.
Lights can be restricted by layer on devices with Apple6 GPU family feature support.
Creates a new instance with the specified color, intensity and attenuation.
- Parameters:
- cgColor: The color of the light.
- intensity: The light's brightness.
- attenuationRadius: The distance from the light source where its intensity reaches zero.
Any objects at or beyond this distance do not receive illumination.
get · iOS 13.0+
intensity
TypeScript
get intensity(): number
Swift declaration
var intensity: Float
The intensity of the point light, measured in lumen.
The default value is `26963.76` lumens.
See ``PointLightComponent`` for more information about how the
`intensity` and ``attenuationRadius`` properties affect this light.
set · iOS 13.0+
intensity
TypeScript
set intensity(value: number)
Swift declaration
var intensity: Float
The intensity of the point light, measured in lumen.
The default value is `26963.76` lumens.
See ``PointLightComponent`` for more information about how the
`intensity` and ``attenuationRadius`` properties affect this light.