simvx.graphics.renderer.hiz_pass¶
Hi-Z depth pyramid build pass (occlusion-culling phase O2).
Builds a hierarchical depth pyramid from the HDR target’s D32 depth buffer: mip0 is a 1:1 copy of the scene depth, and each successive mip is a conservative MAX reduction (farthest occluder, standard 0..1 depth) over the previous mip’s 2x2 footprint. The pyramid is consumed later (O3) by a compute occlusion cull; this phase only builds and validates it.
The pass is fully gated by Renderer._occlusion_culling_enabled: it is
lazily created on the first frame the toggle is on (mirroring VelocityPass),
so with occlusion off nothing here is allocated or dispatched.
Resource/descriptor approach mirrors :class:SSAOPass: a compute pass that
samples the samplable D32 depth target in DEPTH_STENCIL_READ_ONLY_OPTIMAL.
Module Contents¶
Classes¶
Builds a Hi-Z (hierarchical max-depth) pyramid via per-mip compute dispatches. |
Functions¶
Number of mip levels in the Hi-Z pyramid for the given base extent. |
|
Per-mip |
Data¶
API¶
- simvx.graphics.renderer.hiz_pass.__all__¶
[‘HiZPass’, ‘hiz_mip_count’, ‘hiz_mip_sizes’]
- simvx.graphics.renderer.hiz_pass.log¶
‘getLogger(…)’
- simvx.graphics.renderer.hiz_pass.hiz_mip_count(width: int, height: int) int[source]¶
Number of mip levels in the Hi-Z pyramid for the given base extent.
floor(log2(max(w, h))) + 1so the top mip is 1x1.
- simvx.graphics.renderer.hiz_pass.hiz_mip_sizes(width: int, height: int) list[tuple[int, int]][source]¶
Per-mip
(w, h)dimensions, each(max(1, w>>i), max(1, h>>i)).
- class simvx.graphics.renderer.hiz_pass.HiZPass(engine: Any)[source]¶
Builds a Hi-Z (hierarchical max-depth) pyramid via per-mip compute dispatches.
Initialization
- property sampled_view: Any[source]¶
Full-mip-chain sampled view (for the O3 occlusion cull’s textureLod).
- setup(width: int, height: int, depth_view: Any, depth_image: Any) None[source]¶
Allocate the pyramid image, per-mip views, sampler, descriptors and pipeline.
- render(cmd: Any) None[source]¶
Build the full pyramid: dispatch the reduction once per mip.
Call after the HDR pass has produced depth (depth in DEPTH_STENCIL_READ_ONLY_OPTIMAL). A pure depth reduction: no camera matrices.