| 1825 | } |
| 1826 | |
| 1827 | void Sample::PostProcessPreToneMapping(nvrhi::ICommandList* commandList, const donut::engine::ICompositeView& compositeView) |
| 1828 | { // a.k.a. HDR post-process (e.g. bloom goes here) |
| 1829 | donut::engine::PlanarView fullscreenView = *m_view; |
| 1830 | nvrhi::Viewport windowViewport(float(m_displaySize.x), float(m_displaySize.y)); |
| 1831 | fullscreenView.SetViewport(windowViewport); |
| 1832 | fullscreenView.UpdateCache(); |
| 1833 | |
| 1834 | if (m_ui.EnableBloom && m_ui.BloomIntensity > 0.f && m_ui.BloomRadius > 0.f) |
| 1835 | { |
| 1836 | m_bloomPass->Render(m_commandList, m_renderTargets->ProcessedOutputFramebuffer, fullscreenView, m_renderTargets->ProcessedOutputColor, m_ui.BloomRadius, m_ui.BloomIntensity); |
| 1837 | } |
| 1838 | |
| 1839 | if (m_ui.PostProcessTestPassHDR) |
| 1840 | { |
| 1841 | m_commandList->beginMarker("TestRaygenPP_HDR"); |
| 1842 | |
| 1843 | m_commandList->setTextureState(m_renderTargets->ProcessedOutputColor, nvrhi::AllSubresources, nvrhi::ResourceStates::UnorderedAccess); |
| 1844 | |
| 1845 | nvrhi::rt::DispatchRaysArguments args; |
| 1846 | args.width = m_displaySize.x; |
| 1847 | args.height = m_displaySize.y; |
| 1848 | |
| 1849 | nvrhi::rt::State state; |
| 1850 | state.shaderTable = m_ptPipelineTestRaygenPPHDR->GetShaderTable(); |
| 1851 | state.bindings = { m_bindingSet, m_DescriptorTable->GetDescriptorTable() }; |
| 1852 | m_commandList->setRayTracingState(state); |
| 1853 | |
| 1854 | SampleMiniConstants miniConstants = { uint4(0, 0, 0, 0) }; |
| 1855 | m_commandList->setPushConstants(&miniConstants, sizeof(miniConstants)); |
| 1856 | m_commandList->dispatchRays(args); |
| 1857 | |
| 1858 | m_commandList->setTextureState(m_renderTargets->ProcessedOutputColor, nvrhi::AllSubresources, nvrhi::ResourceStates::UnorderedAccess); |
| 1859 | |
| 1860 | m_commandList->endMarker(); |
| 1861 | } |
| 1862 | } |
| 1863 | |
| 1864 | void Sample::PostProcessPostToneMapping(nvrhi::ICommandList* commandList, const donut::engine::ICompositeView& compositeView) |
| 1865 | { // a.k.a. LDR post-process (e.g. colour filters go here) |