Component reference
Lighting components

Directional Light component

5min

Description

The Directional Light component simulates light from a distant source, such as the sun. It casts parallel light rays across the entire scene, affecting all objects uniformly in a specific direction.

Document image


ℹ️ Component loaded by default in your scene

The Directional Light component is automatically included in an entity in your Hierarchy. It simulates sunlight and ensures consistent directional lighting across your scene. It requires no manual addition unless further adjustments are desired.



Properties

Property

Description

Color

Sets the color of the light emitted.

Intensity

Adjusts the brightness of the light.

Cast shadows

Enables or disables shadow casting from this light.

Shadow bias

Adjusts the shadow's position to reduce visual glitches caused by shadow rendering.

Camera near

Sets the minimum distance from the camera at which shadows are rendered.

Usage notes

  • Orientation matters: Rotate the light to change the direction from which it shines, affecting how shadows are cast.
  • Shadow casting: As the primary light capable of casting shadows, use Cast shadows to enable this effect.
  • Shadow adjustments: Use Shadow bias to correct shadow rendering issues, such as shadow acne or peter panning.

Important details

  • Global light: Affects all objects in the scene regardless of position.
  • Shadows limitation: As of v1.0 of the engine, only the Directional Light can cast shadows in the system.
  • Performance: Shadow casting can impact performance; use shadows judiciously.