Renders a depth-only shadow map from the scene's directional light. More...
#include <ShadowPass.h>
Public Member Functions | |
| FRAMEWORK_API void | Init () |
| Allocates the shadow map and associated GPU resources at the default resolution. | |
| FRAMEWORK_API void | Shutdown () |
| Releases all GPU resources owned by this pass. | |
| FRAMEWORK_API bool | Execute (Ref< Scene > scene, const std::vector< StaticMeshSubmission > &meshes) |
| Builds the light-space matrix and renders all opaque meshes into the shadow map. | |
| FRAMEWORK_API void | RequestResize (u32 newSize) |
| Schedules a shadow map resolution change for the next frame boundary. | |
| Ref< Image2D > | GetShadowMap () const |
| Returns the shadow depth map produced by this pass. | |
| Ref< UniformBuffer > | GetLightSpaceUBO () const |
| Returns the light-space matrix UBO consumed by GeometryPass. | |
| ShadowSettings & | GetSettings () |
| Returns a mutable reference to the shadow configuration. | |
| bool | ShouldRecreate () const |
Returns true if dependent passes must recreate resources this frame. | |
| void | ResetRecreateState () |
| Clears the recreate flag after dependent passes have been rebuilt. | |
| template<typename... Args> | |
| void | UpdateInput (Args &&... args) |
| Updates a named input binding and rebakes the render pass descriptor set. | |
Renders a depth-only shadow map from the scene's directional light.
The light-space matrix is derived from the directional light component's azimuth and elevation each frame. The resulting shadow map is consumed by GeometryPass for PCF shadow sampling.
Shadow map resolution can be changed at runtime via RequestResize; the actual GPU resource recreation is deferred to the next frame boundary and signalled to SceneRenderer via ShouldRecreate.
| bool Raven::ShadowPass::Execute | ( | Ref< Scene > | scene, |
| const std::vector< StaticMeshSubmission > & | meshes ) |
Builds the light-space matrix and renders all opaque meshes into the shadow map.
| scene | Active scene, queried for the directional light component. |
| meshes | Static mesh submissions to shadow-cast. |
true if a directional light was found and the pass executed; false otherwise.
|
inline |
Returns the light-space matrix UBO consumed by GeometryPass.
|
inline |
Returns a mutable reference to the shadow configuration.
Returns the shadow depth map produced by this pass.
| void Raven::ShadowPass::Init | ( | ) |
Allocates the shadow map and associated GPU resources at the default resolution.
| void Raven::ShadowPass::RequestResize | ( | u32 | newSize | ) |
Schedules a shadow map resolution change for the next frame boundary.
Sets ShouldRecreate to true so SceneRenderer can recreate dependent passes (e.g. GeometryPass) before Execute runs again.
| newSize | New shadow map resolution in pixels (square). |
|
inline |
Clears the recreate flag after dependent passes have been rebuilt.
|
inline |
Returns true if dependent passes must recreate resources this frame.
| void Raven::ShadowPass::Shutdown | ( | ) |
Releases all GPU resources owned by this pass.
|
inline |
Updates a named input binding and rebakes the render pass descriptor set.
| Args | Forwarded to RenderPass::SetInput. |