Components are basic building blocks that use data and logic to build your game. Use the light component to light a room or a dark part of your environment.
You can use this component alone to add light to a dark space or pair it with other components to make a more dynamic entity.
To add a component to your entity, check out Working with Entities and Components. For more information on how to use lighting in your projects, check out the Lighting section.
Light Component Superclass
Each type of light component derives from the abstract light_component superclass. This class defines parameters and behaviors common to each light component.
All light components share the following common parameters:
CastShadows
This option determines whether a light should cast any shadows.
ColorFilter
This option sets the filter color of the light and acts as a colored filter in front of the light source.
SpecularScale
This option determines the radius of the source capsule shape, in meters.
DiffuseScale
This option determines the length of the source capsule shape, in meters.
Capsule Light Component
The Capsule Light Component adds a
Capsule lights emit light in all directions from a capsule-shaped source with a specified length and radius. Setting the length and radius to 0 makes this light act identically to a point light. Capsule lights are best used when you want to simulate a shaped light that emits in all directions, such as a lightbulb or neon light bar.
| Option | Value | Description |
|---|---|---|
Intensity | 5.0, select a value. | Sets the visible light intensity emitted in SI unit Candela. Specified before ColorFilter (which multiplies each color component after the intensity calculation and can change the effective intensity of the light). |
AttenuationRadius | 10.0, select a value. | The bounds of the light's visible influence, in meters. Objects outside the AttenuationRadius are not affected by this light. The light falloff is based on the Inverse Square law. Towards the tail end of the AttenuationRadius, there is an additional smoothing factor to fade out the light contribution to |
SourceRadius | 0.1, select a value. | The radius of the source capsule shape, in meters. |
SourceLength | 0.5, select a value. | The length of the source capsule shape, in meters. |
Directional Light Component
The Directional Light simulates light that is being emitted from a source that is infinitely far away. This means that all shadows cast by this light will be parallel, making this the ideal choice for simulating sunlight.
| Option | Value | Description |
|---|---|---|
Illuminance | 10.0, select a value. | The intensity of the light hitting the surface, in lux. |
SourceAngleDegrees | 0.5357, select a value. | The angle subtended by the light source in degrees. Defaults to |
Rect Light Component
The Rect Light emits light into the scene from a rectangular plane with a defined width and height. Use the rect light component to light a large area evenly and generate diffuse shadows based on the area it covers. This component can complement other lighting components by acting as fill lighting.
| Option | Value | Description |
|---|---|---|
Intensity | 5.0, select a value. | Sets the visible light intensity emitted in SI unit Candela. Specified before ColorFilter (which multiplies each color component after the intensity calculation and can change the effective intensity of the light). |
AttenuationRadius | 10.0, select a value. | The bounds of the light's visible influence, in meters. Objects outside the AttenuationRadius are not affected by this light. The light falloff is based on the Inverse Square law. Towards the tail end of the AttenuationRadius, there is an additional smoothing factor to fade out the light contribution to 0 to avoid a hard cutoff. |
SourceWidth | 0.64, select a value. | The width of the light source rectangle, in meters. |
SourceHeight | 0.64, select a value. | The height of the light source rectangle, in meters. |
BarnDoorAngleDegrees | 88.0, select a value. | Barn doors are light modifiers that shape and direct light. This setting determines the angle of the barn doors in degrees attached to the light source rectangle. This value is clamped between |
BarnDoorLength | 0.2, select a value. | The length of the barn door attached to the light source rectangle, in meters. |
Sphere Light Component
Similar to the rect light, the Sphere Light emits light into the scene from a spherical plane with a defined source radius and attenuation radius. This component can complement other lighting components by acting as fill lighting.
| Option | Value | Description |
|---|---|---|
Intensity | 5.0, select a value. | Sets the visible light intensity emitted in SI unit Candela. Specified before ColorFilter (which multiplies each color component after the intensity calculation and can change the effective intensity of the light). |
AttenuationRadius | 10.0, select a value. | The bounds of the light's visible influence, in meters. Objects outside the AttenuationRadius are not affected by this light. The light falloff is based on the Inverse Square law. Towards the tail end of the AttenuationRadius, there is an additional smoothing factor to fade out the light contribution to |
SourceRadius | 0.1, select a value. | The radius of the source sphere shape, in meters. |
Spot Light
A Spot Light emits light from a single point in a cone shape. Users are given two cones to shape the light - the Inner Cone Angle and Outer Cone Angle. Within the Inner Cone Angle, the light achieves full brightness. As you go from the extent of the inner radius to the extents of the Outer Cone Angle, a falloff takes place, creating a penumbra, or softening around the Spot Light's disc of illumination. The Radius of the light defines the length of the cones. More simply, this will work like a flash light or stage can light.
| Option | Value | Description |
|---|---|---|
Intensity | 5.0, select a value. | Sets the visible light intensity emitted in SI unit Candela. Specified before ColorFilter (which multiplies each color component after the intensity calculation and can change the effective intensity of the light). |
AttenuationRadius | 10.0, select a value. | The bounds of the light's visible influence, in meters. Objects outside the AttenuationRadius are not affected by this light. The light falloff is based on the Inverse Square law. Towards the tail end of the AttenuationRadius, there is an additional smoothing factor to fade out the light contribution to |
SourceRadius | 0.1, select a value. | The radius of the source sphere shape, in meters. |
InnerConeAngleDegrees | 0.0, select a value. | The light’s inner cone-shaped angle in degrees. This value is clamped between |
OuterConeAngleDegrees. | 44.0, select a value. | The light’s outer cone-shaped angle in degrees. This value is clamped between |