FidelityFX DOF
Navigation: SDK → GPU → FidelityFX GPU References
FidelityFX DOF
FidelityFX Depth of Field GPU documentation.
Defines
FFX_DOF_OPTION_MAX_MIP
#define FFX_DOF_OPTION_MAX_MIP 4
The number of mips that should be generated in the color downsample pass.
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_common.h
(line 45, column 9)
FFX_DOF_OPTION_MAX_RING_MERGE_LOG
#define FFX_DOF_OPTION_MAX_RING_MERGE_LOG 1
The base-2 logarithm of the number of blur kernel rings that may be merged, if possible.
Setting this to zero disables ring merging.
Values above 1 are technically valid, but are known to cause a visible quality drop.
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_common.h
(line 56, column 9)
Functions
FfxDofBlur
void FfxDofBlur(FfxUInt32x2 pixel, FfxUInt32x2 halfImageSize)
Blur pass entry point. Runs in 8x8x1 thread groups and computes transient near and far outputs.
Parameters:
pixel
(FfxUInt32x2
) – Coordinate of the pixel (SV_DispatchThreadID)halfImageSize
(FfxUInt32x2
) – Resolution of the source image (half resolution) in pixels
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_blur.h
(line 633, column 6)
FfxDofCombineHalfRes
void FfxDofCombineHalfRes(FfxUInt32x2 threadID, FfxUInt32x2 groupThreadID, FfxUInt32x2 group, FfxUInt32 index, FfxUInt32x2 halfImageSize, FfxUInt32x2 fullImageSize)
Entry point. Meant to run in 8x8 threads and writes 16x16 output pixels.
Parameters:
threadID
(FfxUInt32x2
) – SV_DispatchThreadID.xygroupThreadID
(FfxUInt32x2
) – SV_GroupThreadID.xygroup
(FfxUInt32x2
) – SV_GroupID.xyindex
(FfxUInt32
) – SV_GroupIndexhalfImageSize
(FfxUInt32x2
) – Pixel size of the input (half resolution)fullImageSize
(FfxUInt32x2
) – Pixel size of the output (full resolution)
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_composite.h
(line 608, column 6)
FfxDofDilate
void FfxDofDilate(FfxUInt32x2 tile, FfxUInt32x2 imageSize)
Entry point for the dilate pass.
Parameters:
tile
(FfxUInt32x2
) – Coordinate of the tile to run on (SV_DispatchThreadID)imageSize
(FfxUInt32x2
) – Resolution of the depth image (full resolution)
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_dilate_depth.h
(line 58, column 6)
FfxDofDownsampleQuad
FfxFloat32x4 FfxDofDownsampleQuad(FfxFloat32x4 v0, FfxFloat32x4 v1, FfxFloat32x4 v2, FfxFloat32x4 v3)
Bilateral downsampling function, full-precision version.
Parameters:
Name | Type | Default |
---|---|---|
v0 | FfxFloat32x4 | “ |
v1 | FfxFloat32x4 | “ |
v2 | FfxFloat32x4 | “ |
v3 | FfxFloat32x4 | “ |
Returns: FfxFloat32x4
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_downsample_color.h
(line 128, column 14)
DownsampleColor
void DownsampleColor(FfxUInt32 LocalThreadId, FfxUInt32x2 WorkGroupId)
Entry point for the downsample color pass. Uses SPD internally.
Parameters:
LocalThreadId
(FfxUInt32
) – Thread index in thread group (SV_GroupIndex)WorkGroupId
(FfxUInt32x2
) – Coordinate of the tile (SV_GroupID.xy)
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_downsample_color.h
(line 169, column 6)
DownsampleDepth
void DownsampleDepth(FfxUInt32x2 tile, FfxUInt32x2 imageSize)
Entry point for depth downsample function. SPD is not used for this, since we only need one specific downsampled resolution.
Parameters:
tile
(FfxUInt32x2
) – coordinate of the tile to run on (SV_DispatchThreadID)imageSize
(FfxUInt32x2
) – Size of the depth image (full resolution)
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_downsample_depth.h
(line 44, column 6)
Variables
FFX_STATIC const FfxUInt32 FFX_DOF_DEPTH_TILE_SIZE
FFX_STATIC const FfxUInt32 FFX_DOF_DEPTH_TILE_SIZE = = 8
The width/height of tiles storing per-tile min and max CoC. The blur pass needs to run at a compatible tile size, so that the assumption that min/max CoC is uniform for all threads in a thread group holds.
Source: sdk/include/FidelityFX/gpu/dof/ffx_dof_common.h
(line 38, column 28)