An instance of a Compositor object for one Viewport. More...
#include <OgreCompositorInstance.h>
Classes | |
class | Listener |
Provides an interface to "listen in" to to render system operations executed by this CompositorInstance. More... | |
class | RenderSystemOperation |
Specific render system operation. More... | |
class | TargetOperation |
Operation setup for a RenderTarget (collected). More... | |
Public Types | |
typedef vector < TargetOperation >::type | CompiledState |
typedef map< int, MaterialPtr > ::type | QuadMaterialMap |
typedef std::pair< int, RenderSystemOperation * > | RenderSystemOpPair |
typedef vector < RenderSystemOpPair >::type | RenderSystemOpPairs |
Public Member Functions | |
CompositorInstance (CompositionTechnique *technique, CompositorChain *chain) | |
virtual | ~CompositorInstance () |
virtual void | _compileOutputOperation (TargetOperation &finalState) |
Compile the final (output) operation. More... | |
virtual void | _compileTargetOperations (CompiledState &compiledState) |
Recursively collect target states (except for final Pass). More... | |
void | _fireNotifyMaterialRender (uint32 pass_id, MaterialPtr &mat) |
Notify listeners of a material render. More... | |
void | _fireNotifyMaterialSetup (uint32 pass_id, MaterialPtr &mat) |
Notify listeners of a material compilation. More... | |
void | _fireNotifyResourcesCreated (bool forResizeOnly) |
Notify listeners of a material render. More... | |
void | addListener (Listener *l) |
Add a listener. More... | |
CompositorChain * | getChain () |
Get Chain that this instance is part of. More... | |
Compositor * | getCompositor () |
Get Compositor of which this is an instance. More... | |
bool | getEnabled () |
Get enabled flag. More... | |
RenderTarget * | getRenderTarget (const String &name) |
Get the render target for a given render texture name. More... | |
const String & | getScheme () const |
Returns the name of the scheme this compositor is using. More... | |
CompositionTechnique * | getTechnique () |
Get CompositionTechnique used by this instance. More... | |
TexturePtr | getTextureInstance (const String &name, size_t mrtIndex) |
Get the instance of a local texture. More... | |
const String & | getTextureInstanceName (const String &name, size_t mrtIndex) |
Get the instance name for a local texture. More... | |
void | notifyResized () |
Notify this instance that the primary surface has been resized. 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) |
void | removeListener (Listener *l) |
Remove a listener. More... | |
void | setEnabled (bool value) |
Set enabled flag. More... | |
void | setScheme (const String &schemeName, bool reuseTextures=true) |
Pick a technique to use to render this compositor based on a scheme. More... | |
void | setTechnique (CompositionTechnique *tech, bool reuseTextures=true) |
Change the technique we're using to render this compositor. More... | |
Private Types | |
typedef vector< Listener * >::type | Listeners |
Vector of listeners. More... | |
typedef map< String, MultiRenderTarget * >::type | LocalMRTMap |
Store a list of MRTs we've created. More... | |
typedef map< String, TexturePtr >::type | LocalTextureMap |
Map from name->local texture. More... | |
typedef map < CompositionTechnique::TextureDefinition *, TexturePtr >::type | ReserveTextureMap |
Private Member Functions | |
virtual void | collectPasses (TargetOperation &finalState, CompositionTargetPass *target) |
Collect rendering passes. More... | |
MaterialPtr | createLocalMaterial (const String &srcName) |
Create a local dummy material with one technique but no passes. More... | |
void | createResources (bool forResizeOnly) |
Create local rendertextures and other resources. More... | |
void | deriveTextureRenderTargetOptions (const String &texname, bool *hwGammaWrite, uint *fsaa, String *fsaaHint) |
Search for options like AA and hardware gamma which we may want to inherit from the main render target to which we're attached. More... | |
void | freeResources (bool forResizeOnly, bool clearReserveTextures) |
Destroy local rendertextures and other resources. More... | |
String | getMRTTexLocalName (const String &baseName, size_t attachment) |
Util method for assigning a local texture name to a MRT attachment. More... | |
const String & | getSourceForTex (const String &name, size_t mrtIndex=0) |
Get source texture name for a named local texture. More... | |
RenderTarget * | getTargetForTex (const String &name) |
Get RenderTarget for a named local texture. More... | |
void | queueRenderSystemOp (TargetOperation &finalState, RenderSystemOperation *op) |
Queue a render system operation. More... | |
Private Attributes | |
String | mActiveScheme |
The scheme which is being used in this instance. More... | |
CompositorChain * | mChain |
Composition chain of which this instance is part. More... | |
Compositor * | mCompositor |
Compositor of which this is an instance. More... | |
bool | mEnabled |
Is this instance enabled? More... | |
Listeners | mListeners |
LocalMRTMap | mLocalMRTs |
LocalTextureMap | mLocalTextures |
CompositorInstance * | mPreviousInstance |
Previous instance (set by chain) More... | |
ReserveTextureMap | mReserveTextures |
Textures that are not currently in use, but that we want to keep for now, for example if we switch techniques but want to keep all textures available in case we switch back. More... | |
CompositionTechnique * | mTechnique |
Composition technique used by this instance. More... | |
Friends | |
class | CompositorChain |
An instance of a Compositor object for one Viewport.
It is part of the CompositorChain for a Viewport.
Definition at line 49 of file OgreCompositorInstance.h.
typedef vector<TargetOperation>::type Ogre::CompositorInstance::CompiledState |
Definition at line 158 of file OgreCompositorInstance.h.
|
private |
Vector of listeners.
Definition at line 301 of file OgreCompositorInstance.h.
|
private |
Store a list of MRTs we've created.
Definition at line 291 of file OgreCompositorInstance.h.
|
private |
Map from name->local texture.
Definition at line 288 of file OgreCompositorInstance.h.
typedef map<int, MaterialPtr>::type Ogre::CompositorInstance::QuadMaterialMap |
Definition at line 100 of file OgreCompositorInstance.h.
typedef std::pair<int, RenderSystemOperation*> Ogre::CompositorInstance::RenderSystemOpPair |
Definition at line 101 of file OgreCompositorInstance.h.
Definition at line 102 of file OgreCompositorInstance.h.
|
private |
Definition at line 293 of file OgreCompositorInstance.h.
Ogre::CompositorInstance::CompositorInstance | ( | CompositionTechnique * | technique, |
CompositorChain * | chain | ||
) |
|
virtual |
|
virtual |
Compile the final (output) operation.
This is done separately because this is combined with the input in chained filters.
|
virtual |
Recursively collect target states (except for final Pass).
compiledState | This vector will contain a list of TargetOperation objects |
void Ogre::CompositorInstance::_fireNotifyMaterialRender | ( | uint32 | pass_id, |
MaterialPtr & | mat | ||
) |
Notify listeners of a material render.
void Ogre::CompositorInstance::_fireNotifyMaterialSetup | ( | uint32 | pass_id, |
MaterialPtr & | mat | ||
) |
Notify listeners of a material compilation.
void Ogre::CompositorInstance::_fireNotifyResourcesCreated | ( | bool | forResizeOnly | ) |
Notify listeners of a material render.
void Ogre::CompositorInstance::addListener | ( | Listener * | l | ) |
Add a listener.
Listeners provide an interface to "listen in" to to render system operations executed by this CompositorInstance so that materials can be programmatically set up.
|
privatevirtual |
Collect rendering passes.
Here, passes are converted into render target operations and queued with queueRenderSystemOp.
|
private |
Create a local dummy material with one technique but no passes.
The material is detached from the Material Manager to make sure it is destroyed when going out of scope.
|
private |
Create local rendertextures and other resources.
Builds mLocalTextures.
|
private |
Search for options like AA and hardware gamma which we may want to inherit from the main render target to which we're attached.
|
private |
Destroy local rendertextures and other resources.
CompositorChain* Ogre::CompositorInstance::getChain | ( | ) |
Get Chain that this instance is part of.
Compositor* Ogre::CompositorInstance::getCompositor | ( | ) |
Get Compositor of which this is an instance.
bool Ogre::CompositorInstance::getEnabled | ( | ) |
Get enabled flag.
|
private |
Util method for assigning a local texture name to a MRT attachment.
RenderTarget* Ogre::CompositorInstance::getRenderTarget | ( | const String & | name | ) |
Get the render target for a given render texture name.
|
inline |
Returns the name of the scheme this compositor is using.
Definition at line 241 of file OgreCompositorInstance.h.
|
private |
Get source texture name for a named local texture.
name | The local name of the texture as given to it in the compositor |
mrtIndex | For MRTs, which attached surface to retrieve |
|
private |
Get RenderTarget for a named local texture.
CompositionTechnique* Ogre::CompositorInstance::getTechnique | ( | ) |
Get CompositionTechnique used by this instance.
TexturePtr Ogre::CompositorInstance::getTextureInstance | ( | const String & | name, |
size_t | mrtIndex | ||
) |
Get the instance of a local texture.
name | The name of the texture in the original compositor definition |
mrtIndex | If name identifies a MRT, which texture attachment to retrieve |
const String& Ogre::CompositorInstance::getTextureInstanceName | ( | const String & | name, |
size_t | mrtIndex | ||
) |
Get the instance name for a local texture.
name | The name of the texture in the original compositor definition |
mrtIndex | If name identifies a MRT, which texture attachment to retrieve |
void Ogre::CompositorInstance::notifyResized | ( | ) |
Notify this instance that the primary surface has been resized.
|
inlineinherited |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 107 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 118 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
operator new, with debug line info
Definition at line 67 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 72 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
placement operator new
Definition at line 78 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
array operator new, with debug line info
Definition at line 85 of file OgreMemoryAllocatedObject.h.
|
inlineinherited |
Definition at line 90 of file OgreMemoryAllocatedObject.h.
|
private |
Queue a render system operation.
void Ogre::CompositorInstance::removeListener | ( | Listener * | l | ) |
Remove a listener.
void Ogre::CompositorInstance::setEnabled | ( | bool | value | ) |
Set enabled flag.
The compositor instance will only render if it is enabled, otherwise it is pass-through.
void Ogre::CompositorInstance::setScheme | ( | const String & | schemeName, |
bool | reuseTextures = true |
||
) |
Pick a technique to use to render this compositor based on a scheme.
schemeName | The scheme to use |
reuseTextures | If textures have already been created for the current technique, whether to try to re-use them if sizes & formats match. Note that for this feature to be of benefit, the textures must have been created with the 'pooled' option enabled. |
void Ogre::CompositorInstance::setTechnique | ( | CompositionTechnique * | tech, |
bool | reuseTextures = true |
||
) |
Change the technique we're using to render this compositor.
tech | The technique to use (must be supported and from the same Compositor) |
reuseTextures | If textures have already been created for the current technique, whether to try to re-use them if sizes & formats match. |
|
friend |
Definition at line 353 of file OgreCompositorInstance.h.
|
private |
The scheme which is being used in this instance.
Definition at line 308 of file OgreCompositorInstance.h.
|
private |
Composition chain of which this instance is part.
Definition at line 284 of file OgreCompositorInstance.h.
|
private |
Compositor of which this is an instance.
Definition at line 280 of file OgreCompositorInstance.h.
|
private |
Is this instance enabled?
Definition at line 286 of file OgreCompositorInstance.h.
|
private |
Definition at line 302 of file OgreCompositorInstance.h.
|
private |
Definition at line 292 of file OgreCompositorInstance.h.
|
private |
Definition at line 289 of file OgreCompositorInstance.h.
|
private |
Previous instance (set by chain)
Definition at line 305 of file OgreCompositorInstance.h.
|
private |
Textures that are not currently in use, but that we want to keep for now, for example if we switch techniques but want to keep all textures available in case we switch back.
Definition at line 298 of file OgreCompositorInstance.h.
|
private |
Composition technique used by this instance.
Definition at line 282 of file OgreCompositorInstance.h.