Applies an approximate gaussian blur using a dual filtering approach.
More...
#include <GaussianBlur.hpp>
|
| void | resize (uint width, uint height) |
| |
|
|
Program * | _blurProgramDown |
| | The downscaling filter.
|
| |
|
Program * | _blurProgramUp |
| | The upscaling filter.
|
| |
|
Program * | _passthrough |
| | The copy program.
|
| |
|
std::vector< Texture > | _levels |
| | Downscaled pyramid textures.
|
| |
|
uint | _downscale = 1 |
| | Initial downscaling factor.
|
| |
Applies an approximate gaussian blur using a dual filtering approach.
Use a downscaled pyramid approach to approximate a gaussian blur with a large radius. The input texture is downscaled a number of times, using a custom filter as described by Marius Bjørge in the 'Bandwidth-Efficient Rendering' presentation, Siggraph 2015 (https://community.arm.com/cfs-file/__key/communityserver-blogs-components-weblogfiles/00-00-00-20-66/siggraph2015_2D00_mmg_2D00_marius_2D00_slides.pdf). The image is then upscaled again with a second custom filter.
- See also
- GPU::Frag::Blur-dual-filter-down, GPU::Frag::Blur-dual-filter-up
◆ GaussianBlur()
| GaussianBlur::GaussianBlur |
( |
uint |
radius, |
|
|
uint |
downscale, |
|
|
const std::string & |
name |
|
) |
| |
Constructor. The depth of the gaussian pyramid will determine the strength of the blur, and the computational cost.
- Parameters
-
| radius | the number of levels in the downscaling pyramid |
| downscale | work at a lower resolution than the target texture |
| name | debug name for internal buffers |
◆ process()
Apply the blurring process to a given texture.
- Note
- It is possible to use the same texture as input and output.
- Parameters
-
| src | the ID of the texture to process |
| dst | the destination texture |
◆ resize()
| void GaussianBlur::resize |
( |
uint |
width, |
|
|
uint |
height |
|
) |
| |
|
private |
Handle screen resizing if needed.
- Parameters
-
| width | the new width to use |
| height | the new height to use |
The documentation for this class was generated from the following files: