[4.11.1] Post Processing Pass not being Processed

Hi there.

I have been working on adding a SSAO blur pass to CompositionLighting, however between 4.10.0 and 4.11.1 the additional passes have stopped being processed properly. I have tried stepping through the graph in VS, adding breakpoints and adding intentional exceptions into the Process() function, but it never seems to be called.

I’ve added the code which is adding the additional passes below.

static void BlurSSAOBuffer(FPostprocessContext& Context, FSceneRenderTargets& SceneContext, FRenderingCompositeOutputRef AO)
{
	FRenderingCompositePass* SSAO = Context.Graph.RegisterPass(new FRCPassPostProcessInput(SceneContext.ScreenSpaceAO));

	FRCPassPostProcessWeightedSampleSumInputBlur* PostProcessBlurX = Context.Graph.RegisterPass(new(FMemStack::Get())
		FRCPassPostProcessWeightedSampleSumInputBlur(EFS_Horiz,
			EFCM_Weighted,
			CVarAmbientOcclusionBlurRadius.GetValueOnRenderThread(),
			TEXT("SSAO Blur X"),
			FLinearColor::White));

	PostProcessBlurX->AddDependency(SSAO);
	PostProcessBlurX->SetInput(ePId_Input0, SSAO);

	FRCPassPostProcessWeightedSampleSumInputBlur* PostProcessBlurY = Context.Graph.RegisterPass(new(FMemStack::Get())
		FRCPassPostProcessWeightedSampleSumInputBlur(
			EFS_Vert,
			EFCM_Weighted,
			CVarAmbientOcclusionBlurRadius.GetValueOnRenderThread(),
			TEXT("SSAO Blur Y"),
			FLinearColor::White));

	PostProcessBlurY->AddDependency(SSAO);
	PostProcessBlurY->SetInput(ePId_Input0, SSAO);
}

Thanks!

Hello,

I’m not too familiar with this area of the code, so I have a few questions:

  • Which class are you adding this code to?
  • You’re saying that it was working properly in 4.10, but has since stopped working in 4.11?

Hi Sean,

The code seen above was added into the “CompositionLighting.cpp” file, as a static function, but is used from the “FCompositionLighting” class, in the same file.

Also the “FRCPassPostProcessWeightedSampleSumInputBlur” class is a custom class which slightly modifies the “Process” function of “FRCPassPostProcessWeightedSampleSum”.

If you would like to test it, I have included the edited files here: Edited Files

I have tried changing the pass back to the provided Weighted Sample Sum, but the same bug seems to occur.

Also, yes. This process was working in 4.10. Though I don’t remember which one it was, I’m pretty sure it also worked during one of the 4.11 Previews I tested, as I ended up adding the code as a pull request (See Branch 4,11, Pull Request #1935)

Thanks!

Are the files that you’ve provided from the 4.11 version? If so, could you provide the 4.10 version of the files as well so I can see the changes you’ve made to attempt to get your function to be called?

Yes they are from the 4.11 version, but there are no differences between the 4.10 version and the files provided, as all the changes I had made prior to this was when I thought the issue was different. Regardless, I have added the 4.10 files, just in case, here: Files

Just to clarify, it’s not the “BlurSSAOBuffer” function that doesn’t get called, it’s the “Process” function within the Post Processing pass that doesn’t get called. Despite trying to register a pass using “Context.Graph.RegisterPass” it doesn’t run through the overwritten function, even though the RegisterPass call seems identical to those around it. Sorry if this was all obvious, but I realized the first post may of been misleading, so wanted to make sure that was clear.

Thanks!

Could you clarify what you mean by the Process function/where in the code it is located? I didn’t catch that function when I was looking over the code you provided.

The Process function can be found at line 796 of the PostProcessWeightedSampleSum.cpp file, along with line 162 of the PostProcessWeightedSampleSum.h file.

From what I understand of this system, it is supposed to be called from the Composition Graph (If it’s helpful, this call can be found in the RenderingCompositionGraph.cpp file, line 618), and stepping through this process shows that at this line, all other post processing effects are being called. For instance I can see the AO base pass being processed, right before my custom pass should be processed, however the blur never appears.

Hello,

After some further investigation, this appears to be an issue with the code that you are adding. We do not provide support for modifying source code, however I will move this question to the C++ section where you can request assistance from the community.

Have a great day