PostEffect

Engine/source/postFx/postEffect.h

More...

Classes:

Callbacks

DECLARE_CALLBACK(void , preProcess , () )
DECLARE_CALLBACK(void , setShaderConsts , () )
DECLARE_CALLBACK(bool , onEnabled , () )
DECLARE_CALLBACK(void , onDisabled , () )

Public Types

enum
_Anonymous_ {  NumTextures = 8
}
enum
PostEffectRequirements {
  RequiresDepth = BIT(0)
  RequiresNormals = BIT(1)
  RequiresLightInfo = BIT(2)
}

Protected Types

enum
_Anonymous_ {
  NormalTextureType = 0
  CubemapType 
  CubemapArrayType 
}
EffectConstTable 

Private Types

Parent 

Public Friends

Protected Attributes

bool

True if the effect has been enabled by the manager.

bool

This is true if the effect has been succesfully initialized and all requirements are met for use.

bool

Skip processing of this PostEffect and its children even if its parent is enabled.

The color to prefill the named target when first created by the effect.

If mTargetSize is zero then this scale is used to make a relative texture size to the active render target.

If non-zero this is used as the absolute texture target size.

mTexFilename [NumTextures]
bool
mTexSRGB [NumTextures]
mTextures [NumTextures]
enum PostEffect::@150
mTextureType [NumTextures]
bool

If true update the shader.

Protected Functions

_cleanTargets(bool recurse)
_onLMActivate(const char * , bool activate)

Called from the light manager activate signal.

We handle texture events to release named rendered targets.

_setupTarget(const SceneRenderState * state, bool * outClearTarget)
_setupTexture(U32 slot, GFXTexHandle & inputTex, const RectI * inTexViewport)

Protected Static Functions

bool
_setIsEnabled(void * object, const char * index, const char * data)

Protected set method for toggling the enabled state.

Public Functions

Constructor.

Destructor.

bool

Dump the shader disassembly to a temporary text file.

Returns the SimSet which contains all PostEffects.

bool
bool

Is set to skip rendering.

bool

Called when the object is added to the sim.

Called when the object is removed from the sim.

process(const SceneRenderState * state, GFXTexHandle & inOutTex, const RectI * inTexViewport)
setOneFrameOnly(bool enabled)
setOnThisFrame(bool enabled)
setShaderConst(const String & name, const int & val)
setSkip(bool skip)

Set the effect to skip rendering.

setTexture(U32 index, const GFXTexHandle & texHandle)
setTexture(U32 index, const String & filePath)

Public Static Functions

Detailed Description

Callbacks

DECLARE_CALLBACK(void , onAdd , () )

DECLARE_CALLBACK(void , preProcess , () )

DECLARE_CALLBACK(void , setShaderConsts , () )

DECLARE_CALLBACK(bool , onEnabled , () )

DECLARE_CALLBACK(void , onDisabled , () )

Public Types

@149

Enumerator

NumTextures = 8
PostEffectRequirements

Enumerator

RequiresDepth = BIT(0)
RequiresNormals = BIT(1)
RequiresLightInfo = BIT(2)

Protected Types

@150

Enumerator

NormalTextureType = 0
CubemapType
CubemapArrayType
typedef HashTable< StringCase, EffectConst * > EffectConstTable 

Private Types

typedef SimGroup Parent 

Public Friends

Protected Attributes

GFXShaderConstHandle * mAccumTimeSC 
NamedTexTarget * mActiveNamedTarget [NumTextures]
GFXTextureObject * mActiveTextures [NumTextures]
RectI mActiveTextureViewport [NumTextures]
bool mAllowReflectPass 
GFXShaderConstHandle * mAmbientColorSC 
GFXShaderConstHandle * mCameraForwardSC 
GFXCubemapArrayHandle mCubemapArrayTextures [NumTextures]
GFXCubemapHandle mCubemapTextures [NumTextures]
GFXShaderConstHandle * mDeltaTimeSC 
EffectConstTable mEffectConsts 
bool mEnabled 

True if the effect has been enabled by the manager.

GFXShaderConstHandle * mEyePosSC 
GFXShaderConstHandle * mFogColorSC 
GFXShaderConstHandle * mFogDataSC 
GFXShaderConstHandle * mInvCameraMatSC 
GFXShaderConstHandle * mInvCameraTransSC 
GFXShaderConstHandle * mInvNearFarSC 
bool mIsValid 

This is true if the effect has been succesfully initialized and all requirements are met for use.

GFXShaderConstHandle * mLightDirectionSC 
GFXShaderConstHandle * mMatCameraToScreenSC 
GFXShaderConstHandle * mMatCameraToWorldSC 
GFXShaderConstHandle * mMatPrevScreenToWorldSC 
GFXShaderConstHandle * mMatScreenToCameraSC 
GFXShaderConstHandle * mMatScreenToWorldSC 
GFXShaderConstHandle * mMatWorldToScreenSC 
NamedTexTarget mNamedTarget 
NamedTexTarget mNamedTargetDepthStencil 
GFXShaderConstHandle * mNearFarSC 
bool mOneFrameOnly 
GFXShaderConstHandle * mOneOverRTSizeSC 
bool mOnThisFrame 
GFXShaderConstHandle * mProjectionOffsetSC 
String mRenderBin 
F32 mRenderPriority 
GFXShaderConstHandle * mRenderTargetParamsSC [NumTextures]
PFXRenderTime mRenderTime 
GFXShaderConstHandle * mRTSizeSC 
GFXShaderConstHandle * mScreenSunPosSC 
GFXShaderRef mShader 
GFXShaderConstBufferRef mShaderConsts 
Vector< GFXShaderMacro > mShaderMacros 
String mShaderName 
U32 mShaderReloadKey 
bool mSkip 

Skip processing of this PostEffect and its children even if its parent is enabled.

Parent and sibling PostEffects in the chain are still processed. This is intended for debugging purposes.

GFXStateBlockRef mStateBlock 
GFXStateBlockData * mStateBlockData 
GFXTextureTargetRef mTarget 
PFXTargetClear mTargetClear 
LinearColorF mTargetClearColor 

The color to prefill the named target when first created by the effect.

GFXTexHandle mTargetDepthStencil 
String mTargetDepthStencilName 
GFXFormat mTargetFormat 
String mTargetName 
Point2F mTargetScale 

If mTargetSize is zero then this scale is used to make a relative texture size to the active render target.

Point2I mTargetSize 

If non-zero this is used as the absolute texture target size.

GFXTexHandle mTargetTex 
PFXTargetViewport mTargetViewport 
GFXShaderConstHandle * mTargetViewportSC 
FileName mTexFilename [NumTextures]
GFXShaderConstHandle * mTexSizeSC [NumTextures]
bool mTexSRGB [NumTextures]
GFXTexHandle mTextures [NumTextures]
enum PostEffect::@150 mTextureType [NumTextures]
bool mUpdateShader 

If true update the shader.

GFXShaderConstHandle * mViewportOffsetSC 
GFXShaderConstHandle * mWaterColorSC 
GFXShaderConstHandle * mWaterDepthGradMaxSC 
GFXShaderConstHandle * mWaterFogDataSC 
GFXShaderConstHandle * mWaterFogPlaneSC 
GFXShaderConstHandle * mWorldToScreenScaleSC 

Protected Functions

_checkRequirements()

_cleanTargets(bool recurse)

_getTargetTexture(U32 index)

_onLMActivate(const char * , bool activate)

Called from the light manager activate signal.

see:

LightManager::addActivateCallback

_onTextureEvent(GFXTexCallbackCode code)

We handle texture events to release named rendered targets.

_setupConstants(const SceneRenderState * state)

_setupCubemapArrayTexture(U32 slot, GFXCubemapArrayHandle & inputTex)

_setupCubemapTexture(U32 stage, GFXCubemapHandle & inputTex)

_setupStateBlock(const SceneRenderState * state)

_setupTarget(const SceneRenderState * state, bool * outClearTarget)

_setupTexture(U32 slot, GFXTexHandle & inputTex, const RectI * inTexViewport)

_setupTransforms()

_updateConditioners()

_updateScreenGeometry(const Frustum & frustum, GFXVertexBufferHandle< PFXVertex > * outVB)

Protected Static Functions

_setIsEnabled(void * object, const char * index, const char * data)

Protected set method for toggling the enabled state.

Public Functions

PostEffect()

Constructor.

~PostEffect()

Destructor.

clearShaderMacros()

DECLARE_CONOBJECT(PostEffect )

disable()

dumpShaderDisassembly(String & outFilename)

Dump the shader disassembly to a temporary text file.

Returns true and sets outFilename to the file if successful.

enable()

getAspectRatio()

getPriority()

getRenderBin()

getRenderTime()

getSet()

Returns the SimSet which contains all PostEffects.

getShader()

getShaderConstBuffer()

getShaderMacros()

isEnabled()

isOneFrameOnly()

isOnThisFrame()

isSkipped()

Is set to skip rendering.

onAdd()

Reimplemented from: SimObject

onRemove()

Reimplemented from: SimGroup

process(const SceneRenderState * state, GFXTexHandle & inOutTex, const RectI * inTexViewport)

reload()

removeShaderMacro(const String & name)

setCubemapArrayTexture(U32 index, const GFXCubemapArrayHandle & cubemapArrayHandle)

setCubemapTexture(U32 index, const GFXCubemapHandle & cubemapHandle)

setOneFrameOnly(bool enabled)

setOnThisFrame(bool enabled)

setShaderConst(const String & name, const F32 & val)

setShaderConst(const String & name, const int & val)

setShaderConst(const String & name, const MatrixF & val)

setShaderConst(const String & name, const Point4F & val)

setShaderConst(const String & name, const String & val)

setShaderConst(const String & name, const Vector< MatrixF > & val)

setShaderConst(const String & name, const Vector< Point4F > & val)

setShaderMacro(const String & name, const String & value)

setSkip(bool skip)

Set the effect to skip rendering.

setTexture(U32 index, const GFXTexHandle & texHandle)

setTexture(U32 index, const String & filePath)

Public Static Functions

initPersistFields()