galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::graphics::PostProcess Class Referencefinal

Manages post processing effects to apply to combined scene. More...

#include <PostProcess.hpp>

+ Collaboration diagram for galaxy::graphics::PostProcess:

Public Member Functions

 PostProcess ()
 Constructor.
 
 ~PostProcess ()
 Destructor.
 
void init (const int width, const int height)
 Initialize post processor and GL buffers.
 
void destroy ()
 Cleanup used memory.
 
template<is_posteffect Effect, typename... Args>
Effect * add (Args &&... args)
 Add an effect to process.
 
void bind ()
 Bind to draw to post processor framebuffer.
 
void unbind ()
 Unbind to draw to post processor framebuffer.
 
void render_effects ()
 Draw post effects to stored framebuffer.
 
void render_output ()
 Draw finished post effects to default framebuffer (screen).
 
void resize (const int width, const int height)
 Resize framebuffers.
 

Private Attributes

RenderTexture m_fb
 For geometry and lighting.
 
Shader m_output
 Simple output shader.
 
meta::vector< std::unique_ptr< graphics::PostEffect > > m_effects
 List of effects to apply in order.
 
unsigned int m_screen_vbo
 Simple quad to draw when applying effects (buffer).
 
unsigned int m_screen_vao
 Simple quad to draw when applying effects (array).
 
unsigned int m_output_fb
 Output cache.
 

Detailed Description

Manages post processing effects to apply to combined scene.

Definition at line 26 of file PostProcess.hpp.

Constructor & Destructor Documentation

◆ PostProcess()

galaxy::graphics::PostProcess::PostProcess ( )

Constructor.

Definition at line 49 of file PostProcess.cpp.

◆ ~PostProcess()

galaxy::graphics::PostProcess::~PostProcess ( )

Destructor.

Definition at line 56 of file PostProcess.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ init()

void galaxy::graphics::PostProcess::init ( const int width,
const int height )

Initialize post processor and GL buffers.

Parameters
widthWidth of internal framebuffer.
heightHeight of internal framebuffer.

Definition at line 61 of file PostProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

void galaxy::graphics::PostProcess::destroy ( )

Cleanup used memory.

Definition at line 100 of file PostProcess.cpp.

+ Here is the caller graph for this function:

◆ add()

template<is_posteffect Effect, typename... Args>
Effect * galaxy::graphics::PostProcess::add ( Args &&... args)
inline

Add an effect to process.

Template Parameters
EffectPost-Processing Effect to use.
ArgsVariadic Arguments.

Make sure the effects are in the correct order. They are rendered in the order they are added.

Parameters
argsConstructor arguments.
Returns
Weak pointer to newly created effect.

Definition at line 130 of file PostProcess.hpp.

+ Here is the caller graph for this function:

◆ bind()

void galaxy::graphics::PostProcess::bind ( )

Bind to draw to post processor framebuffer.

Definition at line 129 of file PostProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unbind()

void galaxy::graphics::PostProcess::unbind ( )

Unbind to draw to post processor framebuffer.

Definition at line 134 of file PostProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render_effects()

void galaxy::graphics::PostProcess::render_effects ( )

Draw post effects to stored framebuffer.

Definition at line 139 of file PostProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ render_output()

void galaxy::graphics::PostProcess::render_output ( )

Draw finished post effects to default framebuffer (screen).

Definition at line 155 of file PostProcess.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resize()

void galaxy::graphics::PostProcess::resize ( const int width,
const int height )

Resize framebuffers.

Parameters
widthNew width of internal framebuffer.
heightNew height of internal framebuffer.

Definition at line 119 of file PostProcess.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_fb

RenderTexture galaxy::graphics::PostProcess::m_fb
private

For geometry and lighting.

Definition at line 101 of file PostProcess.hpp.

◆ m_output

Shader galaxy::graphics::PostProcess::m_output
private

Simple output shader.

Definition at line 106 of file PostProcess.hpp.

◆ m_effects

meta::vector<std::unique_ptr<graphics::PostEffect> > galaxy::graphics::PostProcess::m_effects
private

List of effects to apply in order.

Definition at line 111 of file PostProcess.hpp.

◆ m_screen_vbo

unsigned int galaxy::graphics::PostProcess::m_screen_vbo
private

Simple quad to draw when applying effects (buffer).

Definition at line 116 of file PostProcess.hpp.

◆ m_screen_vao

unsigned int galaxy::graphics::PostProcess::m_screen_vao
private

Simple quad to draw when applying effects (array).

Definition at line 121 of file PostProcess.hpp.

◆ m_output_fb

unsigned int galaxy::graphics::PostProcess::m_output_fb
private

Output cache.

Definition at line 126 of file PostProcess.hpp.


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