simvx.graphics.renderer.post_process¶
Post-processing pass: HDR tone mapping, FXAA, bloom, DoF, motion blur, film grain, vignette, chromatic aberration.
Module Contents¶
Classes¶
Renders HDR scene to offscreen target, then tone-maps to swapchain. |
Data¶
API¶
- simvx.graphics.renderer.post_process.__all__¶
[‘PostProcessPass’]
- simvx.graphics.renderer.post_process.log¶
‘getLogger(…)’
- simvx.graphics.renderer.post_process.FLAG_FXAA¶
None
- simvx.graphics.renderer.post_process.FLAG_BLOOM¶
None
- simvx.graphics.renderer.post_process.FLAG_SSAO¶
None
- simvx.graphics.renderer.post_process.FLAG_DOF¶
None
- simvx.graphics.renderer.post_process.FLAG_GRAIN¶
None
- simvx.graphics.renderer.post_process.FLAG_VIGNETTE¶
None
- simvx.graphics.renderer.post_process.FLAG_CHROMATIC¶
None
- simvx.graphics.renderer.post_process.FLAG_MOTION_BLUR¶
None
- simvx.graphics.renderer.post_process.FLAG_VOLUMETRIC_FOG¶
None
- simvx.graphics.renderer.post_process.FLAG_LUT¶
None
- simvx.graphics.renderer.post_process.FLAG_CRT¶
None
- simvx.graphics.renderer.post_process.FLAG_PIXELATE¶
None
- simvx.graphics.renderer.post_process.FLAG_BLUR¶
None
- class simvx.graphics.renderer.post_process.PostProcessPass(engine: Any)[source]¶
Renders HDR scene to offscreen target, then tone-maps to swapchain.
The pass owns an HDR render target. When enabled:
3D scene renders to the HDR target (pre_render phase)
Bloom extraction + blur (optional)
Tone mapping + FXAA + cinematic effects renders to swapchain (main render pass)
Initialization
- property hdr_target: simvx.graphics.renderer.render_target.RenderTarget | None[source]¶
- update_ssao_descriptor(ao_view: Any) None[source]¶
Update binding 4 with the SSAO output image view.
- register_lut(tex_id: int, lut_data: numpy.ndarray) None[source]¶
Upload a 3D colour-grading LUT and register it under
tex_id.lut_datais an(size, size, size, 4)uint8 array (the format produced bycolour_grading.generate_*_lut), uploaded as a 3Drgba8image: byte-for-byte the web runtime’s LUT representation. Re-registering an id replaces the previous texture. Select the active LUT withlut_tex_id.
- update_motion_blur_matrices(view: numpy.ndarray, proj: numpy.ndarray) None[source]¶
Update the motion blur UBO with current inverse VP and previous VP.
Call once per frame before render_tonemap() with the current camera matrices. Uses temporal smoothing to prevent sudden jumps from frame time variance.
- next_taa_jitter(width: float, height: float) tuple[float, float][source]¶
Advance the Halton jitter index and return this frame’s sub-pixel offset.
Called once per frame (only when
taa_enabled) before the forward draw. The renderer applies the returned offset to the forward-draw projection via :func:simvx.core.math.apply_jitter, while leaving the unjitteredcamera_projintact for culling and motion-vector reprojection. The jitter is stored so :meth:taa_jittercan hand it to the resolve pass.width/heightare the render extent; the offset is in pixels.
- update_taa_matrices(view: numpy.ndarray, proj: numpy.ndarray) None[source]¶
Capture the unjittered current/previous view-projection for TAA resolve.
Call once per frame (only when
taa_enabled) with the clean (unjittered) camera matrices, before the forward pass jitters its own projection copy. Stores the current VP, its inverse, and rolls the previous-frame VP so the future resolve pass can reconstruct each pixel’s world position from depth and reproject it through the previous VP (camera + static-geometry motion).Independent of motion blur so TAA functions whether or not motion blur is enabled. On the first frame
prev_vp == cur_vpto avoid a velocity spike.
- property taa_jitter: tuple[float, float][source]¶
This frame’s applied sub-pixel jitter (pixels); for un-jittering in resolve.
- property taa_inv_vp: numpy.ndarray[source]¶
Inverse of the unjittered current VP (depth->world for resolve).
- property taa_depth_view: Any[source]¶
HDR target’s samplable depth view: the resolve pass’s reprojection source.
- rebegin_hdr_pass(cmd: Any) None[source]¶
Re-begin the HDR pass with the colour+depth LOAD variant.
Used by the scene-read pass split: after
end_hdr_passand the scene colour/depth copy, this loads the opaque colour + depth (no clear) so the transparent phase blends over the scene and depth-tests against it.