FidelityFX-SDK icon indicating copy to clipboard operation
FidelityFX-SDK copied to clipboard

[Bug][DOF] Visible artifacts with high blur radius

Open Witek902 opened this issue 1 year ago • 0 comments

Problem: At high blur radii, visible artifacts appear around objects that are in focus, as shown in the image below: image

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: image image

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.

Witek902 avatar Dec 06 '24 15:12 Witek902