simvx.graphics.renderer.ibl_pass

Image-Based Lighting pass: compute shader pipeline for IBL map generation.

Generates three IBL textures from an environment cubemap:

  1. Irradiance cubemap (32x32): diffuse hemisphere convolution

  2. Prefiltered specular cubemap (128x128 with mip chain): GGX importance sampling

  3. BRDF integration LUT (512x512, RG16F): split-sum approximation

Module Contents

Classes

IBLPass

Compute-shader IBL processing: irradiance, prefiltered specular, and BRDF LUT.

Data

API

simvx.graphics.renderer.ibl_pass.__all__

[‘IBLPass’]

simvx.graphics.renderer.ibl_pass.log

‘getLogger(…)’

simvx.graphics.renderer.ibl_pass.IRRADIANCE_SIZE

32

simvx.graphics.renderer.ibl_pass.PREFILTER_SIZE

128

simvx.graphics.renderer.ibl_pass.PREFILTER_MIP_LEVELS

5

simvx.graphics.renderer.ibl_pass.BRDF_LUT_SIZE

512

class simvx.graphics.renderer.ibl_pass.IBLPass(engine: Any)

Compute-shader IBL processing: irradiance, prefiltered specular, and BRDF LUT.

Initialization

MAX_BUNDLES

None

__slots__

(‘_engine’, ‘_irradiance_pipeline’, ‘_irradiance_layout’, ‘_prefilter_pipeline’, ‘_prefilter_layout’…

setup() None

Create compute pipelines for all three IBL processing stages.

get_irradiance_view() Any

Return the irradiance cubemap image view.

get_prefiltered_view() Any

Return the prefiltered specular cubemap image view.

get_brdf_lut_view() Any

Return the BRDF LUT image view.

get_sampler() Any

Return the IBL sampler.

get_irradiance_image() Any

Return the irradiance cubemap image (for copy into a probe array).

get_prefiltered_image() Any

Return the prefiltered specular cubemap image (for copy into a probe array).

acquire_bundle(owner_id: int, frame_slot: int) dict[str, Any]

Return a per-(owner, frame-in-flight) descriptor bundle, allocated on first use.

owner_id is the caller’s bounded slot (reflection probes pass their array slot, 0..N-1), so the bundle set {(slot, frame_slot)} is bounded by MAX_BUNDLES regardless of probe churn: bundles are reused when a slot is reassigned (record_convolution rebinds the source cube each call), so the descriptor pool never leaks or exhausts. A distinct bundle per frame-in-flight ensures a probe re-convolved on consecutive frames never updates a set still in use by the previous in-flight frame.

process_cubemap(cubemap_view: Any, cubemap_sampler: Any) None

Run all IBL processing on the given environment cubemap (one-shot).

Submits + waits on its own command buffer. Used by the skybox install path; reflection probes use :meth:record_convolution to record into the primary frame cmd instead.

The BRDF LUT is dispatched on the FIRST cubemap this pass processes and never again. It is the split-sum integral of the BRDF over roughness and view angle, so it depends on the shading model and on nothing about the environment: re-integrating it for each new sky produced the same 512 square texture every time. A pass installing a sky on every frame, which an animated gradient sky does, paid for it on every frame.

record_convolution(cmd: Any, cubemap_view: Any, cubemap_sampler: Any, bundle: dict[str, Any] | None = None, *, with_brdf: bool = False) None

Record the irradiance + prefilter convolution of cubemap_view into cmd.

No submit, no wait: the caller owns the command buffer (the primary frame cmd for probes). Reads from the given per-owner bundle so concurrent probe convolutions in one cmd never share a descriptor set. Leaves the irradiance + prefilter output images in SHADER_READ_ONLY_OPTIMAL ready for the per-probe array copy. with_brdf also (re)generates the shared BRDF LUT (only needed for the one-shot skybox path).

cleanup() None

Destroy all GPU resources owned by the IBL pass.