simvx.graphics.renderer.light_cull_pass¶
Forward+ tiled light culling via compute shader.
Dispatches a compute shader that assigns lights to 16x16 screen-space tiles using depth-aware frustum culling. The output buffers (light index list and per-tile offset/count) are bound to the fragment shader so it can loop over only the lights relevant to each pixel’s tile.
Module Contents¶
Classes¶
GPU tiled light culling for Forward+ rendering. |
Data¶
API¶
- simvx.graphics.renderer.light_cull_pass.__all__¶
[‘LightCullPass’]
- class simvx.graphics.renderer.light_cull_pass.LightCullPass(engine: Any)[source]¶
Bases:
simvx.graphics.renderer.render_pass.RenderPassGPU tiled light culling for Forward+ rendering.
Creates a compute pipeline that reads a depth texture and light SSBO, then outputs per-tile light index lists consumed by the fragment shader.
Initialization
- name¶
‘light_cull’
- stage¶
‘pre_render’
- inputs¶
()
- outputs¶
(‘light_tiles’,)
- setup(width: int, height: int, max_lights: int = 256) None[source]¶
Create compute pipeline, SSBOs, and descriptor set.
Args: width: Viewport width in pixels. height: Viewport height in pixels. max_lights: Maximum number of lights in the scene.
- update_descriptors(depth_view: Any, light_ssbo: Any, light_ssbo_size: int) None[source]¶
Update depth texture and light SSBO descriptors.
Called when the depth view or light buffer changes (e.g. on resize).
- record(cmd: Any, frame: simvx.graphics.renderer.render_pass.FrameContext) None[source]¶
RenderPass interface — delegates to _dispatch_impl with frame data.
- property ready: bool¶
- property tile_buffer: Any¶
Tile SSBO handle for binding in fragment shader descriptors.
- property tile_buffer_size: int¶
- property light_index_buffer: Any¶
Light index SSBO handle for binding in fragment shader descriptors.
- property light_index_buffer_size: int¶
- property grid_dims: tuple[int, int]¶
- resize(width: int, height: int) None[source]¶
Handle viewport resize — recreate tile/index buffers if grid changed.
- __slots__¶
()
- enabled: bool¶
True