pub struct ProbeGrid {
pub volume: ProbeVolume,
pub update: ProbeUpdate,
pub probes: Vec<GpuProbe>,
}Expand description
Topic 50’s irradiance volume (docs/notes/rendering.md): where the probes
are, and what each of them holds.
The diffuse half of global illumination. mesh.slang
interpolates the grid trilinearly and adds the result to the flat ambient
term, so a description with no probes draws the frame it always did — see
crcbl_shaders::probe, which is where the spherical harmonics live and
where they are checked against the literature.
§The irradiance is authored, not baked
GpuProbe::accumulate is how an application
turns an environment into a row, and it is the only correct way to fill one.
There is no bake tool, on a hard prerequisite rather than on taste: a gather
bake casts rays at scene triangles, and this engine has no ray-triangle
intersector and no BVH — crcbl_phys’s query module has ray-vs-sphere,
ray-vs-AABB and ray-vs-capsule and nothing else.
§Default is the volume that changes no pixel
No probes and a grid of no extent, which is what every existing caller gets:
the shader’s fetch clamps onto the table’s cleared first row and adds
exactly zero. There is no branch anywhere selecting it, and no
RenderEffects bit — the off-switch is the
scene.
Fields§
§volume: ProbeVolumeWhere the grid is, how far apart its probes are, and how many there are on each axis.
update: ProbeUpdateWhat fills probes once the scene is running.
ProbeUpdate::Authored by default, which is the frame every scene drew
before the updater landed.
probes: Vec<GpuProbe>One row per probe, the clipmap’s levels one after another finest first
and x-fastest within each, each level’s cells wrapped by its own
scroll offset:
ProbeVolume::row is the index, and it is
level_row(level) + (z · counts.y + y) · counts.x + x for the volume as
authored, before anything has scrolled.
Its length must be volume’s
total — one level’s worth per level —
which
ForwardRenderer::with_scene
checks before it creates anything, through this type’s own check.