Skip to content

Components

Light

A light. Anything it reaches is lit and anything an Occluder blocks is left in shadow. It can be a point, a cone, a directional wash, a sprite or a freeform shape.

On this page

Add it

+ Add node → Light, Light Shader creates a node with it already on. Already have a node for it? Add component → LightComponent.

From a script

A script on the same node writes these fields by name. LightComponent is the name to pass.

rgs
set_flag("LightComponent", "enabled", true);
set_number("LightComponent", "radius", 240.0);
set_number("LightComponent", "intensity", 1.0);
set_colour("LightComponent", "color", vec4(1.0, 0.86, 0.66, 1.0));
set_point("LightComponent", "direction", vec2(0.0, 1.0));
set_number("LightComponent", "angle", 1.2);
set_number("LightComponent", "softness", 0.0);
set_point("LightComponent", "size", vec2(480.0, 480.0));
set_number("LightComponent", "falloff", 32.0);

Fields

FieldScript nameKindDefaultWhat it does
EnabledenabledcheckboxonWhether the light contributes.
Kindkindone of Point, Cone, Directional, Sprite, FreeformPointWhat shape it throws.
Radiusradiusnumber, at least 0240How far the light reaches, in world units. A Directional, Sprite or Freeform light uses it only for how far its shadows reach.
Intensityintensitynumber, 0 to 8, step 0.051Brightness at the centre.
Colorcolorcolour#ffdba8The light's own colour.
Directiondirectiontwo numbers (x, y)(0, 1)Which way a Cone points, or a Directional light shines. Ignored by every other kind.
Angleanglenumber, 0 to 7, step 0.051.2A Cone's full width, in radians. Its edge fades over the outer fifth of each side. Ignored by every other kind.
Sort Layerlayernumber0The order lights are drawn in. Lights on one channel add up, so the order changes nothing there, except on a Replace channel: where lights overlap, the last one drawn sets how much of the scene is replaced.
Channelchannelnumber, 0 to 300 is the room's own lighting; every other channel costs more to draw.
Softnesssoftnessnumber, at least 00Width of the source; zero is a hard shadow.
Sprite
TexturetextureassetnoneThe falloff this light's shape comes from.
Sizesizetwo numbers (x, y)(480, 480)What a Sprite light lights, centred on the node.
Freeform
OutlinepointslistemptyA Freeform light's outline, in the node's local units.
Fallofffalloffnumber, at least 032Inset of the falloff band; zero is a hard-edged cut-out.