API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfacePointLightOptions

@codexo/exojs-lighting / lighting / stable

Construction options for PointLight. Every field is also mutable afterwards.

7
props
0
methods
0
events
Import
import { PointLightOptions } from '@codexo/exojs-lighting'

Construction options for PointLight. Every field is also mutable afterwards.

Properties7
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?: boolean
Whether the light contributes at all. Defaults to true.
height?: number
Height above the sprite plane, in pixels. Drives how grazing the light direction is: small values rake across the surface and exaggerate a normal map, large values flatten it out. Defaults to 64.
intensity?: number
Linear brightness multiplier. Defaults to 1.
radius?: number
Distance in pixels at which the light contributes nothing. Defaults to 256.
softness?: number
How 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