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::ChromaticAberration Class Referencefinal

Chromatic Aberration pass. More...

#include <ChromaticAberration.hpp>

+ Inheritance diagram for galaxy::graphics::ChromaticAberration:
+ Collaboration diagram for galaxy::graphics::ChromaticAberration:

Public Member Functions

 ChromaticAberration (const int width, const int height)
 Argument constructor.
 
virtual ~ChromaticAberration ()=default
 Destructor.
 
void resize (const int width, const int height) override
 Resize framebuffers.
 
unsigned int render (const unsigned int input) override
 Render effect to input texture.
 
void set_r_offset (const float r)
 Set chromatic r offset.
 
void set_g_offset (const float g)
 Set chromatic r offset.
 
void set_b_offset (const float b)
 Set chromatic r offset.
 
void set_rgb_offset (const float r, const float g, const float b)
 Set chromatic rgb offset.
 
bool is_enabled () override
 Is this effect enabled?
 
- Public Member Functions inherited from galaxy::graphics::PostEffect
virtual ~PostEffect ()=default
 Destructor.
 

Private Member Functions

 ChromaticAberration ()=delete
 Constructor.
 

Private Attributes

Shader m_shader
 Shader for post processing effect.
 
RenderTexture m_fb
 Framebuffer to render aberration.
 
float m_r_offset
 Effect r colour offset.
 
float m_g_offset
 Effect g colour offset.
 
float m_b_offset
 Effect b colour offset.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::graphics::PostEffect
 PostEffect ()=default
 Constructor.
 
 PostEffect (const PostEffect &)=default
 Copy constructor.
 
 PostEffect (PostEffect &&)=default
 Move constructor.
 
PostEffectoperator= (const PostEffect &)=default
 Copy assignment operator.
 
PostEffectoperator= (PostEffect &&)=default
 Move assignment operator.
 

Detailed Description

Chromatic Aberration pass.

Run after Anti-Aliasing.

Definition at line 24 of file ChromaticAberration.hpp.

Constructor & Destructor Documentation

◆ ChromaticAberration() [1/2]

galaxy::graphics::ChromaticAberration::ChromaticAberration ( const int width,
const int height )

Argument constructor.

Parameters
widthWidth of internal framebuffer.
heightHeight of internal framebuffer.

Definition at line 89 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ ~ChromaticAberration()

virtual galaxy::graphics::ChromaticAberration::~ChromaticAberration ( )
virtualdefault

Destructor.

◆ ChromaticAberration() [2/2]

galaxy::graphics::ChromaticAberration::ChromaticAberration ( )
privatedelete

Constructor.

Member Function Documentation

◆ resize()

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

Resize framebuffers.

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

Implements galaxy::graphics::PostEffect.

Definition at line 105 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ render()

unsigned int galaxy::graphics::ChromaticAberration::render ( const unsigned int input)
nodiscardoverridevirtual

Render effect to input texture.

Parameters
inputInput texture from previous effect or window framebuffer.
Returns
Returns output texture for next effect or final framebuffer.

Implements galaxy::graphics::PostEffect.

Definition at line 110 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ set_r_offset()

void galaxy::graphics::ChromaticAberration::set_r_offset ( const float r)

Set chromatic r offset.

Parameters
r-1.0f to 1.0f. Red.

Definition at line 122 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ set_g_offset()

void galaxy::graphics::ChromaticAberration::set_g_offset ( const float g)

Set chromatic r offset.

Parameters
g-1.0f to 1.0f. Green.

Definition at line 128 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ set_b_offset()

void galaxy::graphics::ChromaticAberration::set_b_offset ( const float b)

Set chromatic r offset.

Parameters
b-1.0f to 1.0f. Blue.

Definition at line 134 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ set_rgb_offset()

void galaxy::graphics::ChromaticAberration::set_rgb_offset ( const float r,
const float g,
const float b )

Set chromatic rgb offset.

Parameters
r-1.0f to 1.0f. Red.
g-1.0f to 1.0f. Green.
b-1.0f to 1.0f. Blue.

Definition at line 140 of file ChromaticAberration.cpp.

+ Here is the call graph for this function:

◆ is_enabled()

bool galaxy::graphics::ChromaticAberration::is_enabled ( )
nodiscardoverridevirtual

Is this effect enabled?

Returns
True if effect is enabled. Otherwise false.

Implements galaxy::graphics::PostEffect.

Definition at line 149 of file ChromaticAberration.cpp.

Member Data Documentation

◆ m_shader

Shader galaxy::graphics::ChromaticAberration::m_shader
private

Shader for post processing effect.

Definition at line 106 of file ChromaticAberration.hpp.

◆ m_fb

RenderTexture galaxy::graphics::ChromaticAberration::m_fb
private

Framebuffer to render aberration.

Definition at line 111 of file ChromaticAberration.hpp.

◆ m_r_offset

float galaxy::graphics::ChromaticAberration::m_r_offset
private

Effect r colour offset.

Definition at line 116 of file ChromaticAberration.hpp.

◆ m_g_offset

float galaxy::graphics::ChromaticAberration::m_g_offset
private

Effect g colour offset.

Definition at line 121 of file ChromaticAberration.hpp.

◆ m_b_offset

float galaxy::graphics::ChromaticAberration::m_b_offset
private

Effect b colour offset.

Definition at line 126 of file ChromaticAberration.hpp.


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