OGRE: Ogre::RTShader::ShaderGenerator Class Reference - OGRE Documentation

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends

# Ogre::RTShader::ShaderGenerator Class Reference
[RTShader]

Shader generator system main interface. More...

`#include <OgreShaderGenerator.h>`

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

List of all members.

## Classes
class | SGMaterial
| Shader generator material wrapper class. More...
class | SGPass
| Shader generator pass wrapper class. More...
class | SGRenderObjectListener
| Shader generator RenderObjectListener sub class. More...
class | SGSceneManagerListener
| Shader generator scene manager sub class. More...
class | SGScheme
| Shader generator scheme class. More...
class | SGScriptTranslatorManager
| Shader generator ScriptTranslatorManager sub class. More...
class | SGTechnique
| Shader generator technique wrapper class. More...
## Public Member Functions
void | addSceneManager (SceneManager *sceneMgr)
| Add a scene manager to the shader generator scene managers list.
void | removeSceneManager (SceneManager *sceneMgr)
| Remove a scene manager from the shader generator scene managers list.
SceneManager * | getActiveSceneManager ()
| Get the active scene manager that is doint the actual scene rendering.
void | setTargetLanguage (const String &shaderLanguage)
| Set the target shader language.
const String & | getTargetLanguage () const
| Return the target shader language currently in use.
void | setVertexShaderProfiles (const String &vertexShaderProfiles)
| Set the output vertex shader target profiles.
const String & | getVertexShaderProfiles () const
| Get the output vertex shader target profiles.
const StringVector & | getVertexShaderProfilesList () const
| Get the output vertex shader target profiles as list of strings.
void | setFragmentShaderProfiles (const String &fragmentShaderProfiles)
| Set the output fragment shader target profiles.
const String & | getFragmentShaderProfiles () const
| Get the output fragment shader target profiles.
const StringVector & | getFragmentShaderProfilesList () const
| Get the output fragment shader target profiles as list of strings.
void | setShaderCachePath (const String &cachePath)
| Set the output shader cache path.
const String & | getShaderCachePath () const
| Get the output shader cache path.
void | flushShaderCache ()
| Flush the shader cache.
RenderState * | getRenderState (const String &schemeName)
| Return a global render state associated with the given scheme name.
RenderState * | getRenderState (const String &schemeName, const String &materialName, unsigned short passIndex)
| Get render state of specific pass.
void | addSubRenderStateFactory (SubRenderStateFactory *factory)
| Add sub render state factory.
void | removeSubRenderStateFactory (SubRenderStateFactory *factory)
| Remove sub render state factory.
SubRenderState * | createSubRenderState (const String &type)
| Create an instance of sub render state from a given type.
void | destroySubRenderState (SubRenderState *subRenderState)
| Destroy an instance of sub render state.
bool | createShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
| Create shader based technique from a given technique.
bool | removeShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
| Remove shader based technique from a given technique.
bool | removeAllShaderBasedTechniques (const String &materialName)
| Remove all shader based techniques of the given material.
void | removeAllShaderBasedTechniques ()
| Remove all shader based techniques that created by this shader generator.
void | createScheme (const String &schemeName)
| Create a scheme.
void | invalidateScheme (const String &schemeName)
| Invalidate a given scheme.
bool | validateScheme (const String &schemeName)
| Validate a given scheme.
void | invalidateMaterial (const String &schemeName, const String &materialName)
| Invalidate specific material scheme.
bool | validateMaterial (const String &schemeName, const String &materialName)
| Validate specific material scheme.
SGMaterialSerializerListener * | getMaterialSerializerListener ()
| Return custom material Serializer of the shader generator.
size_t | getVertexShaderCount () const
| Return the current number of generated vertex shaders.
size_t | getFragmentShaderCount () const
| Return the current number of generated fragment shaders.
void | setVertexShaderOutputsCompactPolicy (VSOutputCompactPolicy policy)
| Set the vertex shader outputs compaction policy.
VSOutputCompactPolicy | getVertexShaderOutputsCompactPolicy () const
| Get the vertex shader outputs compaction policy.
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
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 *)
## Static Public Member Functions
static bool | initialize ()
| Initialize the Shader Generator System.
static void | finalize ()
| Finalize the Shader Generator instance.
static ShaderGenerator & | getSingleton ()
| Override standard Singleton retrieval.
static ShaderGenerator * | getSingletonPtr ()
| Override standard Singleton retrieval.
static ShaderGenerator & | getSingleton (void)
static ShaderGenerator * | getSingletonPtr (void)
## Static Public Attributes
static String | DEFAULT_SCHEME_NAME
| Default material scheme of the shader generator.
## Protected Types
typedef vector< SGPass * >::type | SGPassList
typedef SGPassList::iterator | SGPassIterator
typedef SGPassList::const_iterator | SGPassConstIterator
typedef vector< SGTechnique * > ::type | SGTechniqueList
typedef SGTechniqueList::iterator | SGTechniqueIterator
typedef SGTechniqueList::const_iterator | SGTechniqueConstIterator
typedef map< SGTechnique *, SGTechnique * >::type | SGTechniqueMap
typedef SGTechniqueMap::iterator | SGTechniqueMapIterator
typedef map< String, SGMaterial * >::type | SGMaterialMap
typedef SGMaterialMap::iterator | SGMaterialIterator
typedef SGMaterialMap::const_iterator | SGMaterialConstIterator
typedef map< String, SGScheme * > ::type | SGSchemeMap
typedef SGSchemeMap::iterator | SGSchemeIterator
typedef SGMaterialMap::const_iterator | SGSchemeConstIterator
typedef map< String, ScriptTranslator * >::type | SGScriptTranslatorMap
typedef SGScriptTranslatorMap::iterator | SGScriptTranslatorIterator
typedef SGScriptTranslatorMap::const_iterator | SGScriptTranslatorConstIterator
typedef map< String, SubRenderStateFactory * > ::type | SubRenderStateFactoryMap
typedef SubRenderStateFactoryMap::iterator | SubRenderStateFactoryIterator
typedef SubRenderStateFactoryMap::const_iterator | SubRenderStateFactoryConstIterator
typedef map< String, SceneManager * >::type | SceneManagerMap
typedef SceneManagerMap::iterator | SceneManagerIterator
typedef SceneManagerMap::const_iterator | SceneManagerConstIterator
## Protected Member Functions
| ShaderGenerator ()
| Class default constructor.
| ~ShaderGenerator ()
| Class destructor.
bool | _initialize ()
| Initialize the shader generator instance.
void | _finalize ()
| Finalize the shader generator instance.
Technique * | findSourceTechnique (const String &materialName, const String &srcTechniqueSchemeName)
| Find source technique to generate shader based technique based on it.
void | notifyRenderSingleObject (Renderable *rend, const Pass *pass, const AutoParamDataSource *source, const LightList *pLightList, bool suppressRenderStateChanges)
| Called from the sub class of the RenderObjectLister when single object is rendered.
void | preFindVisibleObjects (SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
| Called from the sub class of the SceneManager::Listener when finding visible object process starts.
void | createSubRenderStateExFactories ()
| Create sub render state core extensions factories.
void | destroySubRenderStateExFactories ()
| Destroy sub render state core extensions factories.
SubRenderState * | createSubRenderState (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass)
| Create an instance of the SubRenderState based on script properties using the current sub render state factories.
bool | addCustomScriptTranslator (const String &key, ScriptTranslator *translator)
| Add custom script translator.
bool | removeCustomScriptTranslator (const String &key)
| Remove custom script translator.
size_t | getNumTranslators () const
| Return number of script translators.
ScriptTranslator * | getTranslator (const AbstractNodePtr &node)
| Return a matching script translator.
void | serializePassAttributes (MaterialSerializer *ser, SGPass *passEntry)
| This method called by instance of SGMaterialSerializerListener and serialize a given pass entry attributes.
## Protected Attributes
OGRE_AUTO_MUTEX SceneManager * | mActiveSceneMgr
SceneManagerMap | mSceneManagerMap
SGRenderObjectListener * | mRenderObjectListener
SGSceneManagerListener * | mSceneManagerListener
SGScriptTranslatorManager * | mScriptTranslatorManager
SGMaterialSerializerListener * | mMaterialSerializerListener
SGScriptTranslatorMap | mScriptTranslatorsMap
SGScriptTranslator | mCoreScriptTranslator
String | mShaderLanguage
String | mVertexShaderProfiles
StringVector | mVertexShaderProfilesList
String | mFragmentShaderProfiles
StringVector | mFragmentShaderProfilesList
String | mShaderCachePath
ProgramManager * | mProgramManager
ProgramWriterManager * | mProgramWriterManager
FFPRenderStateBuilder * | mFFPRenderStateBuilder
SGMaterialMap | mMaterialEntriesMap
SGSchemeMap | mSchemeEntriesMap
SGTechniqueMap | mTechniqueEntriesMap
SubRenderStateFactoryMap | mSubRenderStateFactories
SubRenderStateFactoryMap | mSubRenderStateExFactories
bool | mActiveViewportValid
int | mLightCount [3]
VSOutputCompactPolicy | mVSOutputCompactPolicy
## Static Protected Attributes
static ShaderGenerator * | ms_Singleton
## Friends
class | SGPass
class | FFPRenderStateBuilder
class | SGScriptTranslatorManager
class | SGScriptTranslator
class | SGMaterialSerializerListener

## Detailed Description

Shader generator system main interface.

This singleton based class enables automatic generation of shader code based on existing material techniques.

Definition at line 52 of file OgreShaderGenerator.h.

## Member Typedef Documentation

typedef SceneManagerMap::const_iterator Ogre::RTShader::ShaderGenerator::SceneManagerConstIterator`[protected]`

Definition at line 677 of file OgreShaderGenerator.h.

typedef SceneManagerMap::iterator Ogre::RTShader::ShaderGenerator::SceneManagerIterator`[protected]`

Definition at line 676 of file OgreShaderGenerator.h.

typedef map<String, SceneManager*>::type Ogre::RTShader::ShaderGenerator::SceneManagerMap`[protected]`

Definition at line 675 of file OgreShaderGenerator.h.

typedef SGMaterialMap::const_iterator Ogre::RTShader::ShaderGenerator::SGMaterialConstIterator`[protected]`

Definition at line 362 of file OgreShaderGenerator.h.

typedef SGMaterialMap::iterator Ogre::RTShader::ShaderGenerator::SGMaterialIterator`[protected]`

Definition at line 361 of file OgreShaderGenerator.h.

typedef map<String, SGMaterial*>::type Ogre::RTShader::ShaderGenerator::SGMaterialMap`[protected]`

Definition at line 360 of file OgreShaderGenerator.h.

typedef SGPassList::const_iterator Ogre::RTShader::ShaderGenerator::SGPassConstIterator`[protected]`

Definition at line 351 of file OgreShaderGenerator.h.

typedef SGPassList::iterator Ogre::RTShader::ShaderGenerator::SGPassIterator`[protected]`

Definition at line 350 of file OgreShaderGenerator.h.

typedef vector<SGPass*>::type Ogre::RTShader::ShaderGenerator::SGPassList`[protected]`

Definition at line 347 of file OgreShaderGenerator.h.

typedef SGMaterialMap::const_iterator Ogre::RTShader::ShaderGenerator::SGSchemeConstIterator`[protected]`

Definition at line 366 of file OgreShaderGenerator.h.

typedef SGSchemeMap::iterator Ogre::RTShader::ShaderGenerator::SGSchemeIterator`[protected]`

Definition at line 365 of file OgreShaderGenerator.h.

typedef map<String, SGScheme*>::type Ogre::RTShader::ShaderGenerator::SGSchemeMap`[protected]`

Definition at line 364 of file OgreShaderGenerator.h.

typedef SGScriptTranslatorMap::const_iterator Ogre::RTShader::ShaderGenerator::SGScriptTranslatorConstIterator`[protected]`

Definition at line 370 of file OgreShaderGenerator.h.

typedef SGScriptTranslatorMap::iterator Ogre::RTShader::ShaderGenerator::SGScriptTranslatorIterator`[protected]`

Definition at line 369 of file OgreShaderGenerator.h.

typedef map<String, ScriptTranslator*>::type Ogre::RTShader::ShaderGenerator::SGScriptTranslatorMap`[protected]`

Definition at line 368 of file OgreShaderGenerator.h.

typedef SGTechniqueList::const_iterator Ogre::RTShader::ShaderGenerator::SGTechniqueConstIterator`[protected]`

Definition at line 355 of file OgreShaderGenerator.h.

typedef SGTechniqueList::iterator Ogre::RTShader::ShaderGenerator::SGTechniqueIterator`[protected]`

Definition at line 354 of file OgreShaderGenerator.h.

typedef vector<SGTechnique*>::type Ogre::RTShader::ShaderGenerator::SGTechniqueList`[protected]`

Definition at line 353 of file OgreShaderGenerator.h.

typedef map<SGTechnique*, SGTechnique*>::type Ogre::RTShader::ShaderGenerator::SGTechniqueMap`[protected]`

Definition at line 357 of file OgreShaderGenerator.h.

typedef SGTechniqueMap::iterator Ogre::RTShader::ShaderGenerator::SGTechniqueMapIterator`[protected]`

Definition at line 358 of file OgreShaderGenerator.h.

typedef SubRenderStateFactoryMap::const_iterator Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryConstIterator`[protected]`

Definition at line 672 of file OgreShaderGenerator.h.

typedef SubRenderStateFactoryMap::iterator Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryIterator`[protected]`

Definition at line 671 of file OgreShaderGenerator.h.

typedef map<String, SubRenderStateFactory*>::type Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryMap`[protected]`

Definition at line 670 of file OgreShaderGenerator.h.

## Constructor & Destructor Documentation

Ogre::RTShader::ShaderGenerator::ShaderGenerator | ( |  | ) | `[protected]`

Class default constructor.

Ogre::RTShader::ShaderGenerator::~ShaderGenerator | ( |  | ) | `[protected]`

Class destructor.

## Member Function Documentation

void Ogre::RTShader::ShaderGenerator::_finalize | ( |  | ) | `[protected]`

Finalize the shader generator instance.

bool Ogre::RTShader::ShaderGenerator::_initialize | ( |  | ) | `[protected]`

Initialize the shader generator instance.

bool Ogre::RTShader::ShaderGenerator::addCustomScriptTranslator | ( | const String & | key,
|  | ScriptTranslator * | translator |
| ) |  |  | `[protected]`

Add custom script translator.

Return true upon success.

Parameters:

  | key | The key name of the given translator.
  | translator | The translator to associate with the given key.

void Ogre::RTShader::ShaderGenerator::addSceneManager | ( | SceneManager * | sceneMgr | ) |

Add a scene manager to the shader generator scene managers list.

Parameters:

  | sceneMgr | The scene manager to add to the list.

void Ogre::RTShader::ShaderGenerator::addSubRenderStateFactory | ( | SubRenderStateFactory * | factory | ) |

Add sub render state factory.

Plugins or 3d party applications may implement sub classes of SubRenderState interface. Add the matching factory will allow the application to create instances of these sub classes.

Parameters:

  | factory | The factory to add.

void Ogre::RTShader::ShaderGenerator::createScheme | ( | const String & | schemeName | ) |

Create a scheme.

Parameters:

  | schemeName | The scheme name to create.

bool Ogre::RTShader::ShaderGenerator::createShaderBasedTechnique | ( | const String & | materialName,
|  | const String & | srcTechniqueSchemeName,
|  | const String & | dstTechniqueSchemeName |
| ) |  |  |

Create shader based technique from a given technique.

Return true upon success. Failure may occur if the source technique is not FFP pure, or different source technique is mapped to the requested destination scheme.

Parameters:

  | materialName | The source material name.
  | srcTechniqueSchemeName | The source technique scheme name.
  | dstTechniqueSchemeName | The destination shader based technique scheme name.

SubRenderState* Ogre::RTShader::ShaderGenerator::createSubRenderState | ( | const String & | type | ) |

Create an instance of sub render state from a given type.

Parameters:

  | type | The type of sub render state to create.

SubRenderState* Ogre::RTShader::ShaderGenerator::createSubRenderState | ( | ScriptCompiler * | compiler,
|  | PropertyAbstractNode * | prop,
|  | Pass * | pass |
| ) |  |  | `[protected]`

Create an instance of the SubRenderState based on script properties using the current sub render state factories.

See also:
  SubRenderStateFactory::createInstance

Parameters:

  | compiler | The compiler instance.
  | prop | The abstract property node.
  | pass | The pass that is the parent context of this node.

void Ogre::RTShader::ShaderGenerator::createSubRenderStateExFactories | ( |  | ) | `[protected]`

Create sub render state core extensions factories.

void Ogre::RTShader::ShaderGenerator::destroySubRenderState | ( | SubRenderState * | subRenderState | ) |

Destroy an instance of sub render state.

Parameters:

  | subRenderState | The instance to destroy.

void Ogre::RTShader::ShaderGenerator::destroySubRenderStateExFactories | ( |  | ) | `[protected]`

Destroy sub render state core extensions factories.

static void Ogre::RTShader::ShaderGenerator::finalize | ( |  | ) | `[static]`

Finalize the Shader Generator instance.

Technique* Ogre::RTShader::ShaderGenerator::findSourceTechnique | ( | const String & | materialName,
|  | const String & | srcTechniqueSchemeName |
| ) |  |  | `[protected]`

Find source technique to generate shader based technique based on it.

void Ogre::RTShader::ShaderGenerator::flushShaderCache | ( |  | ) |

Flush the shader cache.

This operation will cause all active sachems to be invalidated and will destroy any CPU/GPU program that created by this shader generator.

SceneManager* Ogre::RTShader::ShaderGenerator::getActiveSceneManager | ( |  | ) |

Get the active scene manager that is doint the actual scene rendering.

This attribute will be update on the call to preFindVisibleObjects.

size_t Ogre::RTShader::ShaderGenerator::getFragmentShaderCount | ( |  | ) | const

Return the current number of generated fragment shaders.

const String& Ogre::RTShader::ShaderGenerator::getFragmentShaderProfiles | ( |  | ) | const

Get the output fragment shader target profiles.

Definition at line 161 of file OgreShaderGenerator.h.

const StringVector& Ogre::RTShader::ShaderGenerator::getFragmentShaderProfilesList | ( |  | ) | const

Get the output fragment shader target profiles as list of strings.

Definition at line 166 of file OgreShaderGenerator.h.

SGMaterialSerializerListener* Ogre::RTShader::ShaderGenerator::getMaterialSerializerListener | ( |  | ) |

Return custom material Serializer of the shader generator.

This is useful when you'd like to export certain material that contains shader generator effects. I.E - when writing an exporter you may want mark your material as shader generated material so in the next time you will load it by your application it will automatically generate shaders with custom attributes you wanted. To do it you'll have to do the following steps: 1. Create shader based technique for you material via the createShaderBasedTechnique() method. 2. Create MaterialSerializer instance. 3. Add the return instance of serializer listener to the MaterialSerializer. 4. Call one of the export methods of MaterialSerializer.

size_t Ogre::RTShader::ShaderGenerator::getNumTranslators | ( |  | ) | const`[protected]`

Return number of script translators.

Referenced by Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager::getNumTranslators().

RenderState* Ogre::RTShader::ShaderGenerator::getRenderState | ( | const String & | schemeName | ) |

Return a global render state associated with the given scheme name.

Modifying this render state will affect all techniques that belongs to that scheme. This is the best way to apply global changes to all techniques. After altering the render state one should call invalidateScheme method in order to regenerate shaders.

Parameters:

  | schemeName | The destination scheme name.

RenderState* Ogre::RTShader::ShaderGenerator::getRenderState | ( | const String & | schemeName,
|  | const String & | materialName,
|  | unsigned short | passIndex |
| ) |  |  |

Get render state of specific pass.

Using this method allows the user to customize the behavior of a specific pass.

Parameters:

  | schemeName | The destination scheme name.
  | materialName | The specific material name.
  | passIndex | The pass index.

const String& Ogre::RTShader::ShaderGenerator::getShaderCachePath | ( |  | ) | const

Get the output shader cache path.

Definition at line 179 of file OgreShaderGenerator.h.

static ShaderGenerator & Ogre::Singleton< ShaderGenerator >::getSingleton | ( | void |  | ) | `[static, inherited]`

Definition at line 90 of file OgreSingleton.h.

static ShaderGenerator& Ogre::RTShader::ShaderGenerator::getSingleton | ( |  | ) | `[static]`

Override standard Singleton retrieval.

Remarks:
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

static ShaderGenerator* Ogre::RTShader::ShaderGenerator::getSingletonPtr | ( |  | ) | `[static]`

Override standard Singleton retrieval.

Remarks:
  Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

  This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

static ShaderGenerator * Ogre::Singleton< ShaderGenerator >::getSingletonPtr | ( | void |  | ) | `[static, inherited]`

Definition at line 92 of file OgreSingleton.h.

const String& Ogre::RTShader::ShaderGenerator::getTargetLanguage | ( |  | ) | const

Return the target shader language currently in use.

Definition at line 133 of file OgreShaderGenerator.h.

ScriptTranslator* Ogre::RTShader::ShaderGenerator::getTranslator | ( | const AbstractNodePtr & | node | ) | `[protected]`

Return a matching script translator.

size_t Ogre::RTShader::ShaderGenerator::getVertexShaderCount | ( |  | ) | const

Return the current number of generated vertex shaders.

VSOutputCompactPolicy Ogre::RTShader::ShaderGenerator::getVertexShaderOutputsCompactPolicy | ( |  | ) | const

Get the vertex shader outputs compaction policy.

See also:
  VSOutputCompactPolicy.

Definition at line 337 of file OgreShaderGenerator.h.

const String& Ogre::RTShader::ShaderGenerator::getVertexShaderProfiles | ( |  | ) | const

Get the output vertex shader target profiles.

Definition at line 144 of file OgreShaderGenerator.h.

const StringVector& Ogre::RTShader::ShaderGenerator::getVertexShaderProfilesList | ( |  | ) | const

Get the output vertex shader target profiles as list of strings.

Definition at line 149 of file OgreShaderGenerator.h.

static bool Ogre::RTShader::ShaderGenerator::initialize | ( |  | ) | `[static]`

Initialize the Shader Generator System.

Return true upon success.

Parameters:

  | sceneMgr | The scene manager that the shader generator will be bound to.

void Ogre::RTShader::ShaderGenerator::invalidateMaterial | ( | const String & | schemeName,
|  | const String & | materialName |
| ) |  |  |

Invalidate specific material scheme.

This action will lead to shader regeneration of the technique belongs to the given scheme name.

Parameters:

  | schemeName | The scheme to invalidate.
  | materialName | The material to invalidate.

void Ogre::RTShader::ShaderGenerator::invalidateScheme | ( | const String & | schemeName | ) |

Invalidate a given scheme.

This action will lead to shader regeneration of all techniques belongs to the given scheme name.

Parameters:

  | schemeName | The scheme to invalidate.

void Ogre::RTShader::ShaderGenerator::notifyRenderSingleObject | ( | Renderable * | rend,
|  | const Pass * | pass,
|  | const AutoParamDataSource * | source,
|  | const LightList * | pLightList,
|  | bool | suppressRenderStateChanges |
| ) |  |  | `[protected]`

Called from the sub class of the RenderObjectLister when single object is rendered.

Referenced by Ogre::RTShader::ShaderGenerator::SGRenderObjectListener::notifyRenderSingleObject().

template<class Alloc >

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

Definition at line 107 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 118 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 112 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 72 of file OgreMemoryAllocatedObject.h.

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 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

placement operator new

Definition at line 78 of file OgreMemoryAllocatedObject.h.

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 85 of file OgreMemoryAllocatedObject.h.

template<class Alloc >

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

Definition at line 90 of file OgreMemoryAllocatedObject.h.

void Ogre::RTShader::ShaderGenerator::preFindVisibleObjects | ( | SceneManager * | source,
|  | SceneManager::IlluminationRenderStage | irs,
|  | Viewport * | v |
| ) |  |  | `[protected]`

Called from the sub class of the SceneManager::Listener when finding visible object process starts.

Referenced by Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::preFindVisibleObjects().

void Ogre::RTShader::ShaderGenerator::removeAllShaderBasedTechniques | ( |  | ) |

Remove all shader based techniques that created by this shader generator.

bool Ogre::RTShader::ShaderGenerator::removeAllShaderBasedTechniques | ( | const String & | materialName | ) |

Remove all shader based techniques of the given material.

Return true upon success.

Parameters:

  | materialName | The source material name.

bool Ogre::RTShader::ShaderGenerator::removeCustomScriptTranslator | ( | const String & | key | ) | `[protected]`

Remove custom script translator.

Return true upon success.

Parameters:

  | key | The key name of the translator to remove.

void Ogre::RTShader::ShaderGenerator::removeSceneManager | ( | SceneManager * | sceneMgr | ) |

Remove a scene manager from the shader generator scene managers list.

Parameters:

  | sceneMgr | The scene manager to remove from the list.

bool Ogre::RTShader::ShaderGenerator::removeShaderBasedTechnique | ( | const String & | materialName,
|  | const String & | srcTechniqueSchemeName,
|  | const String & | dstTechniqueSchemeName |
| ) |  |  |

Remove shader based technique from a given technique.

Return true upon success. Failure may occur if the given source technique was not previously registered successfully using the createShaderBasedTechnique method.

Parameters:

  | materialName | The source material name.
  | srcTechniqueSchemeName | The source technique scheme name.
  | dstTechniqueSchemeName | The destination shader based technique scheme name.

void Ogre::RTShader::ShaderGenerator::removeSubRenderStateFactory | ( | SubRenderStateFactory * | factory | ) |

Remove sub render state factory.

Parameters:

  | factory | The factory to remove.

void Ogre::RTShader::ShaderGenerator::serializePassAttributes | ( | MaterialSerializer * | ser,
|  | SGPass * | passEntry |
| ) |  |  | `[protected]`

This method called by instance of SGMaterialSerializerListener and serialize a given pass entry attributes.

Parameters:

  | ser | The material serializer.
  | passEntry | The SGPass instance.

void Ogre::RTShader::ShaderGenerator::setFragmentShaderProfiles | ( | const String & | fragmentShaderProfiles | ) |

Set the output fragment shader target profiles.

Parameters:

  | fragmentShaderProfile | The target profiles for the fragment shader.

void Ogre::RTShader::ShaderGenerator::setShaderCachePath | ( | const String & | cachePath | ) |

Set the output shader cache path.

Generated shader code will be written to this path. In case of empty cache path shaders will be generated directly from system memory.

Parameters:

  | cachePath | The cache path of the shader. The default is empty cache path.

void Ogre::RTShader::ShaderGenerator::setTargetLanguage | ( | const String & | shaderLanguage | ) |

Set the target shader language.

Parameters:

  | shaderLanguage | The output shader language to use.

Remarks:
  The default shader language is cg.

void Ogre::RTShader::ShaderGenerator::setVertexShaderOutputsCompactPolicy | ( | VSOutputCompactPolicy | policy | ) |

Set the vertex shader outputs compaction policy.

See also:
  VSOutputCompactPolicy.

Parameters:

  | policy | The policy to set.

Definition at line 332 of file OgreShaderGenerator.h.

void Ogre::RTShader::ShaderGenerator::setVertexShaderProfiles | ( | const String & | vertexShaderProfiles | ) |

Set the output vertex shader target profiles.

Parameters:

  | vertexShaderProfile | The target profiles for the vertex shader.

bool Ogre::RTShader::ShaderGenerator::validateMaterial | ( | const String & | schemeName,
|  | const String & | materialName |
| ) |  |  |

Validate specific material scheme.

This action will generate shader programs for the technique of the given scheme name.

Parameters:

  | schemeName | The scheme to validate.
  | materialName | The material to validate.

bool Ogre::RTShader::ShaderGenerator::validateScheme | ( | const String & | schemeName | ) |

Validate a given scheme.

This action will generate shader programs for all techniques of the given scheme name.

Parameters:

  | schemeName | The scheme to validate.

## Friends And Related Function Documentation

friend class FFPRenderStateBuilder`[friend]`

Definition at line 777 of file OgreShaderGenerator.h.

friend class SGMaterialSerializerListener`[friend]`

Definition at line 780 of file OgreShaderGenerator.h.

friend class SGPass`[friend]`

Definition at line 776 of file OgreShaderGenerator.h.

friend class SGScriptTranslator`[friend]`

Definition at line 779 of file OgreShaderGenerator.h.

friend class SGScriptTranslatorManager`[friend]`

Definition at line 778 of file OgreShaderGenerator.h.

## Member Data Documentation

String Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME`[static]`

Default material scheme of the shader generator.

Definition at line 340 of file OgreShaderGenerator.h.

OGRE_AUTO_MUTEX SceneManager* Ogre::RTShader::ShaderGenerator::mActiveSceneMgr`[protected]`

Definition at line 749 of file OgreShaderGenerator.h.

bool Ogre::RTShader::ShaderGenerator::mActiveViewportValid`[protected]`

Definition at line 771 of file OgreShaderGenerator.h.

SGScriptTranslator Ogre::RTShader::ShaderGenerator::mCoreScriptTranslator`[protected]`

Definition at line 756 of file OgreShaderGenerator.h.

FFPRenderStateBuilder* Ogre::RTShader::ShaderGenerator::mFFPRenderStateBuilder`[protected]`

Definition at line 765 of file OgreShaderGenerator.h.

String Ogre::RTShader::ShaderGenerator::mFragmentShaderProfiles`[protected]`

Definition at line 760 of file OgreShaderGenerator.h.

StringVector Ogre::RTShader::ShaderGenerator::mFragmentShaderProfilesList`[protected]`

Definition at line 761 of file OgreShaderGenerator.h.

int Ogre::RTShader::ShaderGenerator::mLightCount[3]`[protected]`

Definition at line 772 of file OgreShaderGenerator.h.

SGMaterialMap Ogre::RTShader::ShaderGenerator::mMaterialEntriesMap`[protected]`

Definition at line 766 of file OgreShaderGenerator.h.

SGMaterialSerializerListener* Ogre::RTShader::ShaderGenerator::mMaterialSerializerListener`[protected]`

Definition at line 754 of file OgreShaderGenerator.h.

ProgramManager* Ogre::RTShader::ShaderGenerator::mProgramManager`[protected]`

Definition at line 763 of file OgreShaderGenerator.h.

ProgramWriterManager* Ogre::RTShader::ShaderGenerator::mProgramWriterManager`[protected]`

Definition at line 764 of file OgreShaderGenerator.h.

SGRenderObjectListener* Ogre::RTShader::ShaderGenerator::mRenderObjectListener`[protected]`

Definition at line 751 of file OgreShaderGenerator.h.

ShaderGenerator * Ogre::Singleton< ShaderGenerator >::ms_Singleton`[static, protected, inherited]`

Definition at line 75 of file OgreSingleton.h.

SGSceneManagerListener* Ogre::RTShader::ShaderGenerator::mSceneManagerListener`[protected]`

Definition at line 752 of file OgreShaderGenerator.h.

SceneManagerMap Ogre::RTShader::ShaderGenerator::mSceneManagerMap`[protected]`

Definition at line 750 of file OgreShaderGenerator.h.

SGSchemeMap Ogre::RTShader::ShaderGenerator::mSchemeEntriesMap`[protected]`

Definition at line 767 of file OgreShaderGenerator.h.

SGScriptTranslatorManager* Ogre::RTShader::ShaderGenerator::mScriptTranslatorManager`[protected]`

Definition at line 753 of file OgreShaderGenerator.h.

SGScriptTranslatorMap Ogre::RTShader::ShaderGenerator::mScriptTranslatorsMap`[protected]`

Definition at line 755 of file OgreShaderGenerator.h.

String Ogre::RTShader::ShaderGenerator::mShaderCachePath`[protected]`

Definition at line 762 of file OgreShaderGenerator.h.

String Ogre::RTShader::ShaderGenerator::mShaderLanguage`[protected]`

Definition at line 757 of file OgreShaderGenerator.h.

SubRenderStateFactoryMap Ogre::RTShader::ShaderGenerator::mSubRenderStateExFactories`[protected]`

Definition at line 770 of file OgreShaderGenerator.h.

SubRenderStateFactoryMap Ogre::RTShader::ShaderGenerator::mSubRenderStateFactories`[protected]`

Definition at line 769 of file OgreShaderGenerator.h.

SGTechniqueMap Ogre::RTShader::ShaderGenerator::mTechniqueEntriesMap`[protected]`

Definition at line 768 of file OgreShaderGenerator.h.

String Ogre::RTShader::ShaderGenerator::mVertexShaderProfiles`[protected]`

Definition at line 758 of file OgreShaderGenerator.h.

StringVector Ogre::RTShader::ShaderGenerator::mVertexShaderProfilesList`[protected]`

Definition at line 759 of file OgreShaderGenerator.h.

VSOutputCompactPolicy Ogre::RTShader::ShaderGenerator::mVSOutputCompactPolicy`[protected]`

Definition at line 773 of file OgreShaderGenerator.h.

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

- OgreShaderGenerator.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Wed Nov 3 2010 19:25:05