simvx.graphics.renderer.volumetric_fog_pass

Volumetric fog pass: single-scatter ray-marched fog (desktop Vulkan).

Full-screen HDR pass ported from the web volumetric_fog.wgsl shader. Reads the HDR colour + depth produced by the forward pass, ray-marches the WorldEnvironment-driven global fog (plus an exponential height gradient and any FogVolume3D instances collected from the scene tree), and writes the composited result to an alternate HDR target. The renderer then re-points the tonemap pass’s HDR input at that output: the same swap the custom post-process pass uses.

GPU-driven: the FogVolume3D set is packed into a single SSBO once per frame in numpy (build_volume_ssbo), never iterated in a per-object Python draw loop.

Module Contents

Classes

VolumetricFogPass

Ray-marched single-scatter volumetric fog over the HDR target.

Data

API

simvx.graphics.renderer.volumetric_fog_pass.__all__

[‘VolumetricFogPass’]

simvx.graphics.renderer.volumetric_fog_pass.log

‘getLogger(…)’

class simvx.graphics.renderer.volumetric_fog_pass.VolumetricFogPass(engine: Any)[source]

Ray-marched single-scatter volumetric fog over the HDR target.

Initialization

property output_view: Any[source]

Colour view of the fog-composited HDR result (tonemap input).

setup(width: int, height: int, hdr_view: Any, depth_view: Any, colour_format: int) None[source]

Allocate the alt HDR target, buffers, descriptors and pipeline.

update_hdr_input(hdr_view: Any, depth_view: Any) None[source]

Re-point binding 0/1 at a new HDR colour + depth (after resize).

set_frame_data(view: numpy.ndarray, proj: numpy.ndarray, sun_dir: numpy.ndarray | None, sun_colour: numpy.ndarray | None, sun_intensity: float, volumes: list[Any]) None[source]

Stash camera / sun / volume data for the next render call.

render(cmd: Any) None[source]

Composite volumetric fog into the alt HDR target. No-op when off.

resize(width: int, height: int, hdr_view: Any, depth_view: Any) None[source]
cleanup() None[source]