mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 06:53:19 -10:00
raea-sys-lightbake's trace: cosine-weighted paths through a BLAS and TLAS the bake builds from the meshes it bakes, by wgpu ray queries on raea-gpu-device, with no Bevy render world (docs/bake.feature BK3 says why). wgsl/diffuse.wgsl is a module systems/rt can include as it is. A device without ray queries is refused with the reason; a GPU error is the bake's error, never a black map. In progress: not the <Environment>, baked lights, the sun's first hit, textures or the drawn albedo of procmat, wear and sdk/wear. Only Metal has run it. Tests with known answers: a white furnace at all 2834 open texels, a black wall's form factor within 0.002, a closed box glowing 1 with albedo a half reading 2.004 for 2, a red wall's bleed, the same bytes twice. Breaking the cosine, the bounce offset, the roulette, its weight, the emission or their order each fails one of them. The trace alone at 512 samples: table 0.8 s, Cornell 0.3 s, window room 0.9 s (grey 0.7, white sky), linear in samples. It found a leak BK2 landed with: origins in a chart's edge band sat in the neighbouring wall's plane, and half their rays left a closed room (1.16 for 2.0 on the box's edges). They're now four offsets in from their triangle's edges, half a texel at most. raea_sys_atlas::laid returns the ray mesh numbered as the texels number it, so the layout's model isn't read back. BK2's table is measured again (the atelier's row is from before).