Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07158574-5…

AreaLight

A rectangular light source on an entity. The rect is centred on the entity's world position, faces along the entity's world rotation applied to `face` (default "Front", the entity-local -Z that `transform.forward` reports and that `entity:lookAt` aims), and spans `width` by `heig…

by◐lumi·posted 2mo ago
What it does

AreaLight

A rectangular light source on an entity. The rect is centred on the entity's world position, faces along the entity's world rotation applied to face (default "Front", the entity-local -Z that transform.forward reports and that entity:lookAt aims), and spans width by height. A rect under a carrier moves and turns with it. Its light arrives from a surface rather than a point, so shading falls off gradually across a wall, highlights stretch to the shape of the source, and shadows carry a penumbra that widens with the rect's size and the caster's distance.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

AreaLight Component Adds a rectangular light source to an entity. The rect's centre is the entity's world position and its facing normal is the entity's world rotation applied to the `face` direction (defaults to "Front", the entity-local -Z that `transform.forward` reads and that `entity:lookAt` aims); the rect spans `width` by `height` in the plane perpendicular to that normal, and a rect under a carrier moves and turns with it. A rect lights differently from a point or a spot. Its light arrives from a surface rather than a single spot, so shading falls off gradually across a wall instead of radiating from a dot, highlights stretch to the shape of the source, and shadows carry a penumbra that widens with the rect's size and with how far the caster stands from what it shadows. Config is the native Light ECS component with `lightType = "Area"` — area, point, and spot lights share one GPU buffer, so the per-scene cap is their combined count. Usage: entity.find("ceilingPanel").component.add("AreaLight", { color = {1, 0.95, 0.85}, brightness = 6, width = 6, height = 8, range = 30, -- how far the light reaches face = "Bottom", -- the rect points down at the room shadows = true, })

isBakedState( ) → void

contributionWithheld( ) → void

A baked static light contributes nothing live: the baked artifacts already carry all of it, so realtime light would double it and its shadow map would re-render every frame for nothing. A mixed light keeps its direct light and shadows — only its bounce is baked.

areaValue( ) → void

Build the typed ecs.Light value for this rect. A withheld light keeps its row and zeroes what the row carries, so the scene still reads as having a light here.

componentIsLive( ) → boolean

Bring the live row to match the component. Idempotent, so re-entrant property notifications can't double-insert. Whether this component is running: its own switch is on, and the entity carrying it is active in the hierarchy. A component that is not running holds no row — `onDisable` and the active cascade each take it out — so a write that lands while it is off changes the authored value and nothing else, and `onEnable` builds the row back from whatever the fields hold by then. Read guarded: an entity mid-teardown answers nothing.

refreshRow( ) → void

applyAuthored( ) → void

Apply an authored change, un-baking first. Public setters route through this so editing a baked light restores its live contribution.

awake( ) → void

onEnable( ) → void

onDisable( ) → void

onPropertyChanged(key: ?, value: ?, oldValue: ?) → void

argtypedescription
key?
value?
oldValue?

onDestroy( ) → void

resolveMobility( ) → string

Resolve this light's mobility to `"static"`, `"mixed"` or `"dynamic"` — how GI baking treats it. An explicit `mobility` field wins; `"auto"` resolves to `"dynamic"` for a light something carries (non-world participation, an animated or physics-driven entity) and `"mixed"` for the rest. `"static"` bakes the light whole — direct light and bounce — and withholds its live contribution, so it costs nothing per frame and lights nothing that was not there at bake time. `"mixed"` bakes only its bounce and keeps its direct light and shadows live, so it still lights and shadows anything that moves. This is what `"auto"` picks, because a light that stands still still shines on characters walking under it. `"dynamic"` keeps the light out of the bake entirely.

examples

local mob = panel:resolveMobility()

lightMobility( ) → string

How GI baking should treat this light, resolved to `"static"`, `"mixed"` or `"dynamic"`. Every component that puts a light in the scene answers this, which is how a bake finds the lights it has to account for without knowing what component authored them.

examples

if light:lightMobility() == "dynamic" then ... end

setColor(color: table) → void

Set the light color. Values >1 are auto-scaled from 0..255.

argtypedescription
colortable`{r, g, b}` array or `{r=, g=, b=}` map.

examples

panel:setColor({1, 0.95, 0.85})

setBrightness(b: number) → void

Set the brightness multiplier.

argtypedescription
bnumberBrightness scalar.

examples

panel:setBrightness(6)

setSize(w: number, h: number) → void

Set the rect's size in world units.

argtypedescription
wnumberWidth across the face.
hnumberHeight across the face.

examples

panel:setSize(6, 8)

setRange(r: number) → void

Set how far the light reaches.

argtypedescription
rnumberRange in world units.

examples

panel:setRange(30)

setFace(face: string) → void

Set the entity-local face the rect points along. One of Front, Back, Left, Right, Top, Bottom — the world-space normal is `transform.rotation * face`, and "Front" is the entity's own forward, so a rect left on it follows wherever the entity is aimed.

argtypedescription
facestringFace name string.

examples

panel:setFace("Bottom")

setTwoSided(both: boolean) → void

Emit from both faces of the rect rather than only the one its normal points along.

argtypedescription
bothbooleanWhether the rect is two-sided.

examples

panel:setTwoSided(true)

setShadows(cast: boolean) → void

Enable or disable shadow casting. A shadow-casting rect consumes one layer of the engine's shared shadow array; past the cap it lights but stops casting.

argtypedescription
castbooleanWhether the rect should cast shadows.

examples

panel:setShadows(true)

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

2items
This part has no composite children. See the Files segment for its leaf payloads.
backing path · components/AreaLight.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.