Skip to content

Light2DOptions

Defined in: packages/three-flatland/src/lights/Light2D.ts:12

Options for creating a Light2D.

optional angle?: number

Defined in: packages/three-flatland/src/lights/Light2D.ts:26

Cone angle for spot lights (radians, default: Math.PI/4)


optional castsShadow?: boolean

Defined in: packages/three-flatland/src/lights/Light2D.ts:32

Whether this light casts shadows (default: true)


optional category?: 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.


optional color?: ColorRepresentation 

Defined in: packages/three-flatland/src/lights/Light2D.ts:16

Light color


optional decay?: number

Defined in: packages/three-flatland/src/lights/Light2D.ts:30

Decay exponent controlling attenuation curve shape (default: 2 for quadratic)


optional direction?: [number, number] | Vector2 

Defined in: packages/three-flatland/src/lights/Light2D.ts:22

Direction for directional/spot lights (normalized automatically)


optional distance?: number

Defined in: packages/three-flatland/src/lights/Light2D.ts:24

Maximum light distance for point/spot lights (0 = no cutoff, default: 0)


optional importance?: 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.


optional intensity?: number

Defined in: packages/three-flatland/src/lights/Light2D.ts:18

Light intensity (default: 1)


optional penumbra?: number

Defined in: packages/three-flatland/src/lights/Light2D.ts:28

Penumbra for spot lights (0-1, default: 0)


optional position?: [number, number] | Vector2 

Defined in: packages/three-flatland/src/lights/Light2D.ts:20

Position for point/spot lights


optional type?: Light2DType

Defined in: packages/three-flatland/src/lights/Light2D.ts:14

Light type