DirectionalLight

A light with a direction but no position: every surface receives it from the same angle at the same strength, which is how sunlight and moonlight behave at world scale.

Properties

SizeOf

(uint): Gets the size of the light in bytes.

Public Methods

SetDirection

public void SetDirection(Vector3 value)

Sets the direction the light travels, normalized. This is the node's forward axis, so a sun overhead points down.

Parameters:

  • value (Vector3): The direction light travels in world space.

SetColor

public void SetColor(Vector4 col, float intensity)

Sets the light color and intensity. Intensity zero disables the slot.

Parameters:

  • col (Vector4): The light color.
  • intensity (float): The light intensity.

Clear

public void Clear()

Turns the light off, so the shader skips its slot.

GetAsBytes

public readonly byte[] GetAsBytes()

Converts the light to its std140 byte layout.

Returns: byte[]

  • A 32-byte array holding the direction and color.

ToString

public override readonly string ToString()

Returns: string