API Documentation
Public Member Functions | List of all members
nkAstraeus::Effect Class Referenceabstract

Base class for all effects in the component. More...

Inheritance diagram for nkAstraeus::Effect:
nkAstraeus::AtmosphereEffect nkAstraeus::FilmGrainEffect nkAstraeus::FxaaEffect nkAstraeus::ImageEnvironmentEffect nkAstraeus::SsaoEffect nkAstraeus::TextureCopyEffect nkAstraeus::ToneMappingEffect

Public Member Functions

 Effect (EFFECT_TYPE type) noexcept
 
virtual ~Effect ()
 
nkMemory::StringView getName () const
 
nkGraphics::ShadergetShader () const
 
EFFECT_TYPE getType () const
 
void setName (nkMemory::StringView value)
 
virtual bool load ()=0
 
virtual void unload ()=0
 

Detailed Description

Base class for all effects in the component.

This class offers basic information and the general interface to access them. Effects are designed to be used within a nkGraphics::PostProcessPass. The shader they output can be used directly within the pass itself.

Constructor & Destructor Documentation

◆ Effect()

nkAstraeus::Effect::Effect ( EFFECT_TYPE  type)
noexcept

Constructor.

Parameters
typeThe underlying effect type. Provided by the calling implementation being constructed.

◆ ~Effect()

virtual nkAstraeus::Effect::~Effect ( )
virtual

Destructor.

Member Function Documentation

◆ getName()

nkMemory::StringView nkAstraeus::Effect::getName ( ) const
Returns
The material's name.

◆ getShader()

nkGraphics::Shader* nkAstraeus::Effect::getShader ( ) const
Returns
The final shader prepared by the effect, once a successful load() has been called.

◆ getType()

EFFECT_TYPE nkAstraeus::Effect::getType ( ) const
Returns
The effect real type. Allows to know which derived class this effect truly is.

◆ setName()

void nkAstraeus::Effect::setName ( nkMemory::StringView  value)

Sets the name of the effect.

Parameters
valueThe name to set.
Remarks
This function is called by the EffectManager to keep it in sync with its internal memory. If you need to alter this, please call EffectManager::rename.

◆ load()

virtual bool nkAstraeus::Effect::load ( )
pure virtual

Loads the effect and make it ready for rendering.

Returns
Whether the loading went well (true) or not (false).

Implemented in nkAstraeus::AtmosphereEffect, nkAstraeus::SsaoEffect, nkAstraeus::FxaaEffect, nkAstraeus::ToneMappingEffect, nkAstraeus::FilmGrainEffect, nkAstraeus::ImageEnvironmentEffect, and nkAstraeus::TextureCopyEffect.

◆ unload()

virtual void nkAstraeus::Effect::unload ( )
pure virtual

Unloads the effect and its internal memory. After that, the effect is unusable for rendering.

Implemented in nkAstraeus::AtmosphereEffect, nkAstraeus::SsaoEffect, nkAstraeus::FxaaEffect, nkAstraeus::ToneMappingEffect, nkAstraeus::FilmGrainEffect, nkAstraeus::ImageEnvironmentEffect, and nkAstraeus::TextureCopyEffect.


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