Support Forum       G3D Web Page     
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
G3D::Film::Filter Class Referenceabstract

Filters may cache state for performance, so each Film must have its own set. More...

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::Film::CompositeFilter, G3D::Film::DebugZoomFilter, G3D::Film::EffectsDisabledBlitFilter, G3D::Film::FXAAFilter, G3D::Film::TAAFilter, and G3D::Film::WideAAFilter.

Public Member Functions

virtual void apply (RenderDevice *rd, const FilmSettings &settings, const shared_ptr< Texture > &source, const shared_ptr< Texture > &motion, const shared_ptr< Framebuffer > &target, int sourceTrimBandThickness, int sourceColorBandThickness) const =0
 Apply the filter to source, writing to target. More...
 

Public Attributes

shared_ptr< Framebuffertarget
 Set and sized by allocate() when called from apply() More...
 

Protected Member Functions

virtual void allocate (const String &name, const shared_ptr< Texture > &source, const shared_ptr< Framebuffer > &argTarget, int sourceDepthGuardBandThickness, const ImageFormat *fmt=ImageFormat::RGBA8()) const
 Called from apply(). More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Protected Attributes

shared_ptr< Framebufferm_intermediateResultFramebuffer
 When this is not the final filter in the chain, this framebuffer is used for the output. More...
 

Detailed Description

Filters may cache state for performance, so each Film must have its own set.

Member Function Documentation

◆ allocate()

virtual void G3D::Film::Filter::allocate ( const String name,
const shared_ptr< Texture > &  source,
const shared_ptr< Framebuffer > &  argTarget,
int  sourceDepthGuardBandThickness,
const ImageFormat fmt = ImageFormat::RGBA8() 
) const
protectedvirtual

Called from apply().

Parameters
name
source
argTarget
sourceDepthGuardBandThickness
fmtFormat for target

Reimplemented in G3D::Film::TAAFilter.

◆ apply()

virtual void G3D::Film::Filter::apply ( RenderDevice rd,
const FilmSettings settings,
const shared_ptr< Texture > &  source,
const shared_ptr< Texture > &  motion,
const shared_ptr< Framebuffer > &  target,
int  sourceTrimBandThickness,
int  sourceColorBandThickness 
) const
pure virtual

Apply the filter to source, writing to target.

The CompositeFilter and EffectsDisabledBlitFilter expect a guard band (if there is one specified in settings) on the input and produce output without a guard band. All other filters assume no guard band on input or output (and assert that). This works because exactly one of CompositeFilter or EffectsDisabledBlitFilter is always in the filter chain and always at the front.

If target is null, then all filters allocate an output that is the same size as the input (except for CompositeFilter removing the guard band). If target is not null, then the output is stretched to the size of target using bilinear interpolation.

Parameters
targetIf null, allocate intermediateResultFramebuffer and set this->target to it. If not null, set this->target = target

Implemented in G3D::Film::EffectsDisabledBlitFilter, G3D::Film::DebugZoomFilter, G3D::Film::WideAAFilter, G3D::Film::TAAFilter, G3D::Film::FXAAFilter, and G3D::Film::CompositeFilter.

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

Member Data Documentation

◆ m_intermediateResultFramebuffer

shared_ptr<Framebuffer> G3D::Film::Filter::m_intermediateResultFramebuffer
mutableprotected

When this is not the final filter in the chain, this framebuffer is used for the output.

◆ target

shared_ptr<Framebuffer> G3D::Film::Filter::target
mutable

Set and sized by allocate() when called from apply()


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