simvx.graphics.renderer.irradiance_volume_pass¶
Irradiance-volume capture: desktop (Vulkan) backend for IrradianceVolume3D.
Bakes a grid of diffuse-GI probes (design D10/RM-E9). Per budgeted probe it
renders a small radiance cubemap from the probe position (reusing the
reflection-probe face-render machinery: _FaceCamera + a
GameViewportRenderer face target + a source cube), then dispatches the
irradiance_sh_reduce.comp compute to project that cube onto SH-L1 and write
the 12 coefficients into the volume SSBO (forward set0 binding 18) at the probe’s
slice. The uber shader trilinearly blends the 8 surrounding probes and evaluates
their SH per fragment normal (irradiance_volume_diffuse in cube_textured.frag),
so a dynamic object inside the box picks up soft coloured indirect light.
All work records into the PRIMARY frame command buffer (the cmd from the
app’s pre_render hook), exactly like :class:ReflectionProbePass: face
renders, the SH-reduce dispatch, and the write->read barrier are inline, so the
main pass later in the same cmd reads this frame’s freshly-baked SH with no queue
stall. update_budget probes bake per frame so a large grid amortises.
Zero-cost when unused: the pass is lazily created the first frame a volume is
present, and the uber’s irradiance_volume_enabled gate stays 0 (SSBO never
read) otherwise, so a scene with no volume is byte-identical.
Module Contents¶
Classes¶
Owns the SH-reduce compute + capture scratch; bakes IrradianceVolume3D grids. |
Data¶
API¶
- simvx.graphics.renderer.irradiance_volume_pass.__all__¶
[‘IrradianceVolumePass’]
- simvx.graphics.renderer.irradiance_volume_pass.log¶
‘getLogger(…)’
- simvx.graphics.renderer.irradiance_volume_pass.FACE_SIZE¶
32
- simvx.graphics.renderer.irradiance_volume_pass.SAMPLE_COUNT¶
256
- class simvx.graphics.renderer.irradiance_volume_pass.IrradianceVolumePass(engine: Any)[source]¶
Owns the SH-reduce compute + capture scratch; bakes IrradianceVolume3D grids.
Initialization
- update_volumes(cmd: Any, adapter: Any, tree: Any, volumes: list) bool[source]¶
Bake up to
update_budgetprobes of the active volume into cmd.Only the first volume in tree order is baked (single-volume support; multiple volumes are a later phase). Returns
Trueif a probe rendered this frame (the face render used the shared offscreen target).