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.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNA™ 2 GPUs, AMD Ryzen™ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!