LightSystem

LittleJS Light System Plugin

  • Adds 2D dynamic lighting to the scene
  • Lights are first-class EngineObjects (the Light class)
  • Each Light draws a soft falloff blob of its color into a shared lightmap
  • Lights accumulate ADDITIVELY in the lightmap (red + blue = magenta)
  • The lightmap is then MULTIPLIED with the scene during composite, so unlit areas go to the ambient color and lit areas show the scene tinted by the accumulated light color
  • Draw the world at full brightness — the lightmap does the darkening
  • Any EngineObject may override renderLight() to additively contribute to the lightmap (e.g. emissive lava tiles, weapon flashes, glowing crystals)
  • Must be constructed BEFORE PostProcessPlugin so post-process sees lit pixels

Classes

Light
LightSystemPlugin

Members

(static) lightSystem :LightSystemPlugin

Global Light System plugin object

Type:
  • LightSystemPlugin