feat(gi): staged progressive GI bake with caches and atmospheric haze
Restructure the global illumination bake into a four-stage
progressive pipeline: a uniform per-polygon direct preview, a
centroid bounce pass, a coarse per-texel lightmap bake, and a
fine-resolution refine pass that upscales composites and restarts
the solver at final density. New giStage2/3/4Radius config keys
gate each stage to a camera-distance bubble, re-evaluated at every
generation barrier, with idle workers catching up late entrants
against the frozen converged field.
Add LightmapCache and GiCentroidCache LRU stores so world cells
streaming out and back in restore baked lighting instantly; both
are validated against a light signature that now includes the sky
color. Mesh-block triangles gain per-texel lightmaps inside the
stage-3 bubble, resampling the block's photo texture into lightmap
space. Escaped bounce rays now sample the sky dome
(BOUNCE_GAIN x sky x SKY_SCALE, -De3d.gi.skyScale default 0.5).
Rewrite Lightmap onto an orthogonal bounding-rect frame with
aspect-first sizing plus refine()/restoreComposite() support.
Two-sided composite shapes emit a reversed-winding lightmapped
back triangle with its own lightmap.
Add an Atmosphere class implementing exponential distance haze,
folded into the existing per-polygon light multipliers of solid
and textured triangles, with AtmosphereTest coverage. Extend
ViewPanel with a per-instance enableGlobalIllumination overload
and accessor, and record the launch command and working directory
in BugReport.
Surface GI observability in DeveloperToolsPanel via a new
thread-safe Status snapshot (stage, queue progress, coverage,
cache sizes). Update the global illumination and configuration
documentation and drop the two one-off review write-ups.
24 files changed: