跳至内容

FidelityFX DoF

导航: SDK效果组件

FidelityFX DoF

FidelityFX 景深运行时库。

Defines

FFX_DOF_VERSION_MAJOR

#define FFX_DOF_VERSION_MAJOR (1)

FidelityFX DoF 主版本号。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 39, column 9)

FFX_DOF_VERSION_MINOR

#define FFX_DOF_VERSION_MINOR (1)

FidelityFX DoF 次版本号。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 44, column 9)

FFX_DOF_VERSION_PATCH

#define FFX_DOF_VERSION_PATCH (0)

FidelityFX DoF 修补版本号。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 49, column 9)

FFX_DOF_CONTEXT_COUNT

#define FFX_DOF_CONTEXT_COUNT 1

FidelityFX DoF 上下文计数。

定义了 DOF 所需的内部效果上下文的数量

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 56, column 9)

FFX_DOF_CONTEXT_SIZE

#define FFX_DOF_CONTEXT_SIZE (45674)

以 32 位值为单位指定的上下文大小。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 61, column 9)

函数

ffxDofContextCreate

FFX_API FfxErrorCode ffxDofContextCreate(FfxDofContext *pContext, const FfxDofContextDescription *pContextDescription)

根据 FfxDofContextDescription 结构体中设置的参数,创建一个 FidelityFX 景深上下文。

上下文结构体是与景深 API 交互的主要对象,负责管理 DoF 算法使用的内部资源。调用此 API 时,将通过 backendInterface 结构体中的指针进行多次调用。后端将尝试检索设备功能,并创建 DoF 运行所需的内部资源和管线。根据创建 FfxDofContext 时使用的具体配置,可能会通过回调函数请求不同的资源和管线集。

当不再使用 FfxDofContext 时,应将其销毁,通常是在应用程序卸载或用户禁用 DoF 时。要销毁 DoF 上下文,请调用 ffxDofContextDestroy。

参数

  • pContext (FfxDofContext *) – [输出] 指向要填充的 FfxDofContext 结构体的指针。
  • pContextDescription (const FfxDofContextDescription *) – [输入] 指向 FfxDofContextDescription 结构体的指针。

返回: FFX_API FfxErrorCode

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 169, column 22)

ffxDofContextDispatch

FFX_API FfxErrorCode ffxDofContextDispatch(FfxDofContext *pContext, const FfxDofDispatchDescription *pDispatchDescription)

向 FidelityFX DoF 上下文调度工作。

参数

  • pContext (FfxDofContext *) – [输入] 指向 FfxDofContext 结构体的指针。
  • pDispatchDescription (const FfxDofDispatchDescription *) – [输入] 指向 FfxDofDispatchDescription 结构体的指针。

返回: FFX_API FfxErrorCode

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 184, column 22)

ffxDofContextDestroy

FFX_API FfxErrorCode ffxDofContextDestroy(FfxDofContext *pContext)

销毁 FidelityFX DoF 上下文。

参数

  • pContext (FfxDofContext *) – [输出] 指向要销毁的 FfxDofContext 结构体的指针。

返回: FFX_API FfxErrorCode

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 196, column 22)

ffxDofGetEffectVersion

FFX_API FfxVersionNumber ffxDofGetEffectVersion()

查询效果版本号。

返回: 构建该效果的 SDK 版本。

返回: FFX_API FfxVersionNumber

来源: 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)

根据镜头和投影参数,计算薄透镜模型中的比例参数。

参数

  • aperture (float) – 视角单位中的光圈半径
  • focus (float) – 视角单位中的焦点平面距离
  • focalLength (float) – 视角单位中的镜头焦距
  • conversion (float) – 视角单位到像素的转换因子 (例如,图像宽度像素/传感器尺寸)
  • proj33 (float) – 投影矩阵的 (3,3) 元素 (z 范围缩放)
  • proj34 (float) – 投影矩阵的 (3,4) 元素 (z 范围偏移)
  • proj43 (float) – 投影矩阵的 (4,3) 元素 (通常为 1 或 -1)

返回值: float

属性: static, inline

来源: 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)

根据镜头和投影参数,计算薄透镜模型中的偏差参数。

参数

  • aperture (float) – 视角单位中的光圈半径
  • focus (float) – 视角单位中的焦点平面距离
  • focalLength (float) – 视角单位中的镜头焦距
  • conversion (float) – 视角单位到像素的转换因子 (例如,图像宽度像素/传感器尺寸)
  • proj33 (float) – 投影矩阵的 (3,3) 元素 (又名 z 范围缩放)
  • proj34 (float) – 投影矩阵的 (3,4) 元素 (又名 z 范围偏移)
  • proj43 (float) – 投影矩阵的 (4,3) 元素 (通常为 1 或 -1)

返回值: float

属性: static, inline

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 249, column 21)

枚举

FfxDofPass

enum FfxDofPass

构成 DoF 算法的通道的枚举。

DOF 实现为多个计算通道的组合,每个通道计算最终结果的关键部分。每次调用 FfxDofScheduleGpuJobFunc 回调函数将对应一个包含在 FfxDofPass 中的通道。有关每个通道的更详细说明,请参阅 DoF 参考文档。

FFX_DOF_PASS_DOWNSAMPLE_DEPTH

FFX_DOF_PASS_DOWNSAMPLE_DEPTH = 0

一个下采样深度缓冲区的通道。

FFX_DOF_PASS_DOWNSAMPLE_COLOR

FFX_DOF_PASS_DOWNSAMPLE_COLOR = 1

一个下采样颜色缓冲区的通道。

FFX_DOF_PASS_DILATE

FFX_DOF_PASS_DILATE = 2

一个扩展深度图块缓冲区的通道。

FFX_DOF_PASS_BLUR

FFX_DOF_PASS_BLUR = 3

一个执行景深模糊的通道。

FFX_DOF_PASS_COMPOSITE

FFX_DOF_PASS_COMPOSITE = 4

一个将模糊图像与锐利输入结合的通道。

FFX_DOF_PASS_COUNT

DOF 中的通道数量。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 77, column 1)

FfxDofInitializationFlagBits

enum FfxDofInitializationFlagBits

创建 FfxDofContext 时使用的位标志枚举。请参阅 FfxDofContextDescription。当前没有标志。

FFX_DOF_REVERSE_DEPTH

FFX_DOF_REVERSE_DEPTH = (1 <<0)

一个指示输入深度是否反转的位 (1 为最近)

FFX_DOF_OUTPUT_PRE_INIT

FFX_DOF_OUTPUT_PRE_INIT = (1 <<1)

一个指示输出是否预先初始化为输入颜色的位 (例如,它是同一纹理)

FFX_DOF_DISABLE_RING_MERGE

FFX_DOF_DISABLE_RING_MERGE = (1 <<2)

一个指示是否禁用合并内核环的位。

来源: sdk/include/FidelityFX/host/ffx_dof.h (line 91, column 1)

依赖项: FfxDofContext, FfxDofContextDescription, FfxDofDispatchDescription

© . This site is unofficial and not affiliated with AMD.