Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::Prepass Class Reference

Depth and view-space normals prepass. More...

#include <Prepass.h>

Public Member Functions

FRAMEWORK_API void Init (u32 width, u32 height, Ref< UniformBuffer > cameraUBO)
 Creates the depth and normals images, framebuffer, pipeline, and render pass.
FRAMEWORK_API void Shutdown ()
 Releases all GPU resources owned by this pass.
FRAMEWORK_API void Execute (const std::vector< StaticMeshSubmission > &meshes, const Crux::Frustum &frustum)
 Frustum-culls and renders all mesh submissions into the depth and normals targets.
Ref< Image2DGetDepthImage () const
 Returns the depth image written by this pass.
Ref< Image2DGetNormalImage () const
 Returns the view-space normals image written by this pass.
template<typename... Args>
void UpdateInput (Args &&... args)
 Updates a named input binding and rebakes the render pass descriptor set.

Detailed Description

Depth and view-space normals prepass.

Renders all opaque geometry with a minimal vertex-only shader to populate:

Must execute before any pass that reads depth or normals.

Member Function Documentation

◆ Execute()

void Raven::Prepass::Execute ( const std::vector< StaticMeshSubmission > & meshes,
const Crux::Frustum & frustum )

Frustum-culls and renders all mesh submissions into the depth and normals targets.

Parameters
meshesStatic mesh submissions gathered by the scene this frame.
frustumCamera frustum used to cull out-of-view meshes.

◆ GetDepthImage()

Ref< Image2D > Raven::Prepass::GetDepthImage ( ) const
inline

Returns the depth image written by this pass.

Returns
Full-resolution DEPTH32F image in DepthStencilAttachment layout after Execute.

◆ GetNormalImage()

Ref< Image2D > Raven::Prepass::GetNormalImage ( ) const
inline

Returns the view-space normals image written by this pass.

Returns
Full-resolution RGBA16F normals image after Execute.

◆ Init()

void Raven::Prepass::Init ( u32 width,
u32 height,
Ref< UniformBuffer > cameraUBO )

Creates the depth and normals images, framebuffer, pipeline, and render pass.

Parameters
widthRender target width in pixels.
heightRender target height in pixels.
cameraUBOShared camera UBO providing the view-projection matrix.

◆ Shutdown()

void Raven::Prepass::Shutdown ( )

Releases all GPU resources owned by this pass.

◆ UpdateInput()

template<typename... Args>
void Raven::Prepass::UpdateInput ( Args &&... args)
inline

Updates a named input binding and rebakes the render pass descriptor set.

Template Parameters
ArgsForwarded to RenderPass::SetInput.

The documentation for this class was generated from the following files: