Skip to main content

Light

The Light component attaches a dynamic light source to the Entity. The 'Type' property determines what kind of light is attached and what other properties are available.

The Light component can be enabled or disabled using the toggle in the top right of the component panel. If enabled, the light will light the scene.

Directional

Light component (Directional)

Omni

Light component (Omni)

Spot

Light component (Spot)

Properties

PropertyDescription
TypeCan be:
  • Directional: a light casting in a uniform direction
  • Omni: a light casting in all directional around an omni
  • Spot: a light casting from the apex of a cone
ColorThe color of the emitted light.
IntensityThe intensity of the light, this acts as a scalar value for the light's color. This value can exceed 1.
RangeOmni and Spot only. The distance from the spotlight source at which its contribution falls to zero.
Falloff ModeOmni and spot only. Controls the rate at which a light attenuates from its position.
Cone AngleSpot only. The inner and outer cone angles, measured from the spotlight's direction, at which light falls from its maximum to zero.
Bake LightmapEnable lightmap baking from this light.
AffectDetermines which types of objects are lit by this light. Can be any combination of dynamically lit or lightmapped objects.
Cast ShadowsIf checked, the light will cause shadow casting models to cast shadows.
Shadow Update ModeDetermines when the shadowmap for this light is updated. Can be:
  • Once: generated once and never again. Useful if casters, receivers and light are static.
  • Realtime: updated every frame.
ResolutionThe resolution of the shadowmap generated by this light source. This property is only used when Cast Shadows is checked. A high value will result in a more accurate shadow but will be at the cost of performance.
DistanceDirectional lights only. The shadow distance is the maximum distance from the camera beyond which shadows that come from Directional Lights are no longer visible. Smaller values produce more detailed shadows. The closer the limit the less shadow data has to be mapped to, and represented by, any shadow map; shadow map pixels are mapped spatially and so the less distance the shadow map has to cover, the smaller the pixels and so the more resolution any shadow has.
Shadow TypeThe shadow mapping algorithm to use. The selection will affect the appearance and performance of the shadows. Can be:
  • Shadow Map: PCF (Percentage Closer Filtering) shadowmaps.
  • Variance Shadow Map (8bit): Low precision shadowmaps. VSM is generally softer than PCF shadows.
  • Variance Shadow Map (16bit): Medium precision shadowmaps. Uses twice as much VRAM as 8 bit VSM.
  • Variance Shadow Map (32bit): High precision shadowmaps. Uses twice as much VRAM as 16 bit VSM.
Shadow BiasBias values enable the tuning of shadows in order to eliminate rendering artifacts, namely 'shadow acne' and 'peter-panning'. The two values are a shadow bias and a normal offset bias.
CookieOmni and spot only. A texture asset to be projected from the light.
Cookie IntensityOmni and spot only. Defines the strength of the cookie texture.
Cookie FalloffSpot only. Disable the spotlight falloff.

Scripting Interface

You can control a Light component's properties using a script component. The Light component's scripting interface is here.