demotool/bloom.hh

40 lines
728 B
C++
Raw Normal View History

2017-09-30 19:13:06 +02:00
#pragma once
#ifndef REAL_BUILD
# include "externals.hh"
#endif
2017-10-02 09:40:36 +02:00
#include "rendertarget.hh"
2017-10-04 17:48:25 +02:00
#include "shaders.hh"
2017-10-02 09:40:36 +02:00
2017-09-30 19:13:06 +02:00
struct T_BloomPass
{
2017-09-30 21:27:50 +02:00
static constexpr uint32_t BloomLevels = 6;
2017-09-30 19:13:06 +02:00
T_BloomPass( ) = delete;
T_BloomPass( T_BloomPass const& ) = delete;
T_BloomPass( T_BloomPass&& ) = delete;
T_BloomPass( __rw__ T_Texture& input );
2017-09-30 19:13:06 +02:00
void render( );
2017-09-30 19:41:45 +02:00
void makeUI( );
2017-09-30 19:13:06 +02:00
2017-10-01 18:51:02 +02:00
T_Texture& output( ) { return txBlur0_; }
2017-09-30 19:13:06 +02:00
private:
T_Texture& input_;
2017-10-04 17:48:25 +02:00
T_ShaderPipeline spHighpass_;
T_ShaderPipeline spDownsample_;
T_ShaderPipeline spBlur_;
2017-09-30 19:13:06 +02:00
T_TextureSampler sampler_;
2017-09-30 19:13:06 +02:00
T_Texture txBlur0_ , txBlur1_;
std::vector< T_Rendertarget > rtBlur0_ , rtBlur1_;
2017-09-30 19:41:45 +02:00
float filterParams_[ 3 ];
float blurWeights_[ 4 ];
float blurSize_;
2017-09-30 19:13:06 +02:00
};