thanks for the repro project. I’m not exactly sure what you mean by halo artifacts, but I assume it’s the parts I’ve circled in red on your screenshot. Can you please confirm that or point me to the problematic areas if I’m wrong?
[Image Removed]
If these are the artifacts you’re seeing, could you try changing either (or both) of the following CVars:
Set r.DOF.Scatter.BackgroundCompositing to 1: Compositing mode of the background hybrid scattering. 0: Disabled; 1: Additive; 2: Gather occlusion (default).
Set r.DOF.TAA.CoCBilateralFilterStrength to 1: If 1, a bilateral filter based on the circle-of-confusion is used to reject history in the pre-DoF TAA pass. If 0, this is disabled. When enabled, you may get stronger noise on edges of objects that separate foreground and background. When disabled, you may get stronger ghosting along those same edges.
These are indeed the ones we’re looking to improve as when the scenes get busy and have camera movements, it gets very noticeable.
We already had r.DOF.Scatter.BackgroundCompositing to 1, but r.DOF.TAA.CoCBilateralFilterStrength to 1 did drastically improve the behavior, along with ensuring that r.DOF.Gather.PostfilterMethod is set to 1 (not 2).
Do these settings come with significant GPU cost?
If we notice any more issues, we will just lower the DOF strength.
glad that helped. As for performance, changing r.DOF.Scatter.BackgroundCompositing from 2 (default) to 1 should do less computation (additive mode keeps the gather quality low while occlusion mode raises the quality as can be seen at lines 2886-2897 in DiaphramDOF.cpp) and should be a faster.
Setting r.DOF.TAA.CoCBilateralFilterStrength to 1 does a few more calculations and should incur a negligeable performance cost (the relevant code is in ComputeBilateralWeigth() in TemporalAA.usf which is only a couple of instructions).
Setting r.DOF.Gather.PostfilterMethod to 1 (RGBMedian3x3) requires quite a few more calculations per pixel than setting this to 2 (RGBMax3x3), so it will be a bit slower. The relevant code is in DOFPostfiltering.usf and performs a a few min/max operations, these are very fast on GPUs but they can add up).
In this case it’s best to perform GPU performance profiling by testing each of these settings separately and in combination to compare the speed loss (or gain) between the old and new settings.