Rendu
A lightweight rendering engine for experimentations
|
Applies a box blur of fixed radius 2. Correspond to uniformly averaging values over a 5x5 square window. More...
#include <BoxBlur.hpp>
Public Member Functions | |
BoxBlur (bool approximate, const std::string &name) | |
void | process (const Texture &src, Texture &dst) |
Private Member Functions | |
void | resize (uint width, uint height) |
Private Attributes | |
Program * | _blur2D |
Box blur program. | |
Program * | _blurArray |
Box blur program. | |
Program * | _blurCube |
Box blur program. | |
Program * | _blurCubeArray |
Box blur program. | |
Texture | _intermediate |
Intermediate texture. | |
Applies a box blur of fixed radius 2. Correspond to uniformly averaging values over a 5x5 square window.
An approximate (checkboard pattern) version doing half as many fetches is available. his blur can be applied to 2D, cubemap, 2D arrays and cubemap arrays textures.
BoxBlur::BoxBlur | ( | bool | approximate, |
const std::string & | name | ||
) |
Constructor. Can use either an exhaustive 5x5 box blur (25 samples) or an approximate version with a checkerboard pattern (13 samples).
approximate | toggles the approximate box blur |
name | debug name for internal buffers |
Apply the blurring process to a given texture. 2D, cubemap and their array versions are supported.
src | the ID of the texture to process |
dst | the destination texture |
|
private |
Handle screen resizing if needed.
width | the new width to use |
height | the new height to use |