@@ -1206,6 +1206,9 @@ namespace Lux {
12061206 aoRenderPassSpec.Pipeline = Pipeline::Create (aoPipelineSpec);
12071207 m_AOCompositePass = RenderPass::Create (aoRenderPassSpec);
12081208 m_AOCompositePass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
1209+ m_AOCompositePass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
1210+ m_AOCompositePass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
1211+ m_AOCompositePass->SetInput (" Camera" , m_UBSCamera);
12091212 m_AOCompositePass->SetInput (" r_DefaultSampler" , Renderer::GetDefaultSampler ());
12101213 m_AOCompositePass->SetInput (" r_PointSampler" , Renderer::GetPointSampler ());
12111214 m_AOCompositePass->SetInput (" r_LinearSampler" , Renderer::GetClampSampler ());
@@ -1229,6 +1232,9 @@ namespace Lux {
12291232 aoDebugRenderPassSpec.Pipeline = Pipeline::Create (aoDebugPipelineSpec);
12301233 m_AODebugPass = RenderPass::Create (aoDebugRenderPassSpec);
12311234 m_AODebugPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
1235+ m_AODebugPass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
1236+ m_AODebugPass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
1237+ m_AODebugPass->SetInput (" Camera" , m_UBSCamera);
12321238 m_AODebugPass->SetInput (" r_DefaultSampler" , Renderer::GetDefaultSampler ());
12331239 m_AODebugPass->SetInput (" r_PointSampler" , Renderer::GetPointSampler ());
12341240 m_AODebugPass->SetInput (" r_LinearSampler" , Renderer::GetClampSampler ());
@@ -1961,9 +1967,17 @@ namespace Lux {
19611967
19621968 m_GTAOFinalImage = (m_Options.GTAODenoisePasses % 2 != 0 ) ? m_GTAODenoiseImage : m_GTAOOutputImage;
19631969 if (m_AOCompositePass)
1970+ {
19641971 m_AOCompositePass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
1972+ m_AOCompositePass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
1973+ m_AOCompositePass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
1974+ }
19651975 if (m_AODebugPass)
1976+ {
19661977 m_AODebugPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
1978+ m_AODebugPass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
1979+ m_AODebugPass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
1980+ }
19671981 if (m_SSRPass && m_SSRPass->IsInputValid (" u_GTAOTex" ))
19681982 m_SSRPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
19691983 if (m_GTAOTemporalPass)
@@ -2634,9 +2648,11 @@ namespace Lux {
26342648
26352649 std::vector<RenderGraph::ResourceHandle> aoFinalOutputs = { gtaoOutput, gtaoDenoise, gtaoHistoryA, gtaoHistoryB };
26362650 std::vector<RenderGraph::ResourceHandle> aoCompositeReads = geometryOutputs;
2651+ appendResources (aoCompositeReads, preDepthOutputs);
26372652 appendResources (aoCompositeReads, aoFinalOutputs);
26382653 addPass (" AO Composite" , aoCompositeReads, addRenderPassResources (" AO Composite" , m_AOCompositePass));
2639- addPass (" AO Debug" , aoFinalOutputs, addRenderPassResources (" AO Debug" , m_AODebugPass));
2654+ std::vector<RenderGraph::ResourceHandle> aoDebugReads = aoCompositeReads;
2655+ addPass (" AO Debug" , aoDebugReads, addRenderPassResources (" AO Debug" , m_AODebugPass));
26402656
26412657 std::vector<RenderGraph::ResourceHandle> preConvolutionOutputs;
26422658 preConvolutionOutputs.push_back (m_PreConvolutedTexture.Texture ? addTexture (" Pre-Convoluted Scene" , m_PreConvolutedTexture.Texture ->GetImage ()) : RenderGraph::InvalidResource);
@@ -4653,7 +4669,11 @@ namespace Lux {
46534669 {
46544670 m_GTAOFinalImage = m_GTAOOutputImage;
46554671 if (m_AOCompositePass)
4672+ {
46564673 m_AOCompositePass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
4674+ m_AOCompositePass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
4675+ m_AOCompositePass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
4676+ }
46574677 if (m_SSRPass && m_SSRPass->IsInputValid (" u_GTAOTex" ))
46584678 m_SSRPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
46594679 return ;
@@ -4677,7 +4697,11 @@ namespace Lux {
46774697
46784698 m_GTAOFinalImage = (denoisePasses % 2u ) != 0u ? m_GTAODenoiseImage : m_GTAOOutputImage;
46794699 if (m_AOCompositePass)
4700+ {
46804701 m_AOCompositePass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
4702+ m_AOCompositePass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
4703+ m_AOCompositePass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
4704+ }
46814705 if (m_SSRPass && m_SSRPass->IsInputValid (" u_GTAOTex" ))
46824706 m_SSRPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
46834707
@@ -4719,7 +4743,11 @@ namespace Lux {
47194743 m_GTAOHistoryIndex = writeIndex;
47204744 m_GTAOFinalImage = historyOutput;
47214745 if (m_AOCompositePass)
4746+ {
47224747 m_AOCompositePass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
4748+ m_AOCompositePass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
4749+ m_AOCompositePass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
4750+ }
47234751 if (m_SSRPass && m_SSRPass->IsInputValid (" u_GTAOTex" ))
47244752 m_SSRPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
47254753 }
@@ -4744,6 +4772,8 @@ namespace Lux {
47444772 return ;
47454773
47464774 m_AODebugPass->SetInput (" u_GTAOTex" , m_GTAOFinalImage);
4775+ m_AODebugPass->SetInput (" u_Depth" , m_PreDepthPass->GetDepthOutput ());
4776+ m_AODebugPass->SetInput (" u_Normal" , m_GeometryPass->GetOutput (1 ));
47474777
47484778 BeginProfiledGPU (" AODebug" );
47494779 Renderer::BeginRenderPass (m_CommandBuffer, m_AODebugPass);
0 commit comments