Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BoxBlur Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ BoxBlur()

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).

Parameters
approximatetoggles the approximate box blur
namedebug name for internal buffers

Member Function Documentation

◆ process()

void BoxBlur::process ( const Texture src,
Texture dst 
)

Apply the blurring process to a given texture. 2D, cubemap and their array versions are supported.

Note
It is possible to use the same texture as input and output.
Parameters
srcthe ID of the texture to process
dstthe destination texture

◆ resize()

void BoxBlur::resize ( uint  width,
uint  height 
)
private

Handle screen resizing if needed.

Parameters
widththe new width to use
heightthe new height to use

The documentation for this class was generated from the following files: