light
Since 0.6Changed in next
Use it in a scene entity's components list as { "type": "light", … }. The contract writes the fields flat and refuses unknown keys.
Fields
| Field | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|
kind | LightKind | yes | directional, point, spot | ||
color | string | yes | |||
intensity | number | yes | |||
castShadow | boolean | no | |||
range | number | no | |||
angle | number | no | |||
shadowTint | LightShadowTint | no | Directional lights only (light-shadow-tint-ignored on any other kind). Lifts the sun's shadows: a shadowed surface receives strength of the sun's light in color, scaled by the surface's albedo and its angle to the sun, on top of the sky light, so shadows on a dark surface stop going black. Absent changes nothing (the image is byte-identical). Standard renderer's lit materials only (pbr, toon, vertex); the HD renderer, custom shaders and unlit materials ignore it. strength outside 0..1 or a color that is not a hex colour is light-shadow-tint-range. | ||
indirectIntensity | number | no | Multiplier on this light's contribution to the indirect (bounced) light, 0..16; absent means no change. Zero keeps the light's direct light and removes its bounce; two doubles the bounce. HD's ray-traced GI only: the standard renderer ignores it (hd-only-ignored). Changing it while the scene runs re-lights the GI within a few frames, with no restart. |
Rules that can refuse it
component-not-writablegi-intensity-rangehd-only-ignoredlight-directional-horizontallight-shadow-tint-ignoredlight-shadow-tint-rangerender.hd.black_framerender.hd.horizon_map_unavailableshader-model-mismatch
Example
From the contract's tested fixture fixtures/contract/full20/scene.json#lamps.
{
"type": "light",
"kind": "point",
"color": "#FFD9A0",
"intensity": 12,
"range": 9
}