FidelityFX Depth of Field

This sample demonstrates the use of the FidelityFX Depth of Field effect.

For details on the techniques that underpin the Depth of Field effect you can refer to the respective technique documentation .

Requirements

  • Windows

  • DirectX(R)12

  • Vulkan(R)

UI elements

The sample contains various UI elements to help you explore the technique it demonstrates. The table below summarises the UI elements and what they control within the sample.

Element name

Value

Description

Aperture

0...0.1

Simulated camera aperture radius in meters. At zero, a pinhole camera is simulated, which has no depth of field.

Sensor Size

0...0.1

Simulated camera sensor width in meters. This is used along with the field of view for calculating focal length.

Focus Distance

Range dynamically adjusted to scene

Distance from the camera at which objects will be in focus.

Quality

1..50

Maximum number of sample rings used in the blur kernel.

Blur Size Limit

0...1

Maximum blur radius in multiples of y resolution. 0.02 means ~20px at 1080p or ~40px at 4K.

Enable Kernel Ring Merging

Checked, Unchecked

Controls whether the inner rings of the blur kernel may be merged for better performance.

Setting up FidelityFX Depth of Field

The sample contains a render module for DOF which manages context lifecycle and dispatch. As it’s a post-processing effect it takes only the color and depth buffers as inputs.

The output is produced in-place (in the same color buffer) as an optimization. Before dispatch, the scale and bias parameters for computing the circle of confusion are calculated using helper functions provided in the SDK.

Sample Controls and Configurations

For sample controls, configuration, and FidelityFX Cauldron Framework UI element details, see Running the samples .

See also

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!