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

Gaussian Blur pass. More...

#include <GaussianBlur.hpp>

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

Public Types

enum class  Strength : int { LOW = 0 , NORMAL = 1 , STRONG = 2 }
 Pixel sample strength. More...
 

Public Member Functions

 GaussianBlur (const int width, const int height)
 Argument constructor.
 
virtual ~GaussianBlur ()=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_strength (const Strength strength)
 Set gaussian blur strength.
 
bool is_enabled () override
 Is this effect enabled?
 
- Public Member Functions inherited from galaxy::graphics::PostEffect
virtual ~PostEffect ()=default
 Destructor.
 

Private Member Functions

 GaussianBlur ()=delete
 Constructor.
 

Private Attributes

Shader m_shader
 Shader for post processing effect.
 
RenderTexture m_horizontal
 Framebuffer to render horizontal blur to.
 
RenderTexture m_vertical
 Framebuffer to render vertical blur to.
 
Strength m_strength
 Which pixel sample strength to use.
 

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

Gaussian Blur pass.

Run after Anti-Aliasing.

Definition at line 24 of file GaussianBlur.hpp.

Member Enumeration Documentation

◆ Strength

Pixel sample strength.

Enumerator
LOW 

Pixel sample of 5.

NORMAL 

Pixel sample of 9.

STRONG 

Pixel sample of 13.

Definition at line 30 of file GaussianBlur.hpp.

Constructor & Destructor Documentation

◆ GaussianBlur() [1/2]

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

Argument constructor.

Parameters
widthWidth of internal framebuffer.
heightHeight of internal framebuffer.

Definition at line 117 of file GaussianBlur.cpp.

+ Here is the call graph for this function:

◆ ~GaussianBlur()

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

Destructor.

◆ GaussianBlur() [2/2]

galaxy::graphics::GaussianBlur::GaussianBlur ( )
privatedelete

Constructor.

Member Function Documentation

◆ resize()

void galaxy::graphics::GaussianBlur::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 131 of file GaussianBlur.cpp.

+ Here is the call graph for this function:

◆ render()

unsigned int galaxy::graphics::GaussianBlur::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 137 of file GaussianBlur.cpp.

+ Here is the call graph for this function:

◆ set_strength()

void galaxy::graphics::GaussianBlur::set_strength ( const Strength strength)

Set gaussian blur strength.

Parameters
strengthEnum of strength values.

Definition at line 157 of file GaussianBlur.cpp.

+ Here is the call graph for this function:

◆ is_enabled()

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

Is this effect enabled?

Returns
True if effect is enabled. Otherwise false.

Implements galaxy::graphics::PostEffect.

Definition at line 163 of file GaussianBlur.cpp.

Member Data Documentation

◆ m_shader

Shader galaxy::graphics::GaussianBlur::m_shader
private

Shader for post processing effect.

Definition at line 104 of file GaussianBlur.hpp.

◆ m_horizontal

RenderTexture galaxy::graphics::GaussianBlur::m_horizontal
private

Framebuffer to render horizontal blur to.

Definition at line 109 of file GaussianBlur.hpp.

◆ m_vertical

RenderTexture galaxy::graphics::GaussianBlur::m_vertical
private

Framebuffer to render vertical blur to.

Definition at line 114 of file GaussianBlur.hpp.

◆ m_strength

Strength galaxy::graphics::GaussianBlur::m_strength
private

Which pixel sample strength to use.

Definition at line 119 of file GaussianBlur.hpp.


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