FidelityFX-SDK
FidelityFX-SDK copied to clipboard
[Bug][DOF] Visible artifacts with high blur radius
Problem: At high blur radii, visible artifacts appear around objects that are in focus, as shown in the image below:
This issue appears to be related to insufficient dilation of tiles, especially in the background areas. The problem seems to occur in the far blur pass, where the dilated tiles buffer doesn’t cover the necessary areas.
This is far blur and dilated tiles buffer for context:
It looks like the tiles are not dilated enough, causing background pixels to use the fast path (FfxDofProcessFarColorOnly) and the color from foreground objects is leaking in this areas.
When I modify this line in the FfxDofDilateStep function in ffx_dof_dilate_depth.h:
FfxUInt32x2 tileRad = FfxDofPxRadToTiles(abs(localCocRange));
by changing it to:
FfxUInt32x2 tileRad = 2 * FfxDofPxRadToTiles(abs(localCocRange));
the issue is almost entirely resolved. This suggests that the dilation radius is too small, leading to insufficient coverage of the background pixels during the blur pass.