| 321 | } |
| 322 | |
| 323 | void ApplyBloom( const Tr2PPBloomEffect* bloom, Tr2Effect* tonemappingEffect, bool newBloom, Tr2PostProcessRenderer::BloomDebugMode debugMode ) |
| 324 | { |
| 325 | if( bloom != nullptr ) |
| 326 | { |
| 327 | tonemappingEffect->SetParameter( MEMOIZED_STRING( "GrimeWeight" ), bloom->m_grimeWeight ); |
| 328 | tonemappingEffect->SetParameter( MEMOIZED_STRING( "BloomBrightness" ), newBloom ? 1.0f : bloom->m_bloomBrightness ); |
| 329 | tonemappingEffect->SetResourceTexture2D( MEMOIZED_STRING( "Grime" ), bloom->m_grimePath.c_str() ); |
| 330 | |
| 331 | if( debugMode != Tr2PostProcessRenderer::BloomDebugMode::BLOOM_DEBUG_NONE ) |
| 332 | { |
| 333 | // when rendering bloom debug we render it into the blit current, |
| 334 | // so to not have tonemapping applied on top of it we need to set the blit original to the bloom result |
| 335 | if( auto blitCurrent = tonemappingEffect->GetResourceByName( "BlitOriginal" ) ) |
| 336 | { |
| 337 | if( TriTextureParameterPtr resource = BlueCastPtr( blitCurrent ) ) |
| 338 | { |
| 339 | tonemappingEffect->SetParameter( MEMOIZED_STRING( "BlitOriginal" ), resource->GetResource() ); |
| 340 | } |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | else |
| 345 | { |
| 346 | tonemappingEffect->SetResourceTexture2D( MEMOIZED_STRING( "Grime" ), "res:/texture/global/black.dds" ); |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | void ApplyDynamicExposure( const Tr2PPDynamicExposureEffect* dynamicExposure, Tr2Effect* tonemappingEffect, float postprocessExposureAmount ) |
| 351 | { |
no test coverage detected