Light & Sound Demo
App: apps/lsv_demo/
Demonstrates light, sound & vision as mechanics (engine PLM-199/203/206, ADR 0067) — with the HUD you’d ship in the game. A “player” walks a slow loop through a lamp’s pool of light, out into the dark, and behind a wall, while two live “graph level” bars + a numeric panel show:
- EXPOSURE —
Illumination.illuminanceAt(player)→0hidden …1fully lit, respecting the wall’s shadow (a masked line-of-sight ray). A hard “spottable” stat is just> threshold— the engine returns the raw value, the game decides. - NOISE — the game’s own value (driven by movement speed; standing still is quiet). The engine gives
you the
NoiseBus; this shows how you’d meter your loudness for the player. - VISION —
FogOfWarreveal with the view radius shrinking in the dark (darkness shrinks your view), and Explored areas staying remembered.
The engine samples; the game owns the policy — no stealth rules ship in the engine.
Run from root
Section titled “Run from root”% ./plume3d lsv_demoWhat it does
Section titled “What it does”- On
init, builds a scene with a warm lamp and a wall on the occluder layer. - Each frame reads
Illumination.illuminanceAtat the player for EXPOSURE, computes NOISE from movement, and drivesFogOfWar.revealwith a radius scaled by exposure (dark → see ~3, lit → see ~10). - Draws two
Gui.drawRectFilledbars (green→red by value, with a threshold tick) + aGui.progresspanel.
Verify headless
Section titled “Verify headless”% ./plume3d --test apps/lsv_demoChecks the surface is callable. The occlusion + reveal mechanics are covered by
tests/unit/test_illumination_wren.cpp, test_fog_wren.cpp, and test_noise_occlusion_wren.cpp.