Light2DOptions
Defined in: packages/three-flatland/src/lights/Light2D.ts:12
Options for creating a Light2D.
Properties
Section titled “Properties”angle?
Section titled “angle?”
optionalangle?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:26
Cone angle for spot lights (radians, default: Math.PI/4)
castsShadow?
Section titled “castsShadow?”
optionalcastsShadow?:boolean
Defined in: packages/three-flatland/src/lights/Light2D.ts:32
Whether this light casts shadows (default: true)
category?
Section titled “category?”
optionalcategory?:string
Defined in: packages/three-flatland/src/lights/Light2D.ts:58
Group tag used by Forward+ to bucket castsShadow: false fill
lights into independent per-tile quotas with per-bucket luminance
compensation. Lights sharing a category compete for that
category’s 2-slot quota; different categories never evict each
other. Up to 4 distinct buckets (hashed from the string — 5th+
categories collide into earlier buckets, degrading gracefully).
Typical usage: "slime", "water", "fire" for cosmetic fills
with visually distinct identities. Hero lights (castsShadow: true) ignore this field entirely. When omitted, the light
shares bucket 0 with every other un-tagged fill.
color?
Section titled “color?”
optionalcolor?:ColorRepresentation
Defined in: packages/three-flatland/src/lights/Light2D.ts:16
Light color
decay?
Section titled “decay?”
optionaldecay?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:30
Decay exponent controlling attenuation curve shape (default: 2 for quadratic)
direction?
Section titled “direction?”
optionaldirection?: [number,number] |Vector2
Defined in: packages/three-flatland/src/lights/Light2D.ts:22
Direction for directional/spot lights (normalized automatically)
distance?
Section titled “distance?”
optionaldistance?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:24
Maximum light distance for point/spot lights (0 = no cutoff, default: 0)
importance?
Section titled “importance?”
optionalimportance?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:44
Multiplicative bias applied to this light’s tile-ranking score
during Forward+ tile assignment. Default 1.0 (neutral). Higher
values bias this light toward winning slot allocation when tiles
saturate. Typical use: set hero lights (torches, key lights) to
10 so they resist eviction by dense cosmetic clusters.
Score ordering only — never appears in the fragment shader’s illuminance math, so it doesn’t change how the light looks once it’s in a tile slot, only which lights claim the slots.
intensity?
Section titled “intensity?”
optionalintensity?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:18
Light intensity (default: 1)
penumbra?
Section titled “penumbra?”
optionalpenumbra?:number
Defined in: packages/three-flatland/src/lights/Light2D.ts:28
Penumbra for spot lights (0-1, default: 0)
position?
Section titled “position?”
optionalposition?: [number,number] |Vector2
Defined in: packages/three-flatland/src/lights/Light2D.ts:20
Position for point/spot lights
optionaltype?:Light2DType
Defined in: packages/three-flatland/src/lights/Light2D.ts:14
Light type