demotool/bloom.hh

41 lines
798 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 = 6;
T_BloomPass( ) = delete;
T_BloomPass( T_BloomPass const& ) = delete;
T_BloomPass( T_BloomPass&& ) = delete;
T_BloomPass( __rw__ T_FilesWatcher& watcher ,
__rw__ T_Texture& input );
void render( );
void makeUI( );
T_Texture& output( ) { return txBlur0_; }
private:
T_Texture& input_;
T_ShaderProgram spHighpass_;
T_ShaderProgram spDownsample_;
T_ShaderProgram spBlur_;
T_Texture txBlur0_ , txBlur1_;
std::vector< T_Rendertarget > rtBlur0_ , rtBlur1_;
float filterParams_[ 3 ];
float blurWeights_[ 4 ];
float blurSize_;
};