simvx.graphics.renderer.ssr_pass

Screen-space reflections pass (design D7, RM-E4).

Hi-Z traced, half-resolution SSR that writes reflected radiance to the design-D8 indirect-specular hook (set0 b16) so it never edits the uber shading math. Each frame, after the HDR pass:

  1. the HDR colour is copied into a small mip chain (A12 mipgen) so the trace can read a roughness-blurred reflection;

  2. a MIN-Z depth pyramid is built with the :class:HiZPass machinery (ssr_hiz.comp) for conservative empty-space skipping;

  3. a compute trace (ssr_trace.comp) marches the reflected view ray through screen space, reading the thin G-buffer (A9: world normal + roughness) and the pyramid, and writes the reflected colour (with screen-edge + distance fade) to a half-res RGBA16F target.

The uber shader samples that target at b16 and applies the Fresnel weight; a ray miss writes 0 there so the probe/IBL/flat ambient (D8 fallback) is untouched. Because the trace reads the HDR colour produced by the forward pass, the reflection is one frame late; it converges within a couple of frames for a static view (the golden captures a settled frame).

Zero-cost when unused: the whole pass is lazily created the first frame SSR is active (mirroring SSAO/velocity), and the uber’s indirect_specular_enabled gate stays 0 otherwise, so b16 is never sampled and feature-off frames are byte-identical.

Module Contents

Classes

SSRPass

Half-res Hi-Z screen-space reflections into the D8 indirect-specular hook.

Data

API

simvx.graphics.renderer.ssr_pass.__all__

[‘SSRPass’]

simvx.graphics.renderer.ssr_pass.log

‘getLogger(…)’

class simvx.graphics.renderer.ssr_pass.SSRPass(engine: Any)[source]

Half-res Hi-Z screen-space reflections into the D8 indirect-specular hook.

Initialization

property output_view: Any[source]

The half-res reflection target view (bound to set0 b16 by the renderer).

property output_sampler: Any[source]

Linear/clamp sampler for reading the reflection target at b16.

setup(width: int, height: int, hdr_colour_image: Any, depth_view: Any, depth_image: Any, gbuffer_view: Any, gbuffer_image: Any = None) None[source]

Allocate the pyramid, scene-colour mip chain, output target and pipeline.

render(cmd: Any, proj_matrix: numpy.ndarray, view_matrix: numpy.ndarray) None[source]

Copy scene colour, build the min-Z pyramid, and trace reflections.

Call after end_hdr_pass (HDR colour SHADER_READ, depth DEPTH_RO, gbuffer SHADER_READ), outside any render pass.

resize(width: int, height: int, hdr_colour_image: Any, depth_view: Any, depth_image: Any, gbuffer_view: Any, gbuffer_image: Any = None) None[source]

Recreate the scene chain + output + pyramid for a new internal extent.

set_gbuffer(gbuffer_view: Any, gbuffer_image: Any) None[source]

Re-point the G-buffer inputs (after a G-buffer toggle rebuild).

cleanup() None[source]