Forward+ tile-based light culling compute pass. More...
#include <LightCullPass.h>
Public Member Functions | |
| FRAMEWORK_API void | Init (u32 width, u32 height, Ref< StorageBuffer > lightSSBO, Ref< Image2D > depthImage) |
| Allocates the tile light list SSBO and initialises the compute pass. | |
| FRAMEWORK_API void | Shutdown () |
| Releases all GPU resources owned by this pass. | |
| FRAMEWORK_API void | Execute (const Crux::mat4 &view, const Crux::mat4 &projection, u32 width, u32 height) |
| Uploads cull settings and dispatches the compute shader. | |
| Ref< StorageBuffer > | GetTileLightList () const |
| Returns the per-tile light index list SSBO written by Execute. | |
| bool | ShouldRecreateResources () const |
Returns true if the tile count changed this frame and dependent passes must be rebuilt. | |
| u32 | GetTileCountX () const |
| Returns the number of tiles along the X axis for the current resolution. | |
| u32 | GetTileCountY () const |
| Returns the number of tiles along the Y axis for the current resolution. | |
Forward+ tile-based light culling compute pass.
Divides the screen into FORWARD_PLUS_TILE_SIZE × FORWARD_PLUS_TILE_SIZE pixel tiles and, for each tile, determines which of the scene's point lights overlap its depth range. The resulting per-tile light index lists are written to GetTileLightList and consumed by GeometryPass.
Must execute after Prepass and before GeometryPass.
| void Raven::LightCullPass::Execute | ( | const Crux::mat4 & | view, |
| const Crux::mat4 & | projection, | ||
| u32 | width, | ||
| u32 | height ) |
Uploads cull settings and dispatches the compute shader.
Must be called after Prepass::Execute and before GeometryPass::Execute. If the screen resolution has changed, signals ShouldRecreateResources so that SceneRenderer can rebuild dependent passes.
|
inline |
Returns the number of tiles along the X axis for the current resolution.
|
inline |
Returns the number of tiles along the Y axis for the current resolution.
|
inline |
Returns the per-tile light index list SSBO written by Execute.
| void Raven::LightCullPass::Init | ( | u32 | width, |
| u32 | height, | ||
| Ref< StorageBuffer > | lightSSBO, | ||
| Ref< Image2D > | depthImage ) |
Allocates the tile light list SSBO and initialises the compute pass.
| width | Render target width in pixels. |
| height | Render target height in pixels. |
| lightSSBO | LightEnvironment SSBO built by the scene each frame. |
| depthImage | Depth prepass output image (DEPTH32F, ShaderRead layout). |
|
inline |
Returns true if the tile count changed this frame and dependent passes must be rebuilt.
| void Raven::LightCullPass::Shutdown | ( | ) |
Releases all GPU resources owned by this pass.