Ogre::CompositorChain Class Reference
Core » Effects

Chain of compositor effects applying to one viewport. More...

`#include <OgreCompositorChain.h>`

Inheritance diagram for Ogre::CompositorChain:
[legend]

## Classes

class | RQListener
| Render queue listener used to set up rendering events. More...

## Public Types

typedef VectorIterator< Instances > | InstanceIterator
typedef vector< CompositorInstance * >::type | Instances
| Data types. More...

## Public Member Functions

| CompositorChain (Viewport *vp)
virtual | ~CompositorChain ()
| Another gcc warning here, which is no problem because RenderTargetListener is never used to delete an object. More...
void | _compile ()
| Compile this Composition chain into a series of RenderTarget operations. More...
CompositorInstance * | _getOriginalSceneCompositor (void)
| Get the original scene compositor instance for this chain (internal use). More...
void | _markDirty ()
| Mark state as dirty, and to be recompiled next frame. More...
void | _queuedOperation (CompositorInstance::RenderSystemOperation *op)
| Internal method for registering a queued operation for deletion later. More...
void | _removeInstance (CompositorInstance *i)
| Remove a compositor by pointer. More...
CompositorInstance * | addCompositor (CompositorPtr filter, size_t addPosition=LAST, const String &scheme=StringUtil::BLANK)
| Apply a compositor. More...
CompositorInstance * | getCompositor (size_t index)
| Get compositor instance by position. More...
CompositorInstance * | getCompositor (const String &name)
| Get compositor instance by name. More...
InstanceIterator | getCompositors ()
| Get an iterator over the compositor instances. More...
CompositorInstance * | getNextInstance (CompositorInstance *curr, bool activeOnly=true)
| Get the next instance in this chain to the one specified. More...
size_t | getNumCompositors ()
| Get the number of compositors. More...
CompositorInstance * | getPreviousInstance (CompositorInstance *curr, bool activeOnly=true)
| Get the previous instance in this chain to the one specified. More...
Viewport * | getViewport ()
| Get viewport that is the target of this chain. More...
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info More...
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new More...
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info More...
void * | operator new[] (size_t sz)
virtual void | postRenderTargetUpdate (const RenderTargetEvent &evt)
virtual void | postViewportUpdate (const RenderTargetViewportEvent &evt)
virtual void | preRenderTargetUpdate (const RenderTargetEvent &evt)
virtual void | preViewportUpdate (const RenderTargetViewportEvent &evt)
void | removeAllCompositors ()
| Remove all compositors. More...
void | removeCompositor (size_t position=LAST)
| Remove a compositor. More...
void | setCompositorEnabled (size_t position, bool state)
| Enable or disable a compositor, by position. More...
virtual void | viewportAdded (const RenderTargetViewportEvent &evt)
| Called to notify listener that a Viewport has been added to the target in question. More...
virtual void | viewportCameraChanged (Viewport *viewport)
virtual void | viewportDestroyed (Viewport *viewport)
virtual void | viewportDimensionsChanged (Viewport *viewport)
virtual void | viewportRemoved (const RenderTargetViewportEvent &evt)
| Called to notify listener that a Viewport has been removed from the target in question. More...

## Static Public Attributes

static const size_t | BEST = 0
| Identifier for best technique. More...
static const size_t | LAST = (size_t)-1
| Identifier for "last" compositor in chain. More...

## Protected Types

typedef vector< CompositorInstance::RenderSystemOperation * >::type | RenderSystemOperations
| Render System operations queued by last compile, these are created by this instance thus managed and deleted by it. More...

## Protected Member Functions

void | clearCompiledState ()
| Clear compiled state. More...
void | createOriginalScene ()
void | destroyOriginalScene ()
void | destroyResources (void)
| destroy internal resources More...
void | postTargetOperation (CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam)
| Restore a viewport, the camera and the scene after a rendering operation. More...
void | preTargetOperation (CompositorInstance::TargetOperation &op, Viewport *vp, Camera *cam)
| Prepare a viewport, the camera and the scene for a rendering operation. More...

## Protected Attributes

bool | mAnyCompositorsEnabled
| Any compositors enabled? More...
CompositorInstance::CompiledState | mCompiledState
| Compiled state (updated with _compile) More...
bool | mDirty
| State needs recompile. More...
Instances | mInstances
| Postfilter instances in this chain. More...
unsigned int | mOldClearEveryFrameBuffers
| Old viewport settings. More...
bool | mOldFindVisibleObjects
| Store old find visible objects. More...
float | mOldLodBias
| Store old camera LOD bias. More...
String | mOldMaterialScheme
| Store old viewport material scheme. More...
bool | mOldShadowsEnabled
| Store old shadows enabled flag. More...
uint32 | mOldVisibilityMask
| Store old scene visibility mask. More...
CompositorInstance * | mOriginalScene
| Plainly renders the scene; implicit first compositor in the chain. More...
String | mOriginalSceneScheme
RQListener | mOurListener
CompositorInstance::TargetOperation | mOutputOperation
RenderSystemOperations | mRenderSystemOperations
Viewport * | mViewport
| Viewport affected by this CompositorChain. More...

## Detailed Description

Chain of compositor effects applying to one viewport.

Definition at line 48 of file OgreCompositorChain.h.

## Member Typedef Documentation

## InstanceIterator

typedef VectorIterator<Instances> Ogre::CompositorChain::InstanceIterator

Definition at line 59 of file OgreCompositorChain.h.

## Instances

typedef vector<CompositorInstance*>::type Ogre::CompositorChain::Instances

Data types.

Definition at line 58 of file OgreCompositorChain.h.

## RenderSystemOperations

typedef vector<CompositorInstance::RenderSystemOperation*>::type Ogre::CompositorChain::RenderSystemOperations

protected

Render System operations queued by last compile, these are created by this instance thus managed and deleted by it.

The list is cleared with clearCompilationState()

Definition at line 181 of file OgreCompositorChain.h.

## Constructor & Destructor Documentation

## CompositorChain()

Ogre::CompositorChain::CompositorChain | ( | Viewport * | vp | ) |

## ~CompositorChain()

virtual Ogre::CompositorChain::~CompositorChain | ( |  | ) |

virtual

Another gcc warning here, which is no problem because RenderTargetListener is never used to delete an object.

## Member Function Documentation

## _compile()

void Ogre::CompositorChain::_compile | ( |  | ) |

Compile this Composition chain into a series of RenderTarget operations.

## _getOriginalSceneCompositor()

CompositorInstance* Ogre::CompositorChain::_getOriginalSceneCompositor | ( | void |  | ) |

Get the original scene compositor instance for this chain (internal use).

Definition at line 100 of file OgreCompositorChain.h.

## _markDirty()

void Ogre::CompositorChain::_markDirty | ( |  | ) |

Mark state as dirty, and to be recompiled next frame.

## _queuedOperation()

void Ogre::CompositorChain::_queuedOperation | ( | CompositorInstance::RenderSystemOperation * | op | ) |

Internal method for registering a queued operation for deletion later.

## _removeInstance()

void Ogre::CompositorChain::_removeInstance | ( | CompositorInstance * | i | ) |

Remove a compositor by pointer.

This is internally used by CompositionTechnique to "weak" remove any instanced of a deleted technique.

## addCompositor()

CompositorInstance* Ogre::CompositorChain::addCompositor | ( | CompositorPtr | filter,
|  | size_t | addPosition = `LAST`,
|  | const String & | scheme = `StringUtil::BLANK`
| ) |  |

Apply a compositor.

Initially, the filter is enabled.

Parameters

  filter | Filter to apply.
  addPosition | Position in filter chain to insert this filter at; defaults to the end (last applied filter).
  scheme | Scheme to use (blank means default).

## clearCompiledState()

void Ogre::CompositorChain::clearCompiledState | ( |  | ) |

protected

Clear compiled state.

## createOriginalScene()

void Ogre::CompositorChain::createOriginalScene | ( |  | ) |

protected

## destroyOriginalScene()

void Ogre::CompositorChain::destroyOriginalScene | ( |  | ) |

protected

## destroyResources()

void Ogre::CompositorChain::destroyResources | ( | void |  | ) |

protected

destroy internal resources

## getCompositor() [1/2]

CompositorInstance* Ogre::CompositorChain::getCompositor | ( | size_t | index | ) |

Get compositor instance by position.

## getCompositor() [2/2]

CompositorInstance* Ogre::CompositorChain::getCompositor | ( | const String & | name | ) |

Get compositor instance by name.

Returns null if not found.

## getCompositors()

InstanceIterator Ogre::CompositorChain::getCompositors | ( |  | ) |

Get an iterator over the compositor instances.

The first compositor in this list is applied first, the last one is applied last.

## getNextInstance()

CompositorInstance* Ogre::CompositorChain::getNextInstance | ( | CompositorInstance * | curr,
|  | bool | activeOnly = `true`
| ) |  |

Get the next instance in this chain to the one specified.

## getNumCompositors()

size_t Ogre::CompositorChain::getNumCompositors | ( |  | ) |

Get the number of compositors.

## getPreviousInstance()

CompositorInstance* Ogre::CompositorChain::getPreviousInstance | ( | CompositorInstance * | curr,
|  | bool | activeOnly = `true`
| ) |  |

Get the previous instance in this chain to the one specified.

## getViewport()

Viewport* Ogre::CompositorChain::getViewport | ( |  | ) |

Get viewport that is the target of this chain.

## operator delete() [1/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) |

inherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

## operator delete() [2/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |
| ) |  |

inherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

## operator delete() [3/3]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [1/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) |

inherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

## operator delete[]() [2/2]

template<class Alloc >

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |
| ) |  |

inherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

## operator new() [1/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

## operator new() [2/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) |

inherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

## operator new() [3/3]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr
| ) |  |

inherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

## operator new[]() [1/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

inherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

## operator new[]() [2/2]

template<class Alloc >

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) |

inherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

## postRenderTargetUpdate()

virtual void Ogre::CompositorChain::postRenderTargetUpdate | ( | const RenderTargetEvent & | evt | ) |

virtual

See also
  RenderTargetListener::postRenderTargetUpdate

Reimplemented from Ogre::RenderTargetListener.

## postTargetOperation()

void Ogre::CompositorChain::postTargetOperation | ( | CompositorInstance::TargetOperation & | op,
|  | Viewport * | vp,
|  | Camera * | cam
| ) |  |

protected

Restore a viewport, the camera and the scene after a rendering operation.

## postViewportUpdate()

virtual void Ogre::CompositorChain::postViewportUpdate | ( | const RenderTargetViewportEvent & | evt | ) |

virtual

See also
  RenderTargetListener::postViewportUpdate

Reimplemented from Ogre::RenderTargetListener.

## preRenderTargetUpdate()

virtual void Ogre::CompositorChain::preRenderTargetUpdate | ( | const RenderTargetEvent & | evt | ) |

virtual

See also
  RenderTargetListener::preRenderTargetUpdate

Reimplemented from Ogre::RenderTargetListener.

## preTargetOperation()

void Ogre::CompositorChain::preTargetOperation | ( | CompositorInstance::TargetOperation & | op,
|  | Viewport * | vp,
|  | Camera * | cam
| ) |  |

protected

Prepare a viewport, the camera and the scene for a rendering operation.

## preViewportUpdate()

virtual void Ogre::CompositorChain::preViewportUpdate | ( | const RenderTargetViewportEvent & | evt | ) |

virtual

See also
  RenderTargetListener::preViewportUpdate

Reimplemented from Ogre::RenderTargetListener.

## removeAllCompositors()

void Ogre::CompositorChain::removeAllCompositors | ( |  | ) |

Remove all compositors.

## removeCompositor()

void Ogre::CompositorChain::removeCompositor | ( | size_t | position = `LAST` | ) |

Remove a compositor.

Parameters

  position | Position in filter chain of filter to remove; defaults to the end (last applied filter)

## setCompositorEnabled()

void Ogre::CompositorChain::setCompositorEnabled | ( | size_t | position,
|  | bool | state
| ) |  |

Enable or disable a compositor, by position.

Disabling a compositor stops it from rendering but does not free any resources. This can be more efficient than using removeCompositor and addCompositor in cases the filter is switched on and off a lot.

Parameters

  position | Position in filter chain of filter

## viewportAdded()

virtual void Ogre::RenderTargetListener::viewportAdded | ( | const RenderTargetViewportEvent & | evt | ) |

virtual inherited

Called to notify listener that a Viewport has been added to the target in question.

Definition at line 134 of file OgreRenderTargetListener.h.

## viewportCameraChanged()

virtual void Ogre::CompositorChain::viewportCameraChanged | ( | Viewport * | viewport | ) |

virtual

See also
  Viewport::Listener::viewportCameraChanged

Reimplemented from Ogre::Viewport::Listener.

## viewportDestroyed()

virtual void Ogre::CompositorChain::viewportDestroyed | ( | Viewport * | viewport | ) |

virtual

See also
  Viewport::Listener::viewportDestroyed

Reimplemented from Ogre::Viewport::Listener.

## viewportDimensionsChanged()

virtual void Ogre::CompositorChain::viewportDimensionsChanged | ( | Viewport * | viewport | ) |

virtual

See also
  Viewport::Listener::viewportDimensionsChanged

Reimplemented from Ogre::Viewport::Listener.

## viewportRemoved()

virtual void Ogre::RenderTargetListener::viewportRemoved | ( | const RenderTargetViewportEvent & | evt | ) |

virtual inherited

Called to notify listener that a Viewport has been removed from the target in question.

Definition at line 139 of file OgreRenderTargetListener.h.

## Member Data Documentation

## BEST

const size_t Ogre::CompositorChain::BEST = 0

static

Identifier for best technique.

Definition at line 64 of file OgreCompositorChain.h.

## LAST

const size_t Ogre::CompositorChain::LAST = (size_t)-1

static

Identifier for "last" compositor in chain.

Definition at line 62 of file OgreCompositorChain.h.

## mAnyCompositorsEnabled

bool Ogre::CompositorChain::mAnyCompositorsEnabled

protected

Any compositors enabled?

Definition at line 171 of file OgreCompositorChain.h.

## mCompiledState

CompositorInstance::CompiledState Ogre::CompositorChain::mCompiledState

protected

Compiled state (updated with _compile)

Definition at line 176 of file OgreCompositorChain.h.

## mDirty

bool Ogre::CompositorChain::mDirty

protected

State needs recompile.

Definition at line 169 of file OgreCompositorChain.h.

## mInstances

Instances Ogre::CompositorChain::mInstances

protected

Postfilter instances in this chain.

Definition at line 166 of file OgreCompositorChain.h.

## mOldClearEveryFrameBuffers

unsigned int Ogre::CompositorChain::mOldClearEveryFrameBuffers

protected

Old viewport settings.

Definition at line 231 of file OgreCompositorChain.h.

## mOldFindVisibleObjects

bool Ogre::CompositorChain::mOldFindVisibleObjects

protected

Store old find visible objects.

Definition at line 235 of file OgreCompositorChain.h.

## mOldLodBias

float Ogre::CompositorChain::mOldLodBias

protected

Store old camera LOD bias.

Definition at line 237 of file OgreCompositorChain.h.

## mOldMaterialScheme

String Ogre::CompositorChain::mOldMaterialScheme

protected

Store old viewport material scheme.

Definition at line 239 of file OgreCompositorChain.h.

## mOldShadowsEnabled

bool Ogre::CompositorChain::mOldShadowsEnabled

protected

Store old shadows enabled flag.

Definition at line 241 of file OgreCompositorChain.h.

## mOldVisibilityMask

uint32 Ogre::CompositorChain::mOldVisibilityMask

protected

Store old scene visibility mask.

Definition at line 233 of file OgreCompositorChain.h.

## mOriginalScene

CompositorInstance* Ogre::CompositorChain::mOriginalScene

protected

Plainly renders the scene; implicit first compositor in the chain.

Definition at line 163 of file OgreCompositorChain.h.

## mOriginalSceneScheme

String Ogre::CompositorChain::mOriginalSceneScheme

protected

Definition at line 173 of file OgreCompositorChain.h.

## mOurListener

RQListener Ogre::CompositorChain::mOurListener

protected

Definition at line 229 of file OgreCompositorChain.h.

## mOutputOperation

CompositorInstance::TargetOperation Ogre::CompositorChain::mOutputOperation

protected

Definition at line 177 of file OgreCompositorChain.h.

## mRenderSystemOperations

RenderSystemOperations Ogre::CompositorChain::mRenderSystemOperations

protected

Definition at line 182 of file OgreCompositorChain.h.

## mViewport

Viewport* Ogre::CompositorChain::mViewport

protected

Viewport affected by this CompositorChain.

Definition at line 159 of file OgreCompositorChain.h.

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

- OgreCompositorChain.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.