simvx.graphics.renderer.ssao_pass¶
Screen-Space Ambient Occlusion (SSAO) pass: compute-based AO from depth buffer.
Module Contents¶
Classes¶
Compute-based SSAO: generates ambient occlusion from depth buffer. |
Data¶
API¶
- simvx.graphics.renderer.ssao_pass.__all__¶
[‘SSAOPass’]
- simvx.graphics.renderer.ssao_pass.log¶
‘getLogger(…)’
- simvx.graphics.renderer.ssao_pass.KERNEL_SIZE¶
32
- class simvx.graphics.renderer.ssao_pass.SSAOPass(engine: Any)[source]¶
Compute-based SSAO: generates ambient occlusion from depth buffer.
Pipeline: depth -> SSAO generation (compute) -> box blur (compute) -> R8 AO texture. Operates at half resolution for performance. The blurred AO texture can be sampled in the tonemap/post-process pass to darken ambient lighting in crevices.
Kernel samples are stored in a UBO (binding 3) to stay within push constant limits.
Initialization
- setup(width: int, height: int, depth_view: Any, depth_image: Any = None, normal_view: Any = None, normal_image: Any = None) None[source]¶
Initialize SSAO resources: noise texture, AO images, kernel, compute pipelines.
When normal_view is supplied (thin G-buffer active, A9), binding 4 samples the real shading normals instead of reconstructing them from depth.
- render(cmd: Any, proj_matrix: numpy.ndarray, view_matrix: numpy.ndarray | None = None) None[source]¶
Dispatch SSAO compute + blur. Call between HDR pass end and tonemap.
Args: cmd: Active command buffer (outside any render pass). proj_matrix: Camera projection matrix (row-major numpy, transposed for GPU). view_matrix: Camera view matrix (row-major); rotates the thin G-buffer’s world normals into view space. Only read when the G-buffer path is active; falls back to identity when omitted.