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

Applies an approximate gaussian blur using a dual filtering approach. More...

#include <GaussianBlur.hpp>

Public Member Functions

 GaussianBlur (uint radius, uint downscale, const std::string &name)
 
void process (const Texture &src, Texture &dst)
 

Private Member Functions

void resize (uint width, uint height)
 

Private Attributes

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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ 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
radiusthe number of levels in the downscaling pyramid
downscalework at a lower resolution than the target texture
namedebug name for internal buffers

Member Function Documentation

◆ process()

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

Apply the blurring process to a given texture.

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 GaussianBlur::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: