| 1529 | } |
| 1530 | |
| 1531 | void Tr2PostProcessRenderer::RenderTonemapping( |
| 1532 | const Tr2TextureAL& dest, |
| 1533 | Tr2PostProcess2* postprocess, |
| 1534 | Tr2RenderContext& renderContext ) |
| 1535 | { |
| 1536 | GPU_REGION( renderContext, "Tonemapping" ); |
| 1537 | |
| 1538 | m_tonemappingEffect->SetParameter( MEMOIZED_STRING( "OutputGamma" ), g_eveSpaceSceneGammaBrightness ); |
| 1539 | |
| 1540 | Tonemapping::ApplyColorCorrection( postprocess ? postprocess->GetColorCorrectionIfAvailable( m_quality ) : nullptr, m_tonemappingEffect ); |
| 1541 | Tonemapping::ApplyBloom( postprocess ? postprocess->GetBloomIfAvailable( m_quality ) : nullptr, m_tonemappingEffect, m_useNewBloom, m_bloomDebugMode ); |
| 1542 | Tonemapping::ApplyDynamicExposure( postprocess ? postprocess->GetDynamicExposureIfAvailable( m_quality ) : nullptr, m_tonemappingEffect, postprocess ? postprocess->m_exposureAdjustment : 0.0f ); |
| 1543 | Tonemapping::ApplyVignette( postprocess ? postprocess->GetVignetteIfAvailable( m_quality ) : nullptr, m_tonemappingEffect ); |
| 1544 | Tonemapping::ApplyDesatureate( postprocess ? postprocess->GetDesaturateIfAvailable( m_quality ) : nullptr, m_tonemappingEffect ); |
| 1545 | Tonemapping::ApplyFade( postprocess ? postprocess->GetFadeIfAvailable( m_quality ) : nullptr, m_tonemappingEffect ); |
| 1546 | |
| 1547 | std::vector<const Tr2PPLutEffect*> luts{}; |
| 1548 | if( postprocess ) |
| 1549 | { |
| 1550 | postprocess->GetAvilableSortedLuts( luts ); |
| 1551 | } |
| 1552 | Tonemapping::ApplyLuts( luts, m_tonemappingEffect ); |
| 1553 | |
| 1554 | if( postprocess ) |
| 1555 | { |
| 1556 | if( auto tonemapping = postprocess->GetTonemappingIfAvailable() ) |
| 1557 | { |
| 1558 | if( tonemapping->m_method == Tr2PPTonemappingEffect::Aces ) |
| 1559 | { |
| 1560 | Tonemapping::ApplyAcesTonemappingMethod( tonemapping, m_tonemappingEffect ); |
| 1561 | } |
| 1562 | else if( tonemapping->m_method == Tr2PPTonemappingEffect::AgX ) |
| 1563 | { |
| 1564 | Tonemapping::ApplyAgxTonemappingMethod( m_tonemappingEffect ); |
| 1565 | } |
| 1566 | else |
| 1567 | { |
| 1568 | Tonemapping::ApplyUncharted2TonemappingMethod( tonemapping, m_tonemappingEffect ); |
| 1569 | } |
| 1570 | } |
| 1571 | else |
| 1572 | { |
| 1573 | Tonemapping::ApplyNoTonemappingMethod( m_tonemappingEffect ); |
| 1574 | } |
| 1575 | } |
| 1576 | else |
| 1577 | { |
| 1578 | Tonemapping::ApplyNoTonemappingMethod( m_tonemappingEffect ); |
| 1579 | } |
| 1580 | |
| 1581 | renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_FULLSCREEN ); |
| 1582 | DrawInto( dest, Tr2LoadAction::DONT_CARE, m_tonemappingEffect, renderContext ); |
| 1583 | } |
| 1584 | |
| 1585 | void Tr2PostProcessRenderer::RenderGenericEffect( const Tr2TextureAL& dest, const Tr2TextureAL& src, Tr2RenderContext& renderContext, Tr2PPGenericEffectPtr genericEffect ) |
| 1586 | { |
nothing calls this directly
no test coverage detected