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

Apply an approximate bilateral blur to a texture. This can be used to blur while preserving edges, or even to upscale and blur a small texture. The approximate implementation in Rendu is based on the one demonstrated in G3D (McGuire M., Mara M., Majercik Z., http://casual-effects.com/g3d, 2017), and relies on a separable Gaussian blur with adjusted weights and an extra step distance. More...

#include <BilateralBlur.hpp>

Public Member Functions

 BilateralBlur (const std::string &name)
 
void process (const glm::mat4 &projection, const Texture &src, const Texture &depthTex, const Texture &normalTex, Texture &dst)
 

Private Member Functions

void resize (uint width, uint height)
 

Private Attributes

Texture _intermediate
 Intermediate texture.
 
Program_filter
 Bilateral hader.
 

Detailed Description

Apply an approximate bilateral blur to a texture. This can be used to blur while preserving edges, or even to upscale and blur a small texture. The approximate implementation in Rendu is based on the one demonstrated in G3D (McGuire M., Mara M., Majercik Z., http://casual-effects.com/g3d, 2017), and relies on a separable Gaussian blur with adjusted weights and an extra step distance.

Constructor & Destructor Documentation

◆ BilateralBlur()

BilateralBlur::BilateralBlur ( const std::string &  name)

Constructor.

Parameters
namedebug name for internal buffers

Member Function Documentation

◆ process()

void BilateralBlur::process ( const glm::mat4 &  projection,
const Texture src,
const Texture depthTex,
const Texture normalTex,
Texture dst 
)

Apply the bilateral blur to a texture and write the result in a texture.

Note
It is possible to use the same texture as input and output.
Parameters
projectionthe camera projection matrix
srcthe texture to blur/upscale
depthTexthe depth texture
normalTexthe view-space normal texture
dstthe destination texture

◆ resize()

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

Resize the internal intermediate buffers.

Parameters
widththe new resolution width
heightthe new resolution height

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