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

Convolves an environment cubemap into a diffuse irradiance map for IBL. More...

#include <IrradiancePass.h>

Public Member Functions

FRAMEWORK_API void Init ()
 Allocates the irradiance cubemap, per-face framebuffers, pipeline, and quad geometry.
FRAMEWORK_API void Shutdown ()
 Releases all GPU resources owned by this pass.
FRAMEWORK_API void BakeIrradianceMap (Ref< TextureCube > activeCubemap)
 Convolves activeCubemap and writes the result into the internal irradiance map.
Ref< PipelineGetPipeline ()
 Returns the convolution pipeline.
Ref< TextureCubeGetIrradianceMap ()
 Returns the irradiance cubemap produced by the most recent BakeIrradianceMap call.

Detailed Description

Convolves an environment cubemap into a diffuse irradiance map for IBL.

Renders a fullscreen quad into each of the six faces of a cubemap using a hemisphere-integration convolution shader. The resulting irradiance map is consumed by GeometryPass for the ambient IBL lighting term.

BakeIrradianceMap is called by SceneRenderer whenever the active environment cubemap changes (e.g. when a SkylightComponent assigns a new texture). The bake is synchronous with respect to the GPU frame boundary.

Member Function Documentation

◆ BakeIrradianceMap()

void Raven::IrradiancePass::BakeIrradianceMap ( Ref< TextureCube > activeCubemap)

Convolves activeCubemap and writes the result into the internal irradiance map.

Renders all six cubemap faces. Skips re-baking if the same cubemap is passed consecutively (tracked by the m_IrradianceBaked flag).

Parameters
activeCubemapSource environment cubemap to convolve.

◆ GetIrradianceMap()

Ref< TextureCube > Raven::IrradiancePass::GetIrradianceMap ( )
inline

Returns the irradiance cubemap produced by the most recent BakeIrradianceMap call.

Returns
Diffuse irradiance cubemap consumed by GeometryPass.

◆ GetPipeline()

Ref< Pipeline > Raven::IrradiancePass::GetPipeline ( )
inline

Returns the convolution pipeline.

◆ Init()

void Raven::IrradiancePass::Init ( )

Allocates the irradiance cubemap, per-face framebuffers, pipeline, and quad geometry.

◆ Shutdown()

void Raven::IrradiancePass::Shutdown ( )

Releases all GPU resources owned by this pass.


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