DirectionLight

Classes

DirectionLight : 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.direction_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 DirectionLight(
    color = float3(1),
    intensity = 0.5f,
    castShadows = false
))
Properties:

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

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

Arguments:
  • value : float3

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

Intencity of the light source. Default is 1f

Arguments:
  • value : float

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

Enable or disable shadow casting. Default is true

Arguments:
  • value : bool