Skip to main content

Lighting System

Glitter supports directional, point, spot, and (planned) area lights with physically-based units. The engine ships with a database of 21 real-world light source profiles ranging from candle flames to cinema fixtures.

Data source

All light source profiles are sourced from the Physically Based open database by Anton Palmqvist.


Scene node format

A light is added to a scene as a node with "type": "light":

{
"name": "sun",
"type": "light",
"light": { ... },
"transform": { "translate": [0.0, 4.0, 0.0] }
}

Light types

Directional light

Infinite-distance light (e.g. sun). No position — only direction matters. Uses cascaded shadow maps (4-cascade CSM).

"light": {
"type": "directional",
"direction": [-0.4, -1.0, -0.6],
"color": [1.0, 0.88, 0.70],
"intensity": 400.0,
"unit": "lx",
"temperature": 5778.0,
"castShadow": true
}

Point light

Omnidirectional light that falls off with distance. Uses cubemap shadows.

"light": {
"type": "point",
"color": [1.0, 0.6, 0.2],
"intensity": 800.0,
"unit": "lm",
"temperature": 2700.0,
"radius": 5.0,
"sourceSize": [3.0],
"castShadow": true
}

Spot light

Cone-shaped light with inner/outer falloff angles.

"light": {
"type": "spot",
"color": [1.0, 1.0, 1.0],
"intensity": 12.0,
"radius": 10.0,
"cone_inner_deg": 15.0,
"cone_outer_deg": 30.0,
"castShadow": true
}

Field reference

FieldApplies toDefaultDescription
typeall"directional", "point", or "spot"
colorall[1,1,1]Linear RGB colour (0–1 each channel)
intensityall1.0Brightness value — meaning depends on unit
unitall"artist"Physical unit — see Physical light units
temperatureallCorrelated colour temperature in Kelvin — overrides color when set
directiondirectional[-0.4,-1,-0.6]World-space direction vector
radiuspoint, spot5.0Influence radius / attenuation falloff distance
cone_inner_degspot0.0Inner (full-brightness) cone half-angle in degrees
cone_outer_degspot90.0Outer (falloff-to-zero) cone half-angle in degrees
sourceSizepoint, areaPhysical emitter size in cm — [radius] for point, [width, height] for area
angledirectional, areaAngular diameter in degrees (e.g. sun ≈ 0.53°) or beam spread
castShadowallfalseWhether the light casts shadows

Physical light units

When "unit" is set, the engine converts the raw intensity to its internal representation:

UnitMeaningConversion
"artist"Engine-scaled (no conversion)Pass-through
"lm"Lumens — total luminous fluxPoint: candela=lm4π\text{candela} = \frac{\text{lm}}{4\pi}; Spot: adjusted for cone solid angle
"lx"Lux — illuminance (lm/m²)Pass-through — used directly for directional lights
"cd/m2"Nits — luminancePass-through

Spot light conversion

For spot lights, luminous flux is converted to candela accounting for the cone's solid angle:

candela=lm2π×(1cos(θ/2))\text{candela} = \frac{\text{lm}}{2\pi \times (1 - \cos(\theta / 2))}

where θ\theta is the full outer cone angle in radians.


Colour temperature

When temperature is specified (in Kelvin), the engine converts it to an RGB colour using the Tanner Helland approximation, replacing the color field. This is useful for matching real-world light sources.

TemperatureLight sourceAppearance
1,850 KCandle flameDeep orange-red
2,200 KWarm incandescent bulbOrange
2,700 KSoft white LEDWarm white
3,200 KHalogen / tungstenYellowish white
5,000 KDirect sunlightNeutral white
5,778 KSun (astronomical)Slightly warm white
6,500 KOvercast skyCool white
10,000+ KBlue skyBluish

The valid range is 1,000–40,000 K.


Light source profiles

The engine ships with physically-based light profiles in engine_defaults/lights/physicallybased/. These can be referenced from the lights:// scheme.

Profile format

{
"description": "Physically Based — Sun",
"type": "directional",
"unit": "lx",
"color": [1.0, 0.877, 0.822],
"temperature": 5778.0,
"intensity": 400.0,
"angle": 0.5332,
"castShadow": true,
"sources": [ ... ],
"_tags": ["Natural"]
}

Some profiles include variants — alternative configurations of the same fixture:

{
"description": "Physically Based — Household Light Bulb",
"type": "point",
"unit": "lm",
"temperature": 2200.0,
"intensity": 400.0,
"variants": [
{
"name": "5000 K",
"temperature": 5000.0,
"intensity": 400.0
}
]
}

Natural light sources

ProfileTypeUnitIntensityTemp
Sundirectionallx4005,778 K
Moondirectionallx0.274,100 K
Skydirectionallx12,000 K
Candle flamepointlm131,850 K
Fireflypointlm0.055,600 K
Kerosene lamppointlm1002,200 K

Artificial light sources

ProfileTypeUnitIntensityTemp
Household light bulbpointlm4002,200 K
Fluorescent tubearealm2,8506,500 K
Street lightpointlm16,0004,000 K
Car headlightspotlm3,2006,000 K
Photo flashpointlm190,0005,500 K
Digital displayareacd/m²5006,500 K

Cinema / studio fixtures

ProfileTypeUnitIntensityTemp
ARRI SkyPanel Xarealm48,0001,500–5,600 K
ARRI SkyPanel S60 Proarealm9,3502,800 K
ARRI M-Series M8pointlm68,5005,600 K
Aputure Storm 1200xpointlm171,0005,600 K
Aputure Amaran 300cpointlm4,7002,500 K
Kino Flo Mimik 120arealm9,3002,700 K
ROE Carbon CB5 MkIIareacd/m²5,0006,500 K