Loading...
Searching...
No Matches
Ogre::RTShader::SubRenderStateFactory Class Referenceabstract
Optional Components » RTShaderSystem

Abstract factory interface for creating SubRenderState implementation instances. More...

`#include <OgreShaderSubRenderState.h>`

Inheritance diagram for Ogre::RTShader::SubRenderStateFactory:
[legend]

## Public Member Functions

| SubRenderStateFactory ()
virtual | ~SubRenderStateFactory ()
virtual SubRenderState * | createInstance ()
| Create an instance of the SubRenderState sub class it suppose to create.
virtual SubRenderState * | createInstance (const ScriptProperty &prop, Pass *pass, SGScriptTranslator *translator)
| Create an instance of the SubRenderState based on script properties.
virtual SubRenderState * | createInstance (const ScriptProperty &prop, TextureUnitState *texState, SGScriptTranslator *translator)
| Create an instance of the SubRenderState based on script properties.
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
virtual SubRenderState * | createInstance (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
virtual SubRenderState * | createOrRetrieveInstance (SGScriptTranslator *translator)
| Retrieve the previous instance the SRS in the script translator or create a new instance if not found.
virtual void | destroyAllInstances ()
| Destroy all the instances that created by this factory.
virtual void | destroyInstance (SubRenderState *subRenderState)
| Destroy the given instance.
virtual const String & | getType () const =0
| Get the type of this sub render state factory.
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, const TextureUnitState *srcTextureUnit, const TextureUnitState *dstTextureUnit)
| Write the given sub-render state instance using the material serializer.
virtual void | writeInstance (MaterialSerializer *ser, SubRenderState *subRenderState, Pass *srcPass, Pass *dstPass)
| Write the given sub-render state instance using the material serializer.

## Detailed Description

Abstract factory interface for creating SubRenderState implementation instances.

Plugins or 3rd party applications can add new types of sub render states to the RTShader System by creating subclasses of the SubRenderState class. Because multiple instances of these sub class may be required, a factory class to manage the instances is also required.

  SubRenderStateFactory subclasses must allow the creation and destruction of SubRenderState subclasses. They must also be registered with the ShaderGenerator::addSubRenderStateFactory. All factories have a type which identifies them and the sub class of SubRenderState they creates.

## Constructor & Destructor Documentation

## SubRenderStateFactory()

Ogre::RTShader::SubRenderStateFactory::SubRenderStateFactory | ( |  | ) |

inline

## ~SubRenderStateFactory()

virtual Ogre::RTShader::SubRenderStateFactory::~SubRenderStateFactory | ( |  | ) |

virtual

## Member Function Documentation

## getType()

virtual const String & Ogre::RTShader::SubRenderStateFactory::getType | ( |  | ) | const

pure virtual

Get the type of this sub render state factory.

The type string should be the same as the type of the SubRenderState sub class it is going to create.

See also
  SubRenderState::getType.

Implemented in Ogre::RTShader::HardwareSkinningFactory.

## createInstance() [1/5]

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createInstance | ( |  | ) |

virtual

Create an instance of the SubRenderState sub class it suppose to create.

References OGRE_NODISCARD.

Referenced by createInstance().

## createInstance() [2/5]

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createInstance | ( | const ScriptProperty & | prop,
|  | Pass * | pass,
|  | SGScriptTranslator * | translator )

inline virtual

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters

  prop | The property
  pass | The pass that is the parent context of this node.
  translator | The translator instance holding existing scripts.

Reimplemented in Ogre::RTShader::HardwareSkinningFactory.

References createInstance(), and OGRE_NODISCARD.

## createInstance() [3/5]

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createInstance | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | Pass * | pass,
|  | SGScriptTranslator * | translator )

inline virtual

Deprecated

References OGRE_NODISCARD.

## createInstance() [4/5]

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createInstance | ( | const ScriptProperty & | prop,
|  | TextureUnitState * | texState,
|  | SGScriptTranslator * | translator )

inline virtual

Create an instance of the SubRenderState based on script properties.

This method is called in the context of script parsing and let this factory the opportunity to create custom SubRenderState instances based on extended script properties.

Parameters

  prop | The property
  texState | The pass that is the parent context of this node.
  translator | The translator instance holding existing scripts.

References OGRE_NODISCARD.

## createInstance() [5/5]

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createInstance | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | TextureUnitState * | texState,
|  | SGScriptTranslator * | translator )

inline virtual

Deprecated

References OGRE_NODISCARD.

## createOrRetrieveInstance()

virtual SubRenderState * Ogre::RTShader::SubRenderStateFactory::createOrRetrieveInstance | ( | SGScriptTranslator * | translator | ) |

virtual

Retrieve the previous instance the SRS in the script translator or create a new instance if not found.

Parameters

  translator | The translator instance holding existing scripts.

## destroyInstance()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyInstance | ( | SubRenderState * | subRenderState | ) |

virtual

Destroy the given instance.

Parameters

  subRenderState | The instance to destroy.

## destroyAllInstances()

virtual void Ogre::RTShader::SubRenderStateFactory::destroyAllInstances | ( |  | ) |

virtual

Destroy all the instances that created by this factory.

## writeInstance() [1/2]

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | Pass * | srcPass,
|  | Pass * | dstPass )

inline virtual

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters

  ser | The material serializer instance.
  subRenderState | The sub render state instance to write down.
  srcPass | The source pass.
  dstPass | The generated shader based pass.

Reimplemented in Ogre::RTShader::HardwareSkinningFactory.

## writeInstance() [2/2]

virtual void Ogre::RTShader::SubRenderStateFactory::writeInstance | ( | MaterialSerializer * | ser,
|  | SubRenderState * | subRenderState,
|  | const TextureUnitState * | srcTextureUnit,
|  | const TextureUnitState * | dstTextureUnit )

inline virtual

Write the given sub-render state instance using the material serializer.

This method is called in the context of material serialization. It is useful for integrating into bigger context of material exporters from various environment that want to take advantage of the RT Shader System. Sub classes of this interface should override in case they need to write custom properties into the script context.

Parameters

  ser | The material serializer instance.
  subRenderState | The sub render state instance to write down.
  srcTextureUnit | The source texture unit state.
  dstTextureUnit | The generated shader based texture unit state.

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

- OgreShaderSubRenderState.h