Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit95280a384c

README.md

SurfaceLight

An area light that emits from a face of its entity.

local id = entity.spawn("tv").id
entity(id).component.add("SurfaceLight", {
    width = 2.0,
    height = 1.2,
    face = "front",
    intensity = 6.0,
})

A screen, a window, a ceiling panel, a neon strip — anything whose light comes off a surface rather than out of a point.

The difference is the highlight. A point light standing in for a television puts a pinpoint reflection on the floor, because a point is what it is. An area light puts the shape of the screen there, and the shading falls off across a wall instead of radiating from a dot. A narrow strip gives a narrow elongated highlight; a wide panel gives a broad one.

face picks which way the entity emits — front / back / up / down / left / right. The rectangle turns with the entity's rotation, so a tilted screen lights the direction it actually points.

Every field is live. An intensity of 0 removes the light without losing the rest of the settings.

For code placing emitters directly, reach for @builtin::systems.areaLights.surfaceLight.

The full description is in the package readme: guides { path = "systems/areaLights" }.