FidelityFX DOF

FidelityFX Depth of Field GPU documentation.

Functions

Return type

Description

void

FfxDofBlur (FfxUInt32x2 pixel, FfxUInt32x2 halfImageSize)
Blur pass entry point. Runs in 8x8x1 thread groups and computes transient near and far outputs.

void

FfxDofCombineHalfRes ( FfxUInt32x2 threadID, FfxUInt32x2 groupThreadID, FfxUInt32x2 group, FfxUInt32 index, FfxUInt32x2 halfImageSize, FfxUInt32x2 fullImageSize )
Entry point. Meant to run in 8×8 threads and writes 16×16 output pixels.

void

Entry point for the dilate pass.

FfxFloat32x4

Bilateral downsampling function, full-precision version.

void

DownsampleColor (FfxUInt32 LocalThreadId, FfxUInt32x2 WorkGroupId)
Entry point for the downsample color pass. Uses SPD internally.

void

Entry point for depth downsample function. SPD is not used for this, since we only need one specific downsampled resolution.

Macros

Name

Description

FFX_DOF_OPTION_MAX_MIP 4

The number of mips that should be generated in the color downsample pass.

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.

Detailed description

FidelityFX Depth of Field GPU documentation.

Global functions

FfxDofBlur

Copied!

void FfxDofBlur (FfxUInt32x2  pixel, FfxUInt32x2  halfImageSize)

Blur pass entry point. Runs in 8x8x1 thread groups and computes transient near and far outputs.

Parameters:

pixel

Coordinate of the pixel (SV_DispatchThreadID)

halfImageSize

Resolution of the source image (half resolution) in pixels


FfxDofCombineHalfRes

Copied!

void FfxDofCombineHalfRes (
    FfxUInt32x2  threadID,
    FfxUInt32x2  groupThreadID,
    FfxUInt32x2  group,
    FfxUInt32  index,
    FfxUInt32x2  halfImageSize,
    FfxUInt32x2  fullImageSize
)

Entry point. Meant to run in 8×8 threads and writes 16×16 output pixels.

Parameters:

threadID

SV_DispatchThreadID.xy

groupThreadID

SV_GroupThreadID.xy

group

SV_GroupID.xy

index

SV_GroupIndex

halfImageSize

Pixel size of the input (half resolution)

fullImageSize

Pixel size of the output (full resolution)


FfxDofDilate

Copied!

void FfxDofDilate (FfxUInt32x2  tile, FfxUInt32x2  imageSize)

Entry point for the dilate pass.

Parameters:

tile

Coordinate of the tile to run on (SV_DispatchThreadID)

imageSize

Resolution of the depth image (full resolution)


FfxDofDownsampleQuad

Copied!

FfxFloat32x4  FfxDofDownsampleQuad (
    FfxFloat32x4  v0,
    FfxFloat32x4  v1,
    FfxFloat32x4  v2,
    FfxFloat32x4  v3
)

Bilateral downsampling function, full-precision version.


DownsampleColor

Copied!

void DownsampleColor (FfxUInt32  LocalThreadId, FfxUInt32x2  WorkGroupId)

Entry point for the downsample color pass. Uses SPD internally.

Parameters:

LocalThreadId

Thread index in thread group (SV_GroupIndex)

WorkGroupId

Coordinate of the tile (SV_GroupID.xy)


DownsampleDepth

Copied!

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

coordinate of the tile to run on (SV_DispatchThreadID)

imageSize

Size of the depth image (full resolution)


Macros

FFX_DOF_OPTION_MAX_MIP

Copied!

#define FFX_DOF_OPTION_MAX_MIP 4

The number of mips that should be generated in the color downsample pass.


FFX_DOF_OPTION_MAX_RING_MERGE_LOG

Copied!

#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.