Skip to content

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:

  • EXPOSUREIllumination.illuminanceAt(player)0 hidden … 1 fully 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.
  • VISIONFogOfWar reveal 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.

Terminal window
% ./plume3d lsv_demo
  • On init, builds a scene with a warm lamp and a wall on the occluder layer.
  • Each frame reads Illumination.illuminanceAt at the player for EXPOSURE, computes NOISE from movement, and drives FogOfWar.reveal with a radius scaled by exposure (dark → see ~3, lit → see ~10).
  • Draws two Gui.drawRectFilled bars (green→red by value, with a threshold tick) + a Gui.progress panel.
Terminal window
% ./plume3d --test apps/lsv_demo

Checks 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.