Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.
TypeScript 3dagent-skillsai-agentsai-videobevyclaude-codegame-enginegpulinuxmacosmotion-designmotion-graphicsreactrusttypescriptvideo-editingvideo-renderingwgpuwindows
LT1: realism.feature rewritten for raea's own renderer, no Solari
shinyobjectz4782bb27b9b2
diff --git a/docs/realism.feature b/docs/realism.featureindex a156c493..04774753 100644--- a/docs/realism.feature+++ b/docs/realism.feature@@ -1,109 +1,123 @@@spec-Feature: raea Light: one realism system for shading, ray tracing and occlusion, measured against a reference+Feature: raea Light: raea's own real-time realism renderer, measured against raea's own referenceShane, 2026-11-17, on gambit's characters in the game's own light: "how do we get UNREAL ENGINE level detail andquality"; then "before anything we have to figure out the shader/raytracing/ambientocclusion of the engine we want touse. right now we seem completely misaligned and need to centralize the strategy to get SOTA results"; then "what if- we could build our own thing for raea that was a complete realism like system like unreal engine".-- This file is that system's one strategy, its owner's backlog and its bar. It replaces choosing a lighting path per- project. docs/raytracing.feature (RT1-RT6: guide data, Solari, MetalFX, DLSS) and docs/shaders.feature (SH0-SH11)- stay where their steps are recorded; anything they decide about light, occlusion or how a surface is shaded is- decided here first.-- What Unreal's realism is, and where raea stands (11-17):- | Unreal | what it does | raea today |- | Lumen | bounce light, reflections, occlusion: one GI | five partial paths (M1) |- | MegaLights, RT shadows | many lights, traced shadows | Solari's ReSTIR DI; not in the games |- | Substrate | one material model in every pass | a hook runs in the forward pass only (M2) |- | skin, hair, cloth models | subsurface skin, strand hair, cloth sheen | skin in raster only; no hair or cloth model |- | TSR, denoisers | a clean, stable frame from few rays | MetalFX on the Mac (RT4); nothing on Windows |- | Nanite | unlimited geometry | not needed yet |-- What was found (measured 11-17 on gambit's people-ingame.tsx, the four heroes in the baked city, four skies; M5 Pro):+ we could build our own thing for raea that was a complete realism like system like unreal engine"; and, once FLOOR3+ measured Solari at 2.6 times raster's frame: "i want our own version our own raea realism renderer then that doesnt+ use solari ... if solari is too slow then we need to look elsewhere".++ This file is that renderer's one strategy, its owner's backlog and its bar. It replaces choosing a lighting path per+ project. docs/raytracing.feature (RT1-RT6) and docs/shaders.feature (SH0-SH11) keep the steps they recorded;+ anything about light, occlusion, reflections or how a surface is shaded is decided here first. The first version of+ this file (11-17, commits ttn, xok, quu on branch `realism`) built on Solari; this one replaces it.++ The design is the one Unreal's Lumen and AMD's GI-1.0 use to get ray-traced light at game frame rates: raster draws+ what the camera sees and its direct light; the light that bounces is traced into caches that keep what they learned+ and are refreshed a little each frame, at a cost set by a ray budget, not by the screen. Solari instead traces every+ pixel every frame (ReSTIR), which is why it costs what it does.++ What Unreal's realism is, and what raea Light makes of it:+ | Unreal | what it does | raea Light |+ | Lumen surface cache | what a ray sees: each mesh's material on cards | the surface cache (LT4), captured through the |+ | | | deferred pass every material writes |+ | Lumen world radiance cache | far and multi-bounce light, probes around the camera | the world radiance cache (LT2, LT3) |+ | Lumen screen probes | detail and contact: sparse probes from the G-buffer | screen probes (LT8) |+ | Lumen reflections | traced for smooth surfaces, the cache for rough | the same (LT9) |+ | shadow maps, MegaLights | direct light and its shadows | Bevy's raster lights and shadow maps, as today |+ | skin, hair, cloth models | subsurface skin, hair, cloth sheen | shading models the GI goes through (LT11) |+ | TSR | a clean, stable frame from few rays and fewer pixels | caches' own history, our temporal filter, MetalFX |+ | | | upscaling on the Mac (LT12) |+ | path tracer reference | ground truth with the same materials | raea's path tracer on systems/rt (LT5) |++ What was found (11-17, gambit's people-ingame.tsx, the four heroes in the baked city, four skies; this Mac, M5 Pro):M1. Five lighting paths, none whole: a flat AmbientLight (CityShot); Bevy's SSAO (a white veil and bright face- outlines on the heroes); raea's own traced AO (systems/rt, its own TLAS: its pipeline failed to build on Metal,- a ray query declared in a loop, fixed 11-17); Solari (Bevy's ReSTIR, vendored with raea's patches; FLOOR3 and- the anything films light every shot with it); a captured environment (gambit, by hand: six views a sky- stitched into a panorama). Two TLAS builders run side by side: systems/rt's and bevy_solari's.- M2. A surface hook runs in the forward pass only (SH0c, 10-28: "the main pass alone runs the author's code").- Solari lights the deferred G-buffer, which gets StandardMaterial's raw values: gambit's world shaders keep a- surface's kind in the vertex colour's alpha, so under Solari the snow drew teal and the windows red and cyan.- The hooked meshes are in the traced scene (the city's soft traced shadows show under Solari; apparently Solari- tags them before systems/shader swaps their material), but its hits read the same raw StandardMaterial.- M3. Characters aren't lit by traced light: Solari skips skinned and morphed meshes (RT5); systems/rt's TLAS takes- them in their bind pose (arms out). A trial (RAEA_SOLARI_DYNAMIC=1, solari.rs, uncommitted, another lane)- poses CPU twins: they then shadow and bounce, but stay raster-lit themselves. The twins hold on Metal for a- skinned StandardMaterial part (gambit's first-person hands shadowed the table correctly over a 16 s take), but- the character skin is an ExtendedMaterial and isn't traced at all: gambit's first-person arms bake their skin- into a plain StandardMaterial to get into the traced scene.- M4. Nobody owns it: docs/control.feature lists ray tracing's owner as "-". Each project tunes its own light by eye- (FLOOR3's light-jump rules, the kitchen's rig, gambit's LIFT and ev).- M5. No reference: no frame is measured against ground truth. Bevy's <Pathtracer> exists but reads the same raw- materials, so it can't be one for hooked worlds.- M6. Shading changes land without a lighting check: the shared tree's build of 11-17 evening draws gambit's faces- brighter than raea-signed of 03:59 in 17% of the pixels of a dawn close-up. The cause is a fix (60b8152a86,- 11:57: a shaded part with no model beside it got its shader only when a model spawned), so head parts now get- the skin shader they were meant to have; but no lighting owner measured it, and every people check rendered- that day with raea-signed showed heads without their skin shading.- M7. Cost, offline at 1080p with readback: raster 0.2 s a frame, Solari 1.0 s (20 frames, wall clock). Live frame- time isn't measured; docs/realtime.feature asks <= 250 ms ray-traced at half size.- M8. Traced AO (fixed build, reach 0.6 m) darkens contacts and creases as it should (7% of the line's pixels, to- -0.23 stops), but also brightens 7-8% of a face close-up, which occlusion alone can't do: unexplained.- M9. Solari ignores PointLight and RectLight: it lights from directional lights, emissive meshes and the- environment. Projects stand emissive spheres and sheets in for them by hand (gambit's SetRooms `traced`:- L = flux/(4 pi^2 r^2) for a bulb, flux/(pi A) for a sheet), so the same scene's lamps differ between paths.- M10. The hook gap isn't ShaderExt's alone: procedural materials (systems/procmat) also named no deferred shader,- so under Solari they drew their flat base colour (the kitchen's oilcloth lost its checks); a fix is in- progress on another lane (deferred_fragment_shader returning procmat.wesl, whose prepass branch already- writes the G-buffer). Every MaterialExtension raea has (ShaderExt, procmat, toon, tint, paint, grid,- froxel glass) needs the same check.- M11. Per-frame CPU geometry freezes in a render: a <BufferMesh> whose vertices change each frame is built once- and never rebuilt (engine/render spawn.rs apply_rows updates live values only), so traced and raster scenes- both keep its first shape.+ outlines on the heroes); raea's own traced AO (systems/rt; its pipeline failed to build on Metal, a ray query+ declared in a loop, fixed 11-17); Solari (FLOOR3, Stay and the anything films light every shot with it); a+ captured environment (gambit, by hand: six views a sky stitched into a panorama).+ M2. A surface hook runs in the forward pass only (SH0c, 10-28). Any pass that reads materials another way (a+ deferred G-buffer, a ray hit) sees StandardMaterial's raw values: gambit's world shaders keep a surface's kind+ in the vertex colour's alpha, so under Solari the snow drew teal and the windows red and cyan (posted+ i-acp-mwl90ova-102). procmat had the same gap (M10).+ M3. Characters aren't in traced light: Solari skips skinned and morphed meshes (RT5); systems/rt takes them in+ their bind pose (arms out). A trial (RAEA_SOLARI_DYNAMIC=1, another lane) poses CPU twins.+ M4. Nobody owned light: docs/control.feature lists ray tracing's owner as "-". Each project tunes its own light by+ eye (FLOOR3's light-jump rules, the kitchen's rig with a panel for "the bounce the renderer doesn't trace",+ gambit's LIFT and ev).+ M5. No reference: no frame was measured against ground truth. Bevy's <Pathtracer> reads raw materials (M2), so+ it can't be one for hooked worlds.+ M6. Shading changes land without a lighting check: 60b8152a86 (11-17) gave head parts the skin shader they were+ meant to have, and faces drew brighter in 17% of a dawn close-up; nobody measured it.+ M7. Traced AO (reach 0.6 m) darkens contacts as it should, but also brightens 7-8% of a face close-up, which+ occlusion alone can't do: unexplained (the bind-pose arms of M3 are a suspect).+ M8. Solari ignores PointLight and RectLight; projects stood emissive spheres and sheets in for them by hand.+ M9. Per-frame CPU geometry freezes in a render: a <BufferMesh> whose vertices change each frame is built once.+ M10. Every MaterialExtension raea has (ShaderExt, procmat, toon, tint, paint, grid, froxel glass) named no+ deferred shader; procmat's is written (6 lines, handed over by the first-person lab 11-17: its shader's+ PREPASS_PIPELINE branch already wrote the G-buffer, and the oilcloth kept its checks under Solari).+ M11. Solari is accurate but slow (LT1, FLOOR3 at 1080p): 0.96 stops from the reference against raster's 1.38,+ its error almost all one bias a stop dark; 47.6 ms a frame against raster's 18.0.+ M12. systems/rt builds a BLAS a mesh from Bevy's own vertex buffers and a TLAS every frame, with a shadow mask+ but no instance data: a ray learns where it hit, not the surface's normal or colour.+ M13. Bevy's irradiance volume is a 3D texture of ambient cubes (Rx, 2Ry, 3Rz: one colour each way a voxel) that+ every standard material samples, hooked ones included; it has no visibility test, so light can leak+ through a wall. A compute pass can write it each frame.+ M14. The skin and hair shaders of sdk/character use `lit`, the hook that runs after lighting; gambit's world+ shaders don't.+ M15. docs/realtime.feature's budget is the editor's (a drag to its first changed pixel <= 120 ms p50, 250 ms+ ray-traced at half size), not a game's frame.Decisions:- D1. The engine stays Bevy 0.20 on wgpu (docs/gpu.md, 11-10): no backend of our own. raea Light is ours: the- light transport, the material model, the reference and the bar, built on Bevy's raster and wgpu's ray queries- (Apple silicon on Metal, RTX and RDNA2+ cards on Vulkan).- D2. One light-transport core: Solari's ReSTIR DI (direct light, traced shadows, many lights) and ReSTIR GI with- its world cache (bounce), the family of Unreal's MegaLights and NVIDIA's RTXDI. raea already vendors it with- its own patches; it becomes raea's to change, not a dependency to wait on. A probe GI of our own (DDGI) would- be an older generation, so it's only the fallback (D10).- D3. One traced scene: Solari's TLAS. systems/rt's passes (traced AO, the sun and sky passes) read it, and its- own BLAS and TLAS building goes.- D4. One material, three places: a surface hook runs in the forward pass, in the deferred G-buffer pass and where- a ray hits it. At a hit, where the hook can't run, a material proxy stands in: the hook's own average albedo,- roughness and emission per kind, baked from it. This reverses SH0c's main-pass-only rule.- D5. Everything is in the traced scene: characters as posed twins (RT5's trial now; skinning into the BLAS on the- GPU later), morphs, alpha-tested hair cards (RT6's masks).- D6. Occlusion isn't an effect of its own: under traced light it comes out of the bounce. Traced short-range AO- stays for the raster fallback and as a crease term; SSAO goes.- D7. Skin, hair and cloth are shading models (BSDFs) with a raster and a traced form each, not post effects.- D8. Denoise and upscale per platform: MetalFX on the Mac (RT4), DLSS Ray Reconstruction through Bevy's `dlss`- feature on NVIDIA, a temporal filter of our own elsewhere; a denoiser-only history reset for light jumps.- D9. Ground truth: <Pathtracer> with the same materials (it needs D4) is the reference. The bar is distance to it- and frame-to-frame stability on fixed reference scenes, not a look judged on a still.- D10. Fallback where the GPU has no ray queries, and for live play if the frame budget isn't met: raster with- irradiance volumes and reflection probes that raea captures from the same scene (as gambit's panorama was- made by hand), in the same units and exposure, so switching paths doesn't change brightness.- D11. One set of units: lux, cd/m², EV, and one exposure model for every path. 11-17's captured environment had- to be scaled 1.36, 0.13, 0.02 and 0.006 per sky to match the flat ambient: a sign there's no shared model.- D12. One owner: the session that wrote this file, on lane `realism` (Shane adopted the file 11-17 and set its goal:- every LT @done with its numbers). A change to- light, shadow, occlusion or a shading model lands with before and after on the reference scenes (LT1).+ D1. The engine stays Bevy 0.20 on wgpu (docs/gpu.md): no backend of our own. Bevy's raster draws what the camera+ sees and direct light (sun, point, spot, rect lights, shadow maps), as it does today. raea Light adds what+ raster fakes: bounce light, occlusion, reflections, and the reference.+ D2. No Solari. It goes from every live, render and reference path once raea's replaces each use (LT13), and+ vendor/bevy_solari with it.+ D3. One ray scene: systems/rt's TLAS, every frame, holding everything opaque, characters posed (LT7). Each+ instance carries a record (its mesh's vertex and index slices, its surface-cache cards), so a hit knows its+ normal and what it looks like (LT3).+ D4. Every material writes the deferred G-buffer with its own surface code (procmat first, then ShaderExt and the+ rest: M10). That one pass serves three readers: the surface cache's capture (D5), the screen probes (LT8) and+ the reference's first hit (LT5). A `lit` hook can't run there (M14): skin and hair become shading models+ (LT11) instead.+ D5. The surface cache is what a ray sees: each mesh captured from up to six sides into low-resolution cards+ (albedo, normal, emission) through the deferred pass, so a hook's look reaches the rays without being+ rewritten. Until it lands, hits read a flat stand-in.+ D6. raea GI has two levels. The world radiance cache: probes on nested grids around the camera, each probe's+ irradiance and its distance to what it sees (so light doesn't leak through walls), refreshed by a fixed ray+ budget a frame, multiple bounces by reading itself at hits. Screen probes: one every 16 pixels from the+ G-buffer, short rays through the TLAS ended in the world cache, filled in between by depth and normal. Until+ the screen probes land, the world cache reaches the frame through Bevy's irradiance volume (M13).+ D7. Every light feeds the GI: a hit is lit by the sun and the sky, point, spot and rect lights and emissive+ surfaces, each with a shadow ray, in raster's units.+ D8. Reflections: smooth surfaces traced, hits shaded from the surface cache and the world cache; rough ones read+ the probes.+ D9. Occlusion isn't an effect of its own: it comes out of the GI. SSAO and traced AO go once the GI replaces them,+ and M7 is explained first.+ D10. Skin, hair and cloth are shading models (subsurface skin, two-lobe hair, sheen cloth) that direct light and+ the GI both go through.+ D11. Ground truth is raea's own path tracer on systems/rt: its first hit from the camera's G-buffer (every+ material exactly as raster draws it), its bounces from the surface cache, its lights as the GI's. Until it+ lands (LT5), Bevy's <Pathtracer> stands in for scenes it can draw (no hooks: FLOOR3, the glade).+ D12. One set of units: lux, cd/m², EV, and one exposure model for every path.+ D13. The game's budget, for Shane to confirm (M15): 60 fps at 1080p on an M-series Mac (16.7 ms a frame), with+ raea GI's share at most 5 ms of it; 30 fps the floor; quality tiers (rays a frame, probe spacing, screen-probe+ resolution) scale it down for smaller GPUs. The editor's live frame keeps docs/realtime.feature's budget.+ D14. One owner: the session that wrote this file, on lane `realism`. A change to light, shadow, occlusion,+ exposure or a shading model, in any lane, lands with its LT1 numbers before and after (LT14).Background:- Given Bevy 0.20 with bevy_solari vendored (vendor/bevy_solari, changes marked "raea:") and objc2-metal-fx+ Given Bevy 0.20 on wgpu with ray queries (Apple silicon on Metal; RTX and RDNA2+ on Vulkan), systems/rt's TLASAnd the house rules: builds through `lane build --`, commits through `but`, the shared raea-signed rebuilt only- after telling the sessions that render with it+ after telling the sessions that render with it, benches run on a copy of the binary in scratchRule: The bar firstScenario: LT1. Reference scenes, a reference frame for each, and the numbers- Given four scenes (bench/light/scenes.json): gambit's people-ingame (the street and faces, four skies), the FLOOR3- room (interior, light jumps), a kitchen (gambit's first-person table, fp-lab-table: contact shadows and occlusion;- the anything film's kitchen doesn't render on 11-17, every composition in content/anything throwing "Can't find- variable: raea" before its first frame) and the glade (foliage, sun through leaves)+ Given four scenes (bench/light/scenes.json): Berlin, gambit's people-ingame (the street and faces, four skies),+ the FLOOR3 room (interior, light jumps), a kitchen (gambit's first-person table, fp-lab-table: contact shadows,+ window light; the anything film's kitchen doesn't render on 11-17, every composition in content/anything+ throwing "Can't find variable: raea") and the glade (foliage, sun through leaves)And the plan| crate | file | lines | job || raea-light | src/lib.rs | 260 | `raea light check`: scenes, references kept, paths, live |@@ -114,94 +128,113 @@ Feature: raea Light: one realism system for shading, ray tracing and occlusion,| raea-runtime-export | src/bevy_frame.rs | 340 | RAEA_LIGHT_SPP: a frame drawn N times, accumulated afresh || bevy_solari | src/pathtracer/extract.rs | 40 | raea: the path tracer's reset one-shot, as Solari's || raea-cli | src/cli.rs | 384 | the `light` verb |- Then each has a converged <Pathtracer> frame as its reference, in the same units and exposure; gambit's, whose- world is drawn by hooks the path tracer can't run (M5), only once LT2 and LT3 put them in the traced path- And Berlin (gambit's people-ingame) is the main scene, every step aimed at it first and shown on it before and- after (Shane, 11-17); the other three prove the check until the path tracer can draw Berlin- And `raea light check` renders each with the current path and reports distance to the reference (mean and- worst tile, in stops), temporal stability over a moving shot, and the live frame time at 1080p and half size- (half size waits on a switch that draws the 3D smaller: the live 3D draws at its composition's size whatever- the stage's, so `raea play --size` measured the same frame, 11-17)- And the numbers for today's paths (flat ambient, captured environment, traced AO, Solari) are recorded here as- the baseline before any step below lands- And measured 11-17 on this Mac: FLOOR3, stills 1500 and 4000 against a 2048-sample reference (44 s a frame), the- distance on 8x8-pixel blocks, flicker against the path-traced shot 1500-1504, live 6 s unthrottled at 1080p+ Then each has a converged reference frame from raea's path tracer (LT5), in the same units and exposure; until+ then Bevy's <Pathtracer> stands in where it can draw the scene (FLOOR3, the glade)+ And Berlin is the main scene: every step is aimed at it first and shown on it before and after (Shane, 11-17)+ And `raea light check` renders each on each path and reports distance to the reference (mean and worst tile,+ in stops), temporal stability over a moving shot, and the live frame time at 1080p (half size waits on a+ switch that draws the 3D smaller: the live 3D draws at its composition's size whatever the stage's, so+ `raea play --size` measured the same frame, 11-17)+ And measured 11-17 on this Mac: FLOOR3, stills 1500 and 4000 against a 2048-sample <Pathtracer> reference (44 s+ a frame), the distance on 8x8-pixel blocks, flicker against the path-traced shot 1500-1504, live 6 s+ unthrottled at 1080p| scene | path | mean stops | bias | worst tile | flicker | live ms a frame || floor3 | raster | 1.379 | -0.80 | 3.37 | 0.101 | 18.0 || floor3 | traced-ao | 1.379 | -0.80 | 3.37 | 0.101 | 18.6 || floor3 | solari | 0.959 | -0.95 | 2.62 | 0.113 | 47.6 |- And what they say: Solari is nearer the truth than raster, its error almost all one bias (a stop dark, the- bounce an interior lives on), raster's patchy; but Solari costs 2.6 times raster's frame. traced-ao is raster- here (FLOOR3's camera has no <AmbientOcclusion>). The shot held still (raster's frames are identical), so its- flicker is the reference's own noise, about 0.10 stops at 2048 samples: a moving shot is still to pick. Berlin- and the kitchen have no reference yet (M5, M9); the glade waits on a re-run-- Rule: One material, one scene-- Scenario: LT2. A surface hook in the deferred G-buffer- Given ShaderExt's hooks run only in the forward pass (M2), and procmat had the same gap (M10)- Then every MaterialExtension in raea names a deferred fragment shader that runs its own surface code (procmat's- is the first, from another lane)- And a hook that reads a second UV set keeps it in the deferred pass (wear's weathering recipes read three baked- cause maps through TEXCOORD_1: under Solari without this, a shot draws no wear)- Then ShaderExt has a deferred fragment shader that runs `surface` and writes Bevy's G-buffer from the PbrInput- (as pbr_deferred_functions does), and a prepass that writes the hooked normal- And under Solari, gambit's snow, facades and windows draw as they do in raster (LT1's scenes, by eye and by- distance to raster's base colour)-- Scenario: LT3. A hooked mesh's ray hits shaded by a material proxy- Given hooked meshes are traced, their hits shaded from StandardMaterial's raw values (M2), and they're traced only- because Solari tags them before the hook's swap removes MeshMaterial3d<StandardMaterial> (an order, not a rule)- Then a hooked mesh is traced by rule, and its hits are shaded from a material proxy: per kind, the hook's mean- albedo, roughness and emission, baked from the hook's own output over the mesh's UVs- And a lit window bounces warm light into the street at dusk, and the snow's bounce is white, not teal-- Scenario: LT4. One TLAS- Then systems/rt's traced AO and its sun and sky passes bind Solari's TLAS, and systems/rt builds none of its own- And a frame builds one acceleration structure, measured-- Scenario: LT5. Characters in traced light- Given RT5's trial (CPU twins) on another lane- Then a <Character> under Solari is traced as posed, every frame, garments, head parts and its skin (an- ExtendedMaterial today, untraced: M3) included- And its own pixels are lit by Solari (in the G-buffer, LT2), not raster-lit- And people shadow the street and each other, and the street's bounce reaches their faces-- Scenario: LT5b. Every light type in traced light- Given Solari ignores PointLight and RectLight (M9)- Then a PointLight, SpotLight and RectLight are sampled by Solari's ReSTIR DI as the lights they are (or stand in- as emissive geometry made by raea, not by each project), in the same units as raster- And a scene's lamps measure the same in raster and under Solari on LT1's scenes (within 0.25 stops)-- Rule: Occlusion, surfaces, image-- Scenario: LT6. One occlusion story- Then under Solari no AO effect is added; in the raster fallback traced AO (LT4's TLAS) replaces SSAO, and M8's- brightening is found and fixed first- And <AmbientOcclusion> means traced AO wherever the device has ray queries-- Scenario: LT7. Skin, hair and cloth as shading models- Then skin (subsurface, from sdk/character's skin look), hair cards (anisotropic, two lobes) and cloth (sheen,- no velvet haze at grazing angles: 11-17's wool needed reflectance 0.22 by hand) each have a raster form and a- traced form, checked against the reference on LT1's faces-- Scenario: LT8. Denoising and upscaling beyond the Mac- Then Bevy's `dlss` feature (Ray Reconstruction) runs on NVIDIA, a temporal filter of our own elsewhere- And a denoiser-only history reset exists for light jumps (FLOOR3's rule of 0.2 a frame stays the fallback)-- Rule: Live and fallback-- Scenario: LT9. Live frame budget- Then LT1's live frame time meets docs/realtime.feature's budget on an M-series Mac and an RTX card, or the- game plays on LT10 and Solari draws the trailer, cutscenes and stills-- Scenario: LT10. Captured probes for the raster path- Then raea captures irradiance volumes and reflection probes from the scene itself (six views at each probe,- filtered by Bevy's generator), in LT1's units, and draws with them where there's no ray tracing- And switching a scene between LT10 and Solari moves LT1's mean by less than 0.25 stops-- Rule: Keeping it aligned-- Scenario: LT11. A lighting change shows its numbers- Then a commit that changes light, shadow, occlusion, exposure or a shading model says LT1's numbers before and- after in its message, and the owner is told (M6)+ And what they say: Solari is nearer the truth than raster but costs 2.6 times its frame (M11); raster's error+ is patchy. traced-ao is raster here (FLOOR3's camera has no <AmbientOcclusion>). The shot held still, so its+ flicker is the reference's own noise, about 0.10 stops at 2048 samples: a moving shot is still to pick.+ Berlin and the kitchen have no reference yet (M2, M8); the glade waits on a re-run++ Rule: The world radiance cache first++ Scenario: LT2. What a frame of probe rays costs on Berlin+ Given a grid of probes around the camera, each tracing its share of a ray budget through systems/rt a frame,+ a hit shaded by a flat stand-in (albedo 0.5, facing the ray) lit by the sun (one shadow ray) and the sky (a+ miss), each probe keeping a running mean+ Then the cache writes Bevy's irradiance volume (M13) each frame, behind RAEA_GI=1, nothing changed unset+ And on Berlin the GPU time of the probe pass is measured at 64k, 128k, 256k and 512k rays a frame, with the+ frame's total, so the rest is sized from what this Mac's ray queries actually cost (D13)+ And Berlin is shown in raster, raster with the cache, and the cost table, before anything else rests on it++ Scenario: LT3. A ray hit knows its surface+ Then each TLAS instance carries a record: its mesh's vertex and index slices in Bevy's mesh allocator, its+ transform and its surface-cache cards, so a hit has its normal (the triangle's, then the mesh's own) and a+ place to look up what it looks like (D3)+ And the world radiance cache becomes whole (D6): nested grids around the camera, each probe's irradiance and+ distance on an octahedral map, rays a frame shared across the levels, a hit reading the cache for its own+ bounce; on Berlin, light no longer leaks through a facade into a room, and its cost is in LT2's table++ Scenario: LT4. The surface cache+ Given every MaterialExtension writes the deferred G-buffer with its own surface code (D4; procmat's is first,+ then ShaderExt's `surface` hook, toon, tint, paint, grid, froxel glass), and wear's weathering keeps its+ second UV set there+ Then each mesh is captured into cards (D5) through that pass, again only when it or its material changes+ And a ray's hit reads its albedo, normal and emission from its cards: Berlin's snow bounces white, a lit window+ throws warm light into the street at dusk++ Scenario: LT5. raea's path tracer, the reference+ Then a path tracer on systems/rt takes its first hit from the camera's G-buffer and its bounces from the+ surface cache, its lights as the GI's (D7, D11), and converges over RAEA_LIGHT_SPP draws+ And `raea light check` uses it for every reference; Berlin, in its four skies, and the kitchen get theirs, and+ Bevy's <Pathtracer> leaves the check+ And LT1's numbers are taken again on all four scenes, raster and raea GI++ Rule: Every light, everything in it++ Scenario: LT6. Every light feeds the GI+ Then a hit is lit by the sun and the sky, point, spot and rect lights and emissive surfaces, each with a shadow+ ray (a few lights sampled by their power where there are many), in raster's units (D12)+ And the kitchen's window panels and FLOOR3's ceiling panels bounce as the reference has them; the kitchen's+ stand-in "bounce the renderer doesn't trace" panel can go++ Scenario: LT7. Characters posed in the ray scene+ Given RT5's trial poses CPU twins (another lane)+ Then a <Character> is in systems/rt's TLAS as posed, every frame: skin, garments, head parts, and hair cards+ with their alpha masks tested where a ray meets them+ And people block and bounce light: the street darkens round their feet, their faces take the street's bounce,+ and M7's brightening is explained++ Rule: Detail, reflections, occlusion++ Scenario: LT8. Screen probes+ Then a probe every 16 pixels from the G-buffer traces short rays through the TLAS, ends them in the world cache,+ keeps its history across frames by motion, and is filled in between by depth and normal (D6)+ And indirect diffuse is applied per pixel in place of the irradiance volume; Berlin within 0.25 stops mean and+ 0.5 worst tile of its reference in every sky, with no more flicker than raster++ Scenario: LT9. Reflections+ Then smooth surfaces trace their reflections, hits shaded from the surface cache and the world cache; rough+ ones read the probes; reflection probes captured by hand go (D8)+ And the snow's sheen, wet stone and window glass on Berlin's street measure within LT8's bar++ Scenario: LT10. Occlusion from the GI alone+ Then SSAO and traced AO are off wherever raea GI is on, and <AmbientOcclusion> means nothing extra there (D9)+ And contacts on LT1's scenes (feet on the street, the mug on the table) are as dark as the reference's++ Rule: Surfaces and image++ Scenario: LT11. Skin, hair and cloth as shading models+ Then skin (subsurface, from sdk/character's skin look), hair cards (two lobes) and cloth (sheen, without+ 11-17's velvet haze at grazing angles) are shading models in the deferred pass, direct light and the GI both+ going through them, replacing sdk/character's `lit` hooks (M14)+ And Berlin's faces are checked against the reference in every sky++ Scenario: LT12. Speed and image+ Then the caches keep their own history, a temporal filter of ours steadies the frame, and MetalFX's upscaler+ draws it from fewer pixels on the Mac+ And the game meets D13's budget at 1080p on this Mac with raea GI on, measured live on Berlin, FLOOR3 and the+ kitchen, and the editor's live frame meets docs/realtime.feature's+ And quality tiers scale it for smaller GPUs, each tier's numbers in LT1's table++ Rule: One renderer++ Scenario: LT13. Solari gone+ Then every project that lights with Solari (FLOOR3, Stay, the anything films, gambit's trials) renders with raea+ GI, each shown before and after to its owner, and vendor/bevy_solari, MetalFX's denoiser path (RT4) and+ RAEA_LIGHT's solari path are removed++ Scenario: LT14. A lighting change shows its numbers+ Then a commit that changes light, shadow, occlusion, exposure or a shading model, in any lane, says LT1's numbers+ before and after in its message, and the owner is told (M6)