demotool/bloom.hh
2017-09-30 19:41:45 +02:00

46 lines
919 B
C++

#pragma once
#ifndef REAL_BUILD
# define REAL_BUILD
# include "externals.hh"
# include "texture.hh"
# include "rendertarget.hh"
# include "utilities.hh"
# undef REAL_BUILD
#endif
struct T_BloomPass
{
static constexpr uint32_t BloomLevels = 5;
T_BloomPass( ) = delete;
T_BloomPass( T_BloomPass const& ) = delete;
T_BloomPass( T_BloomPass&& ) = delete;
T_BloomPass( __rd__ const uint32_t width ,
__rd__ const uint32_t height ,
__rw__ T_FilesWatcher& watcher ,
__rw__ T_Texture& input );
void render( );
void makeUI( );
private:
T_Texture& input_;
T_ShaderProgram spHighpass_;
T_ShaderProgram spBlur_;
T_ShaderProgram spCombine_;
T_Texture txInput_;
T_Rendertarget rtInput_;
T_Texture txBlur0_ , txBlur1_;
std::vector< T_Rendertarget > rtBlur0_ , rtBlur1_;
float filterParams_[ 3 ];
float blurWeights_[ 4 ];
float blurSize_;
float combineStrength_;
float combineAttenuation_;
};