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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Enabled | enabled | checkbox | on | Whether the light contributes. |
| Kind | kind | one of Point, Cone, Directional, Sprite, Freeform | Point | What shape it throws. |
| Radius | radius | number, at least 0 | 240 | How far the light reaches, in world units. A Directional, Sprite or Freeform light uses it only for how far its shadows reach. |
| Intensity | intensity | number, 0 to 8, step 0.05 | 1 | Brightness at the centre. |
| Color | color | colour | #ffdba8 | The light's own colour. |
| Direction | direction | two numbers (x, y) | (0, 1) | Which way a Cone points, or a Directional light shines. Ignored by every other kind. |
| Angle | angle | number, 0 to 7, step 0.05 | 1.2 | A Cone's full width, in radians. Its edge fades over the outer fifth of each side. Ignored by every other kind. |
| Sort Layer | layer | number | 0 | The 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. |
| Channel | channel | number, 0 to 3 | 0 | 0 is the room's own lighting; every other channel costs more to draw. |
| Softness | softness | number, at least 0 | 0 | Width of the source; zero is a hard shadow. |
| Sprite | ||||
| Texture | texture | asset | none | The falloff this light's shape comes from. |
| Size | size | two numbers (x, y) | (480, 480) | What a Sprite light lights, centred on the node. |
| Freeform | ||||
| Outline | points | list | empty | A Freeform light's outline, in the node's local units. |
| Falloff | falloff | number, at least 0 | 32 | Inset of the falloff band; zero is a hard-edged cut-out. |