载入中...
搜索中...
未找到
eve::graphics::DepthOfField类 参考

Separable Gaussian depth-of-field for the final HDR scene. 更多...

#include <DepthOfField.h>

Public 成员函数

 DepthOfField (Graphics *gfx)
 Create the cross-backend DOF shaders.
 
Texture * apply (Texture *source, Texture *hwDepth, float focusDistance, float maxBlurPx, float focusRange, float nearZ, float farZ)
 Apply separable Gaussian DOF.
 

详细描述

Separable Gaussian depth-of-field for the final HDR scene.

Reads linear HDR color plus hardware depth (Vulkan NDC z). Blur radius grows with view-space distance from focusDistance over focusRange, capped at maxBlurPx. Zero max blur is a no-op. Used by HD-2D miniature looks; sprites must write depth (masked/cutout) so characters stay sharp in the focus band.

在文件 DepthOfField.h 第 18 行定义.

构造及析构函数说明

◆ DepthOfField()

eve::graphics::DepthOfField::DepthOfField ( Graphics *  gfx)
explicit

Create the cross-backend DOF shaders.

在文件 DepthOfField.cpp 第 45 行定义.

成员函数说明

◆ apply()

Texture * eve::graphics::DepthOfField::apply ( Texture *  source,
Texture *  hwDepth,
float  focusDistance,
float  maxBlurPx,
float  focusRange,
float  nearZ,
float  farZ 
)

Apply separable Gaussian DOF.

参数
sourceLinear HDR scene color.
hwDepthHardware depth (NDC z in .r). Null disables the effect.
focusDistanceView-space focus plane distance.
maxBlurPxMaximum blur radius in source texels; <= 0 disables.
focusRangeDistance from focus at which blur reaches maxBlurPx.
nearZCamera near clip.
farZCamera far clip.
返回
Blurred HDR texture owned by this DepthOfField, or source when disabled. @lifetime Returned texture remains valid until dimensions change or this object is destroyed.

在文件 DepthOfField.cpp 第 76 行定义.

引用了 eve::graphics::Canvas::clear(), eve::graphics::Graphics::drawTexturedRectShaderDepth(), eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getTexture(), previous, eve::graphics::Graphics::setCanvas() , 以及 source.


该类的文档由以下文件生成: