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::CompositeFilter Class Reference

Includes bloom, vignette, tone map. More...

Inherits G3D::Film::Filter.

Public Member Functions

 CompositeFilter ()
 
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 override
 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...
 
void maybeUpdateToneCurve (const FilmSettings &settings) const
 

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< Texturem_blended
 Output of blend shader/input to the vertical blur. More...
 
shared_ptr< Texturem_blurry
 float blurred vertical + horizontal More...
 
shared_ptr< Framebufferm_blurryFramebuffer
 
shared_ptr< Framebufferm_framebuffer
 Working framebuffer. More...
 
const ImageFormatm_intermediateFormat
 Used for all buffers except the output. More...
 
shared_ptr< Framebufferm_intermediateResultFramebuffer
 When this is not the final filter in the chain, this framebuffer is used for the output. More...
 
Spline< float > m_lastToneCurve
 
shared_ptr< Framebufferm_postGammaFramebuffer
 Captures the gamma encoded result for input to antialiasing. More...
 
shared_ptr< Texturem_preBloom
 float pre-bloom curve applied More...
 
shared_ptr< Texturem_temp
 float blurred vertical More...
 
shared_ptr< Framebufferm_tempFramebuffer
 
shared_ptr< Framebufferm_toneCurve
 Maps [0, 2] to some output range. More...
 

Detailed Description

Includes bloom, vignette, tone map.

Constructor & Destructor Documentation

◆ CompositeFilter()

G3D::Film::CompositeFilter::CompositeFilter ( )

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
protectedvirtualinherited

Called from apply().

Parameters
name
source
argTarget
sourceDepthGuardBandThickness
fmtFormat for target

Reimplemented in G3D::Film::TAAFilter.

◆ apply()

virtual void G3D::Film::CompositeFilter::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
overridevirtual

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

Implements G3D::Film::Filter.

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

◆ maybeUpdateToneCurve()

void G3D::Film::CompositeFilter::maybeUpdateToneCurve ( const FilmSettings settings) const
protected

Member Data Documentation

◆ m_blended

shared_ptr<Texture> G3D::Film::CompositeFilter::m_blended
mutableprotected

Output of blend shader/input to the vertical blur.

16-bit float.

◆ m_blurry

shared_ptr<Texture> G3D::Film::CompositeFilter::m_blurry
mutableprotected

float blurred vertical + horizontal

◆ m_blurryFramebuffer

shared_ptr<Framebuffer> G3D::Film::CompositeFilter::m_blurryFramebuffer
mutableprotected

◆ m_framebuffer

shared_ptr<Framebuffer> G3D::Film::CompositeFilter::m_framebuffer
mutableprotected

Working framebuffer.

◆ m_intermediateFormat

const ImageFormat* G3D::Film::CompositeFilter::m_intermediateFormat
protected

Used for all buffers except the output.

◆ m_intermediateResultFramebuffer

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

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

◆ m_lastToneCurve

Spline<float> G3D::Film::CompositeFilter::m_lastToneCurve
mutableprotected

◆ m_postGammaFramebuffer

shared_ptr<Framebuffer> G3D::Film::CompositeFilter::m_postGammaFramebuffer
mutableprotected

Captures the gamma encoded result for input to antialiasing.

◆ m_preBloom

shared_ptr<Texture> G3D::Film::CompositeFilter::m_preBloom
mutableprotected

float pre-bloom curve applied

◆ m_temp

shared_ptr<Texture> G3D::Film::CompositeFilter::m_temp
mutableprotected

float blurred vertical

◆ m_tempFramebuffer

shared_ptr<Framebuffer> G3D::Film::CompositeFilter::m_tempFramebuffer
mutableprotected

◆ m_toneCurve

shared_ptr<Framebuffer> G3D::Film::CompositeFilter::m_toneCurve
mutableprotected

Maps [0, 2] to some output range.

◆ target

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

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


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