DirectionalLight

Type aliases

DirectionLight = DirectionalLight

Deprecated alias for DirectionalLight. Kept for backward compatibility — prefer DirectionalLight in new code.

Classes

DirectionalLight : NativeComponent

This component adds directional light to the node. It enables shadow casting and shading scene with given color. Supported shadow casting and shading only for one directional light, Another lights will be ignored.

To add this module to your project, add the following line to your project file:

require engine.core_components.directional_light_component // or require engine.core

Usage example:

var node = create_node(NodeData())
// directional light with color (1f, 1f, 1f), intencity 0.5f and no shadow casting
add_component(node, new DirectionalLight(
    color = float3(1),
    intensity = 0.5f,
    castShadows = false
))
Properties:

DirectionalLight.color: float3
DirectionalLight.color =(value: float3)

Color of the light source. Default is (1f, 0.96f, 0.92)

Arguments:
  • value : float3

DirectionalLight.intensity: float
DirectionalLight.intensity =(value: float)

Intencity of the light source. Default is 1f

Arguments:
  • value : float

DirectionalLight.castShadows: bool
DirectionalLight.castShadows =(value: bool)

Enable or disable shadow casting. Default is true

Arguments:
  • value : bool