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

Horizon-Based Ambient Occlusion (HBAO) screen-space pass. More...

#include <AmbientOcclusionPass.h>

Public Member Functions

FRAMEWORK_API void Init (u32 width, u32 height, Ref< Image2D > depth, Ref< Image2D > normals, Ref< UniformBuffer > cameraUBO)
 Allocates the AO image, framebuffer, pipeline, and settings UBO.
FRAMEWORK_API void Shutdown ()
 Releases all GPU resources owned by this pass.
FRAMEWORK_API void Execute ()
 Renders the fullscreen HBAO quad and writes the result to the AO image.
Ref< Image2DGetAOImage () const
 Returns the single-channel AO image written by Execute.
HBAOSettingsGetSettings ()
 Returns a mutable reference to the HBAO configuration.
void ApplySettings ()
 Immediately uploads the current HBAOSettings to the GPU UBO.

Detailed Description

Horizon-Based Ambient Occlusion (HBAO) screen-space pass.

Samples the depth and view-space normals buffers produced by Prepass to compute per-pixel horizon-based occlusion. The resulting single-channel AO image is consumed by GeometryPass to attenuate the ambient IBL term.

Must execute after Prepass and before GeometryPass. Only runs when RendererFeatures::EnableAO is true.

Member Function Documentation

◆ ApplySettings()

void Raven::AmbientOcclusionPass::ApplySettings ( )
inline

Immediately uploads the current HBAOSettings to the GPU UBO.

Call after modifying GetSettings if the change should take effect before the next Execute.

◆ Execute()

void Raven::AmbientOcclusionPass::Execute ( )

Renders the fullscreen HBAO quad and writes the result to the AO image.

Uploads the current HBAOSettings before dispatching. The caller should call ApplySettings if settings were changed this frame.

◆ GetAOImage()

Ref< Image2D > Raven::AmbientOcclusionPass::GetAOImage ( ) const
inline

Returns the single-channel AO image written by Execute.

Returns
R8 AO image consumed by GeometryPass.

◆ GetSettings()

HBAOSettings & Raven::AmbientOcclusionPass::GetSettings ( )
inline

Returns a mutable reference to the HBAO configuration.

◆ Init()

void Raven::AmbientOcclusionPass::Init ( u32 width,
u32 height,
Ref< Image2D > depth,
Ref< Image2D > normals,
Ref< UniformBuffer > cameraUBO )

Allocates the AO image, framebuffer, pipeline, and settings UBO.

Parameters
widthRender target width in pixels.
heightRender target height in pixels.
depthDepth image from Prepass (DEPTH32F, ShaderRead layout).
normalsView-space normals image from Prepass.
cameraUBOShared camera UBO providing the projection matrix and inverse.

◆ Shutdown()

void Raven::AmbientOcclusionPass::Shutdown ( )

Releases all GPU resources owned by this pass.


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