Some more bloom tweaking
This commit is contained in:
parent
34b393334c
commit
98aa501199
3 changed files with 6 additions and 6 deletions
|
@ -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 );
|
||||
}
|
||||
|
|
8
bloom.cc
8
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 );
|
||||
}
|
||||
|
|
2
bloom.hh
2
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;
|
||||
|
|
Loading…
Reference in a new issue