Missing anti-halo setting for ambient occlusion

The documentation mentions the setting ‘Distance’ to remove false halo artifacts: Post Process Effects in Unreal Engine | Unreal Engine 5.2 Documentation

I haven’t found a setting the in the post process volume settings to remove this halo artifact. ‘FadeOutDistance’ and ‘FadeOutRadius’ only change how the whole AO effect should render.

Doesn’t the current AO implementation do a depth test?

The objects in the following picture are far enough away from each other and should not cast an occlusion of the objects behind them.

67883-haloartifact.jpg

Only three views? Bump.

Hi ,

I’ve entered a ticket for this to be corrected in the documentation along with adding some of the additional settings that have been added to the Ambient Occlusion section of the Post Process Volume.

The ticket number is UEDOC-2743 for tracking purposes.

Despite the change in this one setting, the Post Process will still use the z-buffer and cannot know what the thickness of an object will be. I’ve not tried the settings myself, but going by the description the Fade Out Distance should be the one that you want to adjust for the best results.

Thank you!

Tim

Hi Tim,

Thank you very much for responding! However I think I there is a bit of misunderstanding. Ambient Occlusion uses certainly the z-buffer, without it the effect wouldn’t be possible. The question is does it do a depth check/ range check?

I mean something like this:

from http://john-chapman-graphics.blogspot.de/2013/01/ssao-tutorial.html

As you can see in my picture of my scene, it looks like this range check isn’t avaiable in the current solution. Thus the wrong halo artifacts. The old documentation does mention it, so I guess the AO effect got a rework at some point.

Furthermore the settings ‘Fade Out Distance/Range’ don’t help with this issue. Those settings are only tweaking how far away the whole AO effect should render.

All in all it would be great to get the old range check setting back.

Thank you.

I do recall some changes to AO settings in 4.8 due to reorganization and optimization efforts. I know this caused some muddy AO and artifacts due to this change that is kind of a work in progress.

I’ll dig into this a little as a free up time and do some comparisons. Right now a lot of rendering side of things are being optimized so there are likely to be some improvements and changes along the way.

I’m not completely sure off-hand with the range check, but I’ll post back once I have more info.

Thanks for the added details. That’s helpful.

Tim

Hi Tim,

I tried to do some investigations to help you and found the following:

In the PostProcessAmbientOcclusion.usf the variable ‘float4 ScreenSpaceAOAndSSRShaderParams[5]’ uses at position [0].z the variable ‘1/AmbientOcclusionDistance’. Later this variable is used to avoid halos around objects:

	// to avoid halos around objects
	float Weight = 1;
				
	float InvAmbientOcclusionDistance = ScreenSpaceAOandSSRShaderParams[0].z;
	float ViewDepthAdd = 1.0f - ViewSpacePosition.z * InvAmbientOcclusionDistance;

	Weight *= saturate(SamplePositionLeft.z * InvAmbientOcclusionDistance + ViewDepthAdd);
	Weight *= saturate(SamplePositionRight.z * InvAmbientOcclusionDistance + ViewDepthAdd);

//	return float2(1 - NormAngle, (WeightLeft + WeightRight) * 0.5f);
	return float2((1-NormAngle) / (Weight + 0.001f), Weight);

However by taking a look into the file ‘PostProcessAmbientOcclusion.h’ I think the values for the ‘ScreenSpaceAOAndSSRShaderParams[5]’ are initialized as

		Value[0] = FVector4(Settings.AmbientOcclusionPower, Settings.AmbientOcclusionBias / 1000.0f, 1.0f / Settings.AmbientOcclusionDistance_DEPRECATED, Settings.AmbientOcclusionIntensity);
Value[1]...

And here the variable ‘Settings.AmbientOcclusionDistance’ is _DEPRECATED. I think this is the reason why we can’t change the value in the post process volume settings.

None the less I think it is crucial to have access to this value, as you can clearly see the benefit in the comparision picture with the buddha statue. It looks more believeable with a proper range check.

I propose to add the ‘Distance’ setting again. If the removeal was based on performance optimation, I think the decision to use it or not should be ours.

Thank you for your time and help.