CrystalSpace

Public API Reference

CS::RenderManager::iPostEffect Struct Reference

Interface for post processing effects. More...

#include <csplugincommon/rendermanager/posteffects.h>

Inheritance diagram for CS::RenderManager::iPostEffect:

List of all members.

Public Member Functions

virtual iPostEffectLayer * AddLayer (const LayerDesc &desc)=0
 Add an effect pass.
virtual void Clear ()=0
 Clean up all allocated textures (references).
virtual void ClearLayers ()=0
 Remove all layers.
virtual bool Construct (bool forced)=0
 Setup the effect.
virtual void DrawPostEffect (RenderTreeBase &renderTree, PostEffectDrawTarget flag=TARGET)=0
 Draw post processing effects to the specified target.
virtual iTextureHandleGetInputTexture () const =0
 Get the effect's input texture.
virtual iPostEffectLayer * GetLayer (int num)=0
 Get the layer by index.
virtual iPostEffectLayer * GetLayer (const char *name)=0
 Get the layer by name.
virtual iTextureHandleGetLayerOutput (const iPostEffectLayer *layer)=0
 Get the output texture of a layer.
virtual void GetLayerRenderSVs (iPostEffectLayer *layer, csShaderVariableStack &svStack)=0
 Get the layer shader variable stack.
virtual const char * GetName ()=0
 Get the name of this post pocessing effect.
virtual iTextureHandleGetOutputTarget () const =0
 Get the effect's output render target.
virtual iPostEffectLayer * GetScreenLayer ()=0
 Get the layer representing the "screen" a scene is rendered to.
virtual iTextureHandleGetScreenTarget ()=0
 Get the texture to render a scene to for post processing.
virtual bool LoadFromFile (const char *fileName)=0
 Loads the effect from the given file.
virtual bool RemoveLayer (iPostEffectLayer *layer)=0
 Remove the given layer.
virtual bool ScreenSpaceYFlipped ()=0
 Returns whether the screen space is flipped in Y direction.
virtual void SetInputTexture (iTextureHandle *tex)=0
 Set the effect's input texture.
virtual void SetOutputTarget (iTextureHandle *tex)=0
 Set the effect's output render target.
virtual void SetSetupViewCallback (iSetupViewCallback *pCallback)=0
 callback for setupview function
virtual bool SetupView (uint width, uint height)=0
 Set up the post processing management for a view.

Detailed Description

Interface for post processing effects.

Post processing effects provide a simple way to render the screen to a texture and then use a number of full screen passes with settable shader to get the desired effect.

To use post processing effects, you need to create a iPostEffect, setup it, usually from an external xml file and then add it to the post effect manager. Can be added as many effects as you want, the post effect manager will take care of chaining correctly the effects. Example:

 postMgr = scfQueryInterface<iRenderManagerPostEffects> (rm);
 csPtr<iPostEffect> effect = postMgr->CreatePostEffect ("example effect");
 effect->LoadFromFile ("/data/myeffect.xml");
 postMgr->AddPostEffect (pEffect1);

Post processing setups are a graph of effects (with nodes called "layers" for historic reasons). Each node has one or more outputs and multiple inputs. Inputs can be the output of another node, statics textures or a custom texture input.

Definition at line 306 of file posteffects.h.


Member Function Documentation

virtual iPostEffectLayer* CS::RenderManager::iPostEffect::AddLayer ( const LayerDesc desc  )  [pure virtual]

Add an effect pass.

virtual void CS::RenderManager::iPostEffect::Clear (  )  [pure virtual]

Clean up all allocated textures (references).

virtual void CS::RenderManager::iPostEffect::ClearLayers (  )  [pure virtual]

Remove all layers.

virtual bool CS::RenderManager::iPostEffect::Construct ( bool  forced  )  [pure virtual]

Setup the effect.

virtual void CS::RenderManager::iPostEffect::DrawPostEffect ( RenderTreeBase renderTree,
PostEffectDrawTarget  flag = TARGET 
) [pure virtual]

Draw post processing effects to the specified target.

virtual iTextureHandle* CS::RenderManager::iPostEffect::GetInputTexture (  )  const [pure virtual]

Get the effect's input texture.

virtual iPostEffectLayer* CS::RenderManager::iPostEffect::GetLayer ( int  num  )  [pure virtual]

Get the layer by index.

virtual iPostEffectLayer* CS::RenderManager::iPostEffect::GetLayer ( const char *  name  )  [pure virtual]

Get the layer by name.

virtual iTextureHandle* CS::RenderManager::iPostEffect::GetLayerOutput ( const iPostEffectLayer *  layer  )  [pure virtual]

Get the output texture of a layer.

virtual void CS::RenderManager::iPostEffect::GetLayerRenderSVs ( iPostEffectLayer *  layer,
csShaderVariableStack svStack 
) [pure virtual]

Get the layer shader variable stack.

virtual const char* CS::RenderManager::iPostEffect::GetName (  )  [pure virtual]

Get the name of this post pocessing effect.

virtual iTextureHandle* CS::RenderManager::iPostEffect::GetOutputTarget (  )  const [pure virtual]

Get the effect's output render target.

virtual iPostEffectLayer* CS::RenderManager::iPostEffect::GetScreenLayer (  )  [pure virtual]

Get the layer representing the "screen" a scene is rendered to.

virtual iTextureHandle* CS::RenderManager::iPostEffect::GetScreenTarget (  )  [pure virtual]

Get the texture to render a scene to for post processing.

virtual bool CS::RenderManager::iPostEffect::LoadFromFile ( const char *  fileName  )  [pure virtual]

Loads the effect from the given file.

virtual bool CS::RenderManager::iPostEffect::RemoveLayer ( iPostEffectLayer *  layer  )  [pure virtual]

Remove the given layer.

virtual bool CS::RenderManager::iPostEffect::ScreenSpaceYFlipped (  )  [pure virtual]

Returns whether the screen space is flipped in Y direction.

This usually happens when rendering to a texture due post effects.

virtual void CS::RenderManager::iPostEffect::SetInputTexture ( iTextureHandle tex  )  [pure virtual]

Set the effect's input texture.

virtual void CS::RenderManager::iPostEffect::SetOutputTarget ( iTextureHandle tex  )  [pure virtual]

Set the effect's output render target.

virtual void CS::RenderManager::iPostEffect::SetSetupViewCallback ( iSetupViewCallback *  pCallback  )  [pure virtual]

callback for setupview function

virtual bool CS::RenderManager::iPostEffect::SetupView ( uint  width,
uint  height 
) [pure virtual]

Set up the post processing management for a view.

Returns:
Whether the manager has changed. If true some values, such as the screen texture, must be reobtained from the manager.

The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1