add_light
Create or update a single scene light with position, power, color, and shadow settings; updating a name modifies that existing light instead of adding another.
Instructions
Create or update one light you control (setup_lighting makes a whole preset instead). The same name updates
that light; it never makes a copy. spot is a cone, point shines all ways, area is a panel, sun gives parallel rays.
location is in world metres; look_at is the point a spot, area or sun aims at. A new light without them sits
at [0, 0, 3] and points down; an update keeps what you omit.
power_w is watts; for a sun it is W/m2 (1-5, about 3 is a normal day). A point or spot needs about 40 W at
1 m, 150 W at 2 m, 600 W at 4 m for a normal exposure; an area panel a third of that.
color is '#rrggbb' or linear [r, g, b]; temperature_k (800-20000) multiplies it with a blackbody tint.
Spot: spot_size_deg is the full cone angle (1-180), blend (0-1) softens its edge. cutoff_m stops a spot or
point hard at that distance.
radius (spot, point) is the source size in metres: bigger means softer shadows. size (area) is [width, height]
in metres or one number for a square (1 m when empty). shadow_soft=false makes hard shadows.
Names that start with bl_light_ belong to setup_lighting and are refused. Remove lights with delete.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | spot | |
| name | No | light | |
| size | No | ||
| blend | No | ||
| color | No | #ffffff | |
| radius | No | ||
| look_at | No | ||
| power_w | No | ||
| cutoff_m | No | ||
| location | No | ||
| shadow_soft | No | ||
| spot_size_deg | No | ||
| temperature_k | No |