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()
|
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.
- 参数
-
source Linear HDR scene color. hwDepth Hardware depth (NDC z in .r). Null disables the effect. focusDistance View-space focus plane distance. maxBlurPx Maximum blur radius in source texels; <= 0 disables. focusRange Distance from focus at which blur reaches maxBlurPx. nearZ Camera near clip. farZ Camera far clip.
- 返回
- Blurred HDR texture owned by this DepthOfField, or
sourcewhen 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.
该类的文档由以下文件生成:
- src/modules/graphics/DepthOfField.h
- src/modules/graphics/DepthOfField.cpp