API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceLightOptions
@codexo/exojs-lighting / lighting / stable
Options every light shares. Each field is also mutable afterwards.
5
props
0
methods
0
events
Import
import { LightOptions } from '@codexo/exojs-lighting'Options every light shares. Each field is also mutable afterwards.
Properties5
Light colour. Alpha is ignored. Defaults to opaque white.
Texture the light is shone through, sampled across its own bounding square - a window cross, leaf shade, a stained-glass pattern. Multiplied into the light, so a transparent part of the cookie casts nothing and an opaque white one changes nothing. The square maps onto the texture's full 0..1, turns with the light and scales with its radius, so the pattern stays fixed to the lamp rather than to the world. Wrapping is the texture's own business; a cookie meant to end at its edge wants ClampToEdge. Read by the lightmap renderer. forward shades inside the sprite stage, where a texture per light cannot be reached in one draw, and ignores it. Lights sharing a cookie share a draw, so a scene with three distinct cookies costs three draws rather than one - still one draw per texture, never one per light.
enabled?: booleanWhether the light contributes at all. Defaults to true.
intensity?: numberLinear brightness multiplier. Defaults to 1.
softness?: numberHow soft the shadows this light casts are, in 0..1. 0 is the hardest edge the renderer can draw and 1 the widest. Defaults to 0.25. It means a different quantity in each renderer, and the difference is visible in a scene with depth: - lightmap reads it as FILTER WIDTH. The light stays a point, and the shadow term is averaged over a band of its angular shadow row, at most three percent of a full turn. The edge widens with distance from the LIGHT rather than from the wall, and it does not behave like a shadow cast by a source of that size. - radiance reads it as SOURCE SIZE. The emitter is given a width, and the penumbra follows from the geometry: it grows with the distance between the wall and what the shadow falls on. Neither adds a pass, so it is free of extra draws and can differ per light. Under lightmap the filter samples every bin under its kernel and spends between 7 and 23 texture fetches per shadowed fragment doing it, which also bounds the kernel at ten bins either side - see LightingOptions.shadowResolution.
Source