Linear-HDR bloom pyramid with selectable Karis/tent or Gaussian/scatter reconstruction. 更多...
#include <Bloom.h>
Public 成员函数 | |
| Bloom (Graphics *gfx) | |
| Create the cross-backend bloom shaders. | |
| Result< void > | configureFilter (const BloomFilterSettings &settings) |
| Select a reconstruction filter for subsequent builds. | |
| BloomFilterSettings | filterSettings () const |
| Return a value snapshot. Render thread only; retains no references. | |
| Texture * | build (Texture *source, float threshold, float scatter=1.f) |
| Build the selected bloom pyramid from an HDR source. | |
| Texture * | apply (Texture *source, float intensity, float threshold, float scatter=1.f) |
| Add the reconstructed bloom to the HDR source in a full-size target. | |
详细描述
Linear-HDR bloom pyramid with selectable Karis/tent or Gaussian/scatter reconstruction.
The returned texture remains owned by Graphics and is valid until the source dimensions change or Graphics is destroyed.
构造及析构函数说明
◆ Bloom()
|
explicit |
Create the cross-backend bloom shaders.
引用了 eve::graphics::Shader::declareFloat(), eve::graphics::shaders::kBloomDownsample , 以及 eve::graphics::shaders::kBloomUpsample.
成员函数说明
◆ apply()
| Texture * eve::graphics::Bloom::apply | ( | Texture * | source, |
| float | intensity, | ||
| float | threshold, | ||
| float | scatter = 1.f |
||
| ) |
Add the reconstructed bloom to the HDR source in a full-size target.
- 参数
-
source Linear HDR source texture. intensity Bloom contribution multiplier. threshold Linear soft-knee threshold. scatter Tent reconstruction radius.
- 返回
- Full-resolution linear HDR source plus bloom. @lifetime The returned texture is owned by this Bloom and remains valid until its targets resize.
引用了 eve::Additive, build(), eve::graphics::Canvas::clear(), eve::graphics::Graphics::drawTexturedRectShaderUV(), eve::graphics::BloomFilterSettings::filter, eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getTexture(), eve::graphics::KarisTent, eve::Opaque, previous, eve::graphics::Graphics::setCanvas() , 以及 source.
◆ build()
Build the selected bloom pyramid from an HDR source.
- 参数
-
source Linear HDR source texture. threshold Linear soft-knee threshold. scatter Tent reconstruction radius in source texels; Gaussian uses filterSettings().scatter.
- 返回
- Reconstructed half-resolution linear HDR bloom texture. @lifetime The returned texture is owned by this Bloom and remains valid until its targets resize.
引用了 eve::Additive, eve::graphics::Graphics::drawTexturedRectShaderUV(), eve::graphics::BloomFilterSettings::filter, eve::graphics::Graphics::getCanvas(), eve::graphics::Canvas::getHeight(), eve::graphics::Canvas::getWidth(), input, eve::graphics::KarisTent, eve::Opaque, previous, eve::graphics::Graphics::setCanvas(), source , 以及 target.
被这些函数引用 apply().
◆ configureFilter()
| Result< void > eve::graphics::Bloom::configureFilter | ( | const BloomFilterSettings & | settings | ) |
Select a reconstruction filter for subsequent builds.
- 返回
- InvalidArgument without mutation for invalid settings, success otherwise. @ownership Copies settings; GPU targets remain owned by Graphics.
- @thread Render thread only; invokes no callbacks. Target allocation is deferred to build.
在文件 BloomGaussian.cpp 第 27 行定义.
引用了 eve::Result< T >::failure(), settings, eve::Result< T >::success(), valid , 以及 eve::graphics::validateBloomFilterSettings().
被这些函数引用 eve::graphics::detail::exposeShaderResourceBindings().
◆ filterSettings()
|
inline |
Return a value snapshot. Render thread only; retains no references.
被这些函数引用 eve::graphics::detail::exposeShaderResourceBindings().
该类的文档由以下文件生成:
- src/modules/graphics/Bloom.h
- src/modules/graphics/Bloom.cpp
- src/modules/graphics/BloomGaussian.cpp