Support Forum       G3D Web Page     
Classes | Public Member Functions | Protected Attributes | List of all members
G3D::TemporalFilter Class Reference

A simple helper class for temporally filtering a screen-space buffer filled with world-space data. More...

Classes

class  Settings
 

Public Member Functions

shared_ptr< Textureapply (RenderDevice *rd, const shared_ptr< Camera > &camera, const shared_ptr< Texture > &unfilteredValue, const shared_ptr< Texture > &depth, const shared_ptr< Texture > &ssVelocity, const Vector2 &guardBandSize, int numFilterComponents=4, const Settings &settings=Settings())
 Do not modify the return value; it is used to write into for the next iteration. More...
 
shared_ptr< Textureapply (RenderDevice *rd, const Vector3 &clipConstant, const Vector4 &projConstant, const CoordinateFrame &currentCameraFrame, const CoordinateFrame &prevCameraFrame, const shared_ptr< Texture > &unfilteredValue, const shared_ptr< Texture > &depth, const shared_ptr< Texture > &ssVelocity, const Vector2 &guardBandSize, int numFilterComponents=4, const Settings &settings=Settings())
 
const shared_ptr< Texture > & previousTexture () const
 

Protected Attributes

shared_ptr< Texturem_previousDepthBuffer
 A copy of the previous depth buffer from the last run of this filter. More...
 
shared_ptr< Texturem_previousTexture
 The last result of using this filter. More...
 
shared_ptr< Framebufferm_resultFramebuffer
 

Detailed Description

A simple helper class for temporally filtering a screen-space buffer filled with world-space data.

This is designed to be simple to use, not to maximize speed. Directly use functions from temporalFiler.glsl in a full-screen pass instead of using this class if performance or memory is a concern.

Member Function Documentation

◆ apply() [1/2]

shared_ptr<Texture> G3D::TemporalFilter::apply ( RenderDevice rd,
const shared_ptr< Camera > &  camera,
const shared_ptr< Texture > &  unfilteredValue,
const shared_ptr< Texture > &  depth,
const shared_ptr< Texture > &  ssVelocity,
const Vector2 guardBandSize,
int  numFilterComponents = 4,
const Settings settings = Settings() 
)

Do not modify the return value; it is used to write into for the next iteration.

numFilterComponents must be 1, 2, 3, or 4. The first numFilterComponents components will be blended according to the temporal filter, the rest will simply be copied from the current value buffer. This is useful if the signal you are filtering is only in the first N components.

If alpha = 0.0f, this directly returns unfilteredValue.

◆ apply() [2/2]

shared_ptr<Texture> G3D::TemporalFilter::apply ( RenderDevice rd,
const Vector3 clipConstant,
const Vector4 projConstant,
const CoordinateFrame currentCameraFrame,
const CoordinateFrame prevCameraFrame,
const shared_ptr< Texture > &  unfilteredValue,
const shared_ptr< Texture > &  depth,
const shared_ptr< Texture > &  ssVelocity,
const Vector2 guardBandSize,
int  numFilterComponents = 4,
const Settings settings = Settings() 
)

◆ previousTexture()

const shared_ptr<Texture>& G3D::TemporalFilter::previousTexture ( ) const
inline

Member Data Documentation

◆ m_previousDepthBuffer

shared_ptr<Texture> G3D::TemporalFilter::m_previousDepthBuffer
protected

A copy of the previous depth buffer from the last run of this filter.

◆ m_previousTexture

shared_ptr<Texture> G3D::TemporalFilter::m_previousTexture
protected

The last result of using this filter.

If null, or the wrong size/format, we will construct a new texture and copy the current value into it on apply()

Referenced by previousTexture().

◆ m_resultFramebuffer

shared_ptr<Framebuffer> G3D::TemporalFilter::m_resultFramebuffer
protected

documentation generated on Wed Nov 24 2021 08:02:01 using doxygen 1.8.15