Realism: two schools
Target API: 5 · Target build:
bbb6l5(2026-11-20, production and preprod) · Status: Verified (ported to the current API — on-device re-check recommended) School A: additive fixes (from defaultLight) — useengineColour(finished color) as the base and add warm glow or rim. Easy and safe, but the lighting model stays default.
School B: full relighting (from s.colour) — discard l.engineColour and rebuild lighting from s.colour (albedo) and raw LightIn materials. The real path to realism. Four rules:
- Re-apply fog: the light hook runs post-fog, so apply
mix(l.fogColour, col, (1.0 - l.fogAlpha))yourself (R9.10). When fog is too dense, floor it withmin(l.fogAlpha, 0.70). Conversely, mixing more fog color onto engineColour-based packs double-fogs into white distance - Unlit fallback: pass through to
defaultLightoutside#ifdef BLOXD_LIGHTING - Guard whole shared functions: wrap shared functions taking
BloxdLightInin#ifdef BLOXD_LIGHTINGas entire functions (guarding only call sites is not enough) - When there is no sun direction: if
bloxdSunDirection()is zero, don’t compute directional specular.l.directionalis a light-amount scalar, not a direction vector, so it cannot restore highlight direction. Switch to weak directionless ambient as needed. Moon direction is available via-bloxdSunDirection()(only moves in day/night-cycle worlds — The sun and the moon)