From 98aa501199ebe6d1ed49224fdb2cb19619b6ae22 Mon Sep 17 00:00:00 2001 From: Emmanuel Benoit Date: Sat, 30 Sep 2017 21:27:50 +0200 Subject: [PATCH] Some more bloom tweaking --- bloom-combine.glsl | 2 +- bloom.cc | 8 ++++---- bloom.hh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bloom-combine.glsl b/bloom-combine.glsl index dda90fa..fde6986 100644 --- a/bloom-combine.glsl +++ b/bloom-combine.glsl @@ -13,7 +13,7 @@ void main( void ) float f = u_Parameters.x; color = textureLod( u_MainInput , tmp , 0 ).rgb; vec3 bloom = vec3( 0 ); - for ( int i = 0 ; i < 5 ; i ++ ) { + for ( int i = 0 ; i < 6 ; i ++ ) { bloom += f * textureLod( u_BlurInput , tmp , i ).rgb; f = pow( f , u_Parameters.y + 1 ); } diff --git a/bloom.cc b/bloom.cc index 3860d67..2bd717b 100644 --- a/bloom.cc +++ b/bloom.cc @@ -21,14 +21,14 @@ T_BloomPass::T_BloomPass( // filterParams_{ 1.6 , 1.2 , .95 } , blurWeights_{ 0.324 , 0.232 , 0.0855 , 0.0205 } , - blurSize_{ 2. } , - combineStrength_( 0.7 ) , + blurSize_{ 1.3 } , + combineStrength_( 0.45 ) , combineAttenuation_( 0.3 ) { txBlur0_.wrap( E_TexWrap::CLAMP_EDGE ).samplingMode( E_TexSampling::LINEAR ); txBlur1_.wrap( E_TexWrap::CLAMP_EDGE ).samplingMode( E_TexSampling::LINEAR ); - for ( int i = 0 ; i < 5 ; i ++ ) { + for ( auto i = 0u ; i < BloomLevels ; i ++ ) { rtBlur0_.push_back( T_RendertargetSetup( ).add( txBlur0_ , i ).create( ) ); rtBlur1_.push_back( T_RendertargetSetup( ).add( txBlur1_ , i ).create( ) ); } @@ -115,7 +115,7 @@ void T_BloomPass::render( ) blur.set( 1 , txBlur0_ ); blur.bind( ); glUniform2f( 2 , input_.width( ) , input_.height( ) ); - glUniform2f( 3 , combineStrength_ , 1 - combineAttenuation_ ); + glUniform2f( 3 , combineStrength_ , combineAttenuation_ ); glRectf( -1, -1 , 1 , 1 ); glBindTexture( GL_TEXTURE_2D , 0 ); } diff --git a/bloom.hh b/bloom.hh index 750a9ed..42ea3ff 100644 --- a/bloom.hh +++ b/bloom.hh @@ -11,7 +11,7 @@ struct T_BloomPass { - static constexpr uint32_t BloomLevels = 5; + static constexpr uint32_t BloomLevels = 6; T_BloomPass( ) = delete; T_BloomPass( T_BloomPass const& ) = delete;