mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
A hash grid of cells on the surfaces rays hit (cache.wesl, from vendor/bevy_solari's world cache made raea's): 2^20 cells of 84 bytes. A cell's size grows with distance from the eye, it is split by its side, its read place is jittered, and a read claims an empty cell and keeps a live one alive. Each frame, before the probes, two compute passes run. The upkeep (compact.wesl) ages every cell and lists the live ones with a two-level prefix sum. The update (gi.wesl learn and blend) has 40000 cells learn the sun through a shadow ray and one bounce into last frame's cache, then blend, keeping fewer frames while a cell's light is changing. The list's length becomes the update's indirect dispatch, copied out between the passes. The probes' hits read the cache, or LT2's stand-in where a cell is new. Until hits know their surface (LT4) a cell sees albedo 0.5 and is keyed by the side a ray meets. RAEA_GI_STATS gives the cache's GPU ms and the probes' apart (each pass's own timestamps) and the live cells. On Berlin's walk at 1080p with 131072 probe rays a frame: smallest cell 0.15 m, cache 0.931 ms p50, cells peak 1,032,116 (the table full); 0.5 m, 0.512 ms, 479,631; 1 m, 0.456 ms, 189,480. The probes cost 0.259 ms at 0.5 m (LT2's alone 0.253). 0.5 m is the default. The cache lights nothing on screen yet (Metal's sampler limit, as LT2), so no frame changes and LT14 has nothing to measure. Its light is still unchecked.
docs
Documentation that spans more than one folder.
- settings.md: every setting raea reads (the agent's model provider, the optional API for generated music and speech, checks), and where they go.
Each folder's own README describes that part of the code. Behaviour specs written in Gherkin sit beside the code they
specify, for example sdk/shell/shell.feature and
sdk/raea/spec/motion.feature.