OGRE 14.3
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::CompositorInstance Class Reference

An instance of a Compositor object for one Viewport. More...

#include <OgreCompositorInstance.h>

+ Inheritance diagram for Ogre::CompositorInstance:

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 std::vector< TargetOperationCompiledState
 
typedef std::pair< int, RenderSystemOperation * > RenderSystemOpPair
 
typedef std::vector< RenderSystemOpPairRenderSystemOpPairs
 

Public Member Functions

 CompositorInstance (CompositionTechnique *technique, CompositorChain *chain)
 
virtual ~CompositorInstance ()
 
virtual void _compileOutputOperation (TargetOperation &finalState)
 Compile the final (output) operation.
 
virtual void _compileTargetOperations (CompiledState &compiledState)
 Recursively collect target states (except for final Pass).
 
void _fireNotifyMaterialRender (uint32 pass_id, MaterialPtr &mat)
 Notify listeners of a material render.
 
void _fireNotifyMaterialSetup (uint32 pass_id, MaterialPtr &mat)
 Notify listeners of a material compilation.
 
void _fireNotifyResourcesCreated (bool forResizeOnly)
 Notify listeners of a material render.
 
void _fireNotifyResourcesReleased (bool forResizeOnly)
 Notify listeners resources.
 
void addListener (Listener *l)
 Add a listener.
 
bool getAlive () const
 Get alive flag.
 
CompositorChaingetChain ()
 Get Chain that this instance is part of.
 
CompositorgetCompositor () const
 Get Compositor of which this is an instance.
 
bool getEnabled () const
 Get enabled flag.
 
RenderTargetgetRenderTarget (const String &name, int slice=0)
 Get the render target for a given render texture name.
 
const StringgetScheme () const
 Returns the name of the scheme this compositor is using.
 
CompositionTechniquegetTechnique () const
 Get CompositionTechnique used by this instance.
 
const TexturePtrgetTextureInstance (const String &name, size_t mrtIndex)
 Get the instance of a local texture.
 
const StringgetTextureInstanceName (const String &name, size_t mrtIndex)
 Get the instance name for a local texture.
 
void notifyResized ()
 Notify this instance that the primary surface has been resized.
 
void removeListener (Listener *l)
 Remove a listener.
 
void setAlive (bool value)
 Set alive/active flag.
 
void setEnabled (bool value)
 Set enabled flag.
 
void setScheme (const String &schemeName, bool reuseTextures=true)
 Pick a technique to use to render this compositor based on a scheme.
 
void setTechnique (CompositionTechnique *tech, bool reuseTextures=true)
 Change the technique we're using to render this compositor.
 

Detailed Description

An instance of a Compositor object for one Viewport.

It is part of the CompositorChain for a Viewport.

Member Typedef Documentation

◆ RenderSystemOpPair

◆ RenderSystemOpPairs

◆ CompiledState

Constructor & Destructor Documentation

◆ CompositorInstance()

Ogre::CompositorInstance::CompositorInstance ( CompositionTechnique technique,
CompositorChain chain 
)

◆ ~CompositorInstance()

virtual Ogre::CompositorInstance::~CompositorInstance ( )
virtual

Member Function Documentation

◆ setEnabled()

void Ogre::CompositorInstance::setEnabled ( bool  value)

Set enabled flag.

The compositor instance will only render if it is enabled, otherwise it is pass-through. Resources are only created if they weren't alive when enabling.

◆ getEnabled()

bool Ogre::CompositorInstance::getEnabled ( ) const
inline

Get enabled flag.

◆ setAlive()

void Ogre::CompositorInstance::setAlive ( bool  value)

Set alive/active flag.

The compositor instance will create resources when alive, and destroy them when inactive.

Killing an instance means also disabling it: setAlive(false) implies setEnabled(false)

◆ getAlive()

bool Ogre::CompositorInstance::getAlive ( ) const
inline

Get alive flag.

◆ getTextureInstanceName()

const String & Ogre::CompositorInstance::getTextureInstanceName ( const String name,
size_t  mrtIndex 
)

Get the instance name for a local texture.

Note
It is only valid to call this when local textures have been loaded, which in practice means that the compositor instance is active. Calling it at other times will cause an exception. Note that since textures are cleaned up aggressively, this name is not guaranteed to stay the same if you disable and re-enable the compositor instance.
Parameters
nameThe name of the texture in the original compositor definition.
mrtIndexIf name identifies a MRT, which texture attachment to retrieve.
Returns
The instance name for the texture, corresponds to a real texture.

◆ getTextureInstance()

const TexturePtr & Ogre::CompositorInstance::getTextureInstance ( const String name,
size_t  mrtIndex 
)

Get the instance of a local texture.

Note
Textures are only valid when local textures have been loaded, which in practice means that the compositor instance is active. Calling this method at other times will return null pointers. Note that since textures are cleaned up aggressively, this pointer is not guaranteed to stay the same if you disable and re-enable the compositor instance.
Parameters
nameThe name of the texture in the original compositor definition.
mrtIndexIf name identifies a MRT, which texture attachment to retrieve.
Returns
The texture pointer, corresponds to a real texture.

◆ getRenderTarget()

RenderTarget * Ogre::CompositorInstance::getRenderTarget ( const String name,
int  slice = 0 
)

Get the render target for a given render texture name.

You can use this to add listeners etc, but do not use it to update the targets manually or any other modifications, the compositor instance is in charge of this.

◆ _compileTargetOperations()

virtual void Ogre::CompositorInstance::_compileTargetOperations ( CompiledState compiledState)
virtual

Recursively collect target states (except for final Pass).

Parameters
compiledStateThis vector will contain a list of TargetOperation objects.

◆ _compileOutputOperation()

virtual void Ogre::CompositorInstance::_compileOutputOperation ( TargetOperation finalState)
virtual

Compile the final (output) operation.

This is done separately because this is combined with the input in chained filters.

◆ getCompositor()

Compositor * Ogre::CompositorInstance::getCompositor ( ) const
inline

Get Compositor of which this is an instance.

◆ getTechnique()

CompositionTechnique * Ogre::CompositorInstance::getTechnique ( ) const
inline

Get CompositionTechnique used by this instance.

◆ setTechnique()

void Ogre::CompositorInstance::setTechnique ( CompositionTechnique tech,
bool  reuseTextures = true 
)

Change the technique we're using to render this compositor.

Parameters
techThe technique to use (must be supported and from the same Compositor)
reuseTexturesIf textures have already been created for the current technique, whether to try to re-use them if sizes & formats match.

◆ setScheme()

void Ogre::CompositorInstance::setScheme ( const String schemeName,
bool  reuseTextures = true 
)

Pick a technique to use to render this compositor based on a scheme.

If there is no specific supported technique with this scheme name, then the first supported technique with no specific scheme will be used.

See also
CompositionTechnique::setSchemeName
Parameters
schemeNameThe scheme to use
reuseTexturesIf 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.

◆ getScheme()

const String & Ogre::CompositorInstance::getScheme ( ) const
inline

Returns the name of the scheme this compositor is using.

References Ogre::BLANKSTRING.

◆ notifyResized()

void Ogre::CompositorInstance::notifyResized ( )

Notify this instance that the primary surface has been resized.

This will allow the instance to recreate its resources that are dependent on the size.

◆ getChain()

CompositorChain * Ogre::CompositorInstance::getChain ( )

Get Chain that this instance is part of.

◆ addListener()

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.

See also
CompositorInstance::Listener

◆ removeListener()

void Ogre::CompositorInstance::removeListener ( Listener l)

Remove a listener.

See also
CompositorInstance::Listener

◆ _fireNotifyMaterialSetup()

void Ogre::CompositorInstance::_fireNotifyMaterialSetup ( uint32  pass_id,
MaterialPtr mat 
)

Notify listeners of a material compilation.

◆ _fireNotifyMaterialRender()

void Ogre::CompositorInstance::_fireNotifyMaterialRender ( uint32  pass_id,
MaterialPtr mat 
)

Notify listeners of a material render.

◆ _fireNotifyResourcesCreated()

void Ogre::CompositorInstance::_fireNotifyResourcesCreated ( bool  forResizeOnly)

Notify listeners of a material render.

◆ _fireNotifyResourcesReleased()

void Ogre::CompositorInstance::_fireNotifyResourcesReleased ( bool  forResizeOnly)

Notify listeners resources.


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