FidelityFX DoF
Navigation: SDK → Effect Components
FidelityFX DoF
FidelityFX Depth of Field runtime library.
Defines
FFX_DOF_VERSION_MAJOR
#define FFX_DOF_VERSION_MAJOR (1)
FidelityFX DOF major version.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 39, column 9)
FFX_DOF_VERSION_MINOR
#define FFX_DOF_VERSION_MINOR (1)
FidelityFX DOF minor version.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 44, column 9)
FFX_DOF_VERSION_PATCH
#define FFX_DOF_VERSION_PATCH (0)
FidelityFX DOF patch version.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 49, column 9)
FFX_DOF_CONTEXT_COUNT
#define FFX_DOF_CONTEXT_COUNT 1
FidelityFX DOF context count.
Defines the number of internal effect contexts required by DOF
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 56, column 9)
FFX_DOF_CONTEXT_SIZE
#define FFX_DOF_CONTEXT_SIZE (45674)
The size of the context specified in 32bit values.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 61, column 9)
Functions
ffxDofContextCreate
FFX_API FfxErrorCode ffxDofContextCreate(FfxDofContext *pContext, const FfxDofContextDescription *pContextDescription)
Create a FidelityFX Depth of Field context from the parameters programmed to the FfxDofContextDescription structure.
The context structure is the main object used to interact with the Depth of Field API, and is responsible for the management of the internal resources used by the DoF algorithm. When this API is called, multiple calls will be made via the pointers contained in the backendInterface structure. This backend will attempt to retrieve the device capabilities, and create the internal resources, and pipelines required by DoF to function. Depending on the precise configuration used when creating the FfxDofContext a different set of resources and pipelines might be requested via the callback functions.
The FfxDofContext should be destroyed when use of it is completed, typically when an application is unloaded or DoF is disabled by a user. To destroy the DoF context you should call ffxDofContextDestroy.
Parameters:
pContext
(FfxDofContext *
) – [out] A pointer to a FfxDofContext structure to populate.pContextDescription
(const FfxDofContextDescription *
) – [in] A pointer to a FfxDofContextDescription structure.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 169, column 22)
ffxDofContextDispatch
FFX_API FfxErrorCode ffxDofContextDispatch(FfxDofContext *pContext, const FfxDofDispatchDescription *pDispatchDescription)
Dispatches work to the FidelityFX DoF context.
Parameters:
pContext
(FfxDofContext *
) – [in] A pointer to a FfxDofContext structure.pDispatchDescription
(const FfxDofDispatchDescription *
) – [in] A pointer to a FfxDofDispatchDescription structure.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 184, column 22)
ffxDofContextDestroy
FFX_API FfxErrorCode ffxDofContextDestroy(FfxDofContext *pContext)
Destroy the FidelityFX DoF context.
Parameters:
pContext
(FfxDofContext *
) – [out] A pointer to a FfxDofContext structure to destroy.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 196, column 22)
ffxDofGetEffectVersion
FFX_API FfxVersionNumber ffxDofGetEffectVersion()
Queries the effect version number.
Returns: The SDK version the effect was built with.
Returns: FFX_API FfxVersionNumber
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 204, column 26)
ffxDofCalculateCocScale
inline static float ffxDofCalculateCocScale(float aperture, float focus, float focalLength, float conversion, float proj33, float proj34, float proj43)
Calculates the scale parameter in the thin lens model according to lens and projection parameters.
Parameters:
aperture
(float
) – Aperture radius in view space unitsfocus
(float
) – Distance to focus plane in view space unitsfocalLength
(float
) – Lens focal length in view space unitsconversion
(float
) – Conversion factor for view units to pixels (i.e. image width in pixels / sensor size)proj33
(float
) – Element (3,3) of the projection matrix (z range scale)proj34
(float
) – Element (3,4) of the projection matrix (z range offset)proj43
(float
) – Element (4,3) of the projection matrix (typically 1 or -1)
Returns: float
Attributes: static
, inline
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 221, column 21)
ffxDofCalculateCocBias
inline static float ffxDofCalculateCocBias(float aperture, float focus, float focalLength, float conversion, float proj33, float proj34, float proj43)
Calculates the bias parameter in the thin lens model according to lens and projection parameters.
Parameters:
aperture
(float
) – Aperture radius in view space unitsfocus
(float
) – Distance to focus plane in view space unitsfocalLength
(float
) – Lens focal length in view space unitsconversion
(float
) – Conversion factor for view units to pixels (i.e. image width in pixels / sensor size)proj33
(float
) – Element (3,3) of the projection matrix (a.k.a. z range scale)proj34
(float
) – Element (3,4) of the projection matrix (a.k.a. z range offset)proj43
(float
) – Element (4,3) of the projection matrix (typically 1 or -1)
Returns: float
Attributes: static
, inline
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 249, column 21)
Enumerations
FfxDofPass
enum FfxDofPass
An enumeration of the passes which constitute the DoF algorithm.
DOF is implemented as a composite of several compute passes each computing a key part of the final result. Each call to the FfxDofScheduleGpuJobFunc callback function will correspond to a single pass included in FfxDofPass. For a more comprehensive description of each pass, please refer to the DoF reference documentation.
Values:
FFX_DOF_PASS_DOWNSAMPLE_DEPTH
FFX_DOF_PASS_DOWNSAMPLE_DEPTH = 0
A pass which downsamples the depth buffer.
FFX_DOF_PASS_DOWNSAMPLE_COLOR
FFX_DOF_PASS_DOWNSAMPLE_COLOR = 1
A pass which downsamples the color buffer.
FFX_DOF_PASS_DILATE
FFX_DOF_PASS_DILATE = 2
A pass which dilates the depth tile buffer.
FFX_DOF_PASS_BLUR
FFX_DOF_PASS_BLUR = 3
A pass which performs the depth of field blur.
FFX_DOF_PASS_COMPOSITE
FFX_DOF_PASS_COMPOSITE = 4
A pass which combines the blurred images with the sharp input.
FFX_DOF_PASS_COUNT
The number of passes in DOF.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 77, column 1)
FfxDofInitializationFlagBits
enum FfxDofInitializationFlagBits
An enumeration of bit flags used when creating a FfxDofContext. See FfxDofContextDescription. Curently, no flags exist.
Values:
FFX_DOF_REVERSE_DEPTH
FFX_DOF_REVERSE_DEPTH = (1 <<0)
A bit indicating whether input depth is reversed (1 is closest)
FFX_DOF_OUTPUT_PRE_INIT
FFX_DOF_OUTPUT_PRE_INIT = (1 <<1)
A bit indicating whether the output is pre-initialized with the input color (e.g. it is the same texture)
FFX_DOF_DISABLE_RING_MERGE
FFX_DOF_DISABLE_RING_MERGE = (1 <<2)
A bit indicating whether to disable merging kernel rings.
Source: sdk/include/FidelityFX/host/ffx_dof.h
(line 91, column 1)
Dependencies: FfxDofContext, FfxDofContextDescription, FfxDofDispatchDescription