simvx.graphics.renderer.passes¶
Shared render pass definitions.
Module Contents¶
Functions¶
Create a render pass with colour and optional depth attachment. |
|
Create a render pass for offscreen rendering (colour -> SHADER_READ_ONLY). |
|
Create a colour-only render pass that loads existing content (no clear). |
|
Colour + depth LOAD render pass for the scene-read pass split. |
|
Create a depth-only render pass for shadow mapping. |
|
Create the picking render pass (R32_UINT colour + optional depth). |
Data¶
API¶
- simvx.graphics.renderer.passes.__all__¶
[‘create_render_pass’, ‘create_offscreen_pass’, ‘create_overlay_pass’, ‘create_hdr_reload_pass’, ‘cr…
- simvx.graphics.renderer.passes.log¶
‘getLogger(…)’
- simvx.graphics.renderer.passes.create_render_pass(device: Any, colour_format: int, depth_format: int = 0) Any[source]¶
Create a render pass with colour and optional depth attachment.
- simvx.graphics.renderer.passes.create_offscreen_pass(device: Any, colour_format: int, depth_format: int = vk.VK_FORMAT_D32_SFLOAT, *, samplable_depth: bool = False, gbuffer_format: int = 0) Any[source]¶
Create a render pass for offscreen rendering (colour -> SHADER_READ_ONLY).
When samplable_depth is True, the depth attachment transitions to SHADER_READ_ONLY_OPTIMAL so it can be sampled in a later pass (e.g. motion blur).
When gbuffer_format is non-zero, a second colour attachment (the thin G-buffer) is added between the scene colour and depth. It clears and stores like the scene colour and ends in SHADER_READ_ONLY so a later compute/fragment pass can sample it. Attachment indices become colour=0, gbuffer=1, depth=2; with no G-buffer they stay colour=0, depth=1 (byte-identical to the historical pass).
- simvx.graphics.renderer.passes.create_overlay_pass(device: Any, colour_format: int) Any[source]¶
Create a colour-only render pass that loads existing content (no clear).
Used for drawing 2D overlays on top of a previously rendered target. Colour attachment uses LOAD_OP_LOAD and transitions to SHADER_READ_ONLY. No depth attachment.
- simvx.graphics.renderer.passes.create_hdr_reload_pass(device: Any, colour_format: int, depth_format: int = vk.VK_FORMAT_D32_SFLOAT, *, gbuffer_format: int = 0) Any[source]¶
Colour + depth LOAD render pass for the scene-read pass split.
After the opaque family draws, the forward renderer ends the HDR pass, copies the HDR colour + depth into sampleable scene textures, then re-begins with THIS pass to draw the transparent phase. Both attachments load their existing content (opaque colour + depth) rather than clearing, so transparent geometry blends over the opaque scene and depth-tests against it. The final layouts match the offscreen HDR pass (colour -> SHADER_READ_ONLY for tonemap, depth -> DEPTH_STENCIL_READ_ONLY for the velocity / SSAO samplers), so downstream passes are byte-identical to the non-split path.
When gbuffer_format is set (thin G-buffer), the second colour attachment is LOADED too (the opaque normal target is preserved; the transparent phase masks its writes to it), keeping this pass render-pass- compatible with the 2-attachment forward pipelines.