Classes | Public Types | 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

Shader generator system main interface. More...

#include <OgreShaderGenerator.h>

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

List of all members.

Classes

struct  MatGroupPair_less
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 Types

typedef std::pair< RenderState
*, bool > 
RenderStateCreateOrRetrieveResult

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.
SceneManagergetActiveSceneManager ()
 Get the active scene manager that is doint the actual scene rendering.
void setTargetLanguage (const String &shaderLanguage)
 Set the target shader language.
const StringgetTargetLanguage () const
 Return the target shader language currently in use.
void setVertexShaderProfiles (const String &vertexShaderProfiles)
 Set the output vertex shader target profiles.
const StringgetVertexShaderProfiles () const
 Get the output vertex shader target profiles.
const StringVectorgetVertexShaderProfilesList () 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 StringgetFragmentShaderProfiles () const
 Get the output fragment shader target profiles.
const StringVectorgetFragmentShaderProfilesList () const
 Get the output fragment shader target profiles as list of strings.
void setShaderCachePath (const String &cachePath)
 Set the output shader cache path.
const StringgetShaderCachePath () const
 Get the output shader cache path.
void flushShaderCache ()
 Flush the shader cache.
RenderStategetRenderState (const String &schemeName)
 Return a global render state associated with the given scheme name.
RenderStateCreateOrRetrieveResult createOrRetrieveRenderState (const String &schemeName)
 Returns a requested render state.
bool hasRenderState (const String &schemeName) const
 Tells if a given render state exists.
RenderStategetRenderState (const String &schemeName, const String &materialName, unsigned short passIndex)
 Get render state of specific pass.
RenderStategetRenderState (const String &schemeName, const String &materialName, const String &groupName, unsigned short passIndex)
void addSubRenderStateFactory (SubRenderStateFactory *factory)
 Add sub render state factory.
size_t getNumSubRenderStateFactories () const
 Returns the number of existing factories.
SubRenderStateFactorygetSubRenderStateFactory (size_t index)
 Returns a sub render state factory by index.
SubRenderStateFactorygetSubRenderStateFactory (const String &type)
 Returns a sub render state factory by name.
void removeSubRenderStateFactory (SubRenderStateFactory *factory)
 Remove sub render state factory.
SubRenderStatecreateSubRenderState (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 hasShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName) const
 Checks if a shader based technique has been created for a given technique.
bool hasShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName) const
bool createShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName, bool overProgrammable=false)
 Create shader based technique from a given technique.
bool createShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName, bool overProgrammable=false)
bool removeShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
 Remove shader based technique from a given technique.
bool removeShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
bool removeAllShaderBasedTechniques (const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Remove all shader based techniques of the given material.
bool cloneShaderBasedTechniques (const String &srcMaterialName, const String &srcGroupName, const String &dstMaterialName, const String &dstGroupName)
 Clone all shader based techniques from one material to another.
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, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Invalidate specific material scheme.
bool validateMaterial (const String &schemeName, const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Validate specific material scheme.
SGMaterialSerializerListenergetMaterialSerializerListener ()
 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 setCreateShaderOverProgrammablePass (bool value)
 Sets whether shaders are created for passes with shaders.
bool getCreateShaderOverProgrammablePass () const
 Returns whether shaders are created for passes with shaders.
size_t getRTShaderSchemeCount () const
 Returns the amount of schemes used in the for RT shader generation.
const StringgetRTShaderScheme (size_t index) const
 Returns the scheme name used in the for RT shader generation by index.
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 ShaderGeneratorgetSingleton ()
 Override standard Singleton retrieval.
static ShaderGeneratorgetSingletonPtr ()
 Override standard Singleton retrieval.

Static Public Attributes

static String DEFAULT_SCHEME_NAME
 Default material scheme of the shader generator.

Protected Types

typedef std::pair< String, StringMatGroupPair
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< MatGroupPair,
SGMaterial
*, MatGroupPair_less >::type 
SGMaterialMap
typedef SGMaterialMap::iterator SGMaterialIterator
typedef
SGMaterialMap::const_iterator 
SGMaterialConstIterator
typedef map< String, SGScheme * >
::type 
SGSchemeMap
typedef SGSchemeMap::iterator SGSchemeIterator
typedef SGSchemeMap::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
typedef std::pair< SGScheme
*, bool > 
SchemeCreateOrRetrieveResult

Protected Member Functions

 ShaderGenerator ()
 Class default constructor.
 ~ShaderGenerator ()
 Class destructor.
bool _initialize ()
 Initialize the shader generator instance.
void _finalize ()
 Finalize the shader generator instance.
TechniquefindSourceTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName)
 Find source technique to generate shader based technique based on it.
bool isProgrammable (Technique *tech) const
 Checks if a given technique has passes with shaders.
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.
SubRenderStatecreateSubRenderState (ScriptCompiler *compiler, PropertyAbstractNode *prop, Pass *pass, SGScriptTranslator *translator)
 Create an instance of the SubRenderState based on script properties using the current sub render state factories.
SubRenderStatecreateSubRenderState (ScriptCompiler *compiler, PropertyAbstractNode *prop, TextureUnitState *texState, SGScriptTranslator *translator)
 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.
ScriptTranslatorgetTranslator (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.
void serializeTextureUnitStateAttributes (MaterialSerializer *ser, SGPass *passEntry, const TextureUnitState *srcTextureUnit)
 This method called by instance of SGMaterialSerializerListener and serialize a given textureUnitState entry attributes.
SGMaterialIterator findMaterialEntryIt (const String &materialName, const String &groupName)
 Finds an entry iterator in the mMaterialEntriesMap map.
SGMaterialConstIterator findMaterialEntryIt (const String &materialName, const String &groupName) const
SchemeCreateOrRetrieveResult createOrRetrieveScheme (const String &schemeName)
 Returns a requested scheme.
bool getIsFinalizing () const
 Used to check if finalizing.

Protected Attributes

OGRE_AUTO_MUTEX SceneManagermActiveSceneMgr
SceneManagerMap mSceneManagerMap
SGRenderObjectListenermRenderObjectListener
SGSceneManagerListenermSceneManagerListener
SGScriptTranslatorManagermScriptTranslatorManager
SGMaterialSerializerListenermMaterialSerializerListener
SGScriptTranslatorMap mScriptTranslatorsMap
SGScriptTranslator mCoreScriptTranslator
String mShaderLanguage
String mVertexShaderProfiles
StringVector mVertexShaderProfilesList
String mFragmentShaderProfiles
StringVector mFragmentShaderProfilesList
String mShaderCachePath
ProgramManagermProgramManager
ProgramWriterManagermProgramWriterManager
FFPRenderStateBuildermFFPRenderStateBuilder
SGMaterialMap mMaterialEntriesMap
SGSchemeMap mSchemeEntriesMap
SGTechniqueMap mTechniqueEntriesMap
SubRenderStateFactoryMap mSubRenderStateFactories
SubRenderStateFactoryMap mSubRenderStateExFactories
bool mActiveViewportValid
int mLightCount [3]
VSOutputCompactPolicy mVSOutputCompactPolicy
bool mCreateShaderOverProgrammablePass
bool mIsFinalizing

Static Protected Attributes

static ShaderGeneratormsSingleton

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

Definition at line 435 of file OgreShaderGenerator.h.

Definition at line 198 of file OgreShaderGenerator.h.

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

Definition at line 808 of file OgreShaderGenerator.h.

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

Definition at line 807 of file OgreShaderGenerator.h.

Definition at line 806 of file OgreShaderGenerator.h.

Definition at line 906 of file OgreShaderGenerator.h.

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

Definition at line 461 of file OgreShaderGenerator.h.

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

Definition at line 460 of file OgreShaderGenerator.h.

Definition at line 459 of file OgreShaderGenerator.h.

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

Definition at line 450 of file OgreShaderGenerator.h.

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

Definition at line 449 of file OgreShaderGenerator.h.

Definition at line 448 of file OgreShaderGenerator.h.

typedef SGSchemeMap::const_iterator Ogre::RTShader::ShaderGenerator::SGSchemeConstIterator [protected]

Definition at line 465 of file OgreShaderGenerator.h.

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

Definition at line 464 of file OgreShaderGenerator.h.

Definition at line 463 of file OgreShaderGenerator.h.

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

Definition at line 469 of file OgreShaderGenerator.h.

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

Definition at line 468 of file OgreShaderGenerator.h.

Definition at line 467 of file OgreShaderGenerator.h.

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

Definition at line 454 of file OgreShaderGenerator.h.

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

Definition at line 453 of file OgreShaderGenerator.h.

Definition at line 452 of file OgreShaderGenerator.h.

Definition at line 456 of file OgreShaderGenerator.h.

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

Definition at line 457 of file OgreShaderGenerator.h.

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

Definition at line 803 of file OgreShaderGenerator.h.

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

Definition at line 802 of file OgreShaderGenerator.h.

Definition at line 801 of file OgreShaderGenerator.h.


Constructor & Destructor Documentation

Class default constructor.

Class destructor.


Member Function Documentation

Finalize the shader generator instance.

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:
keyThe key name of the given translator.
translatorThe translator to associate with the given key.

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

Parameters:
sceneMgrThe scene manager to add to the list.

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:
factoryThe factory to add.
bool Ogre::RTShader::ShaderGenerator::cloneShaderBasedTechniques ( const String srcMaterialName,
const String srcGroupName,
const String dstMaterialName,
const String dstGroupName 
)

Clone all shader based techniques from one material to another.

This function can be used in conjunction with the Material::clone() function to copy both material properties and RTSS state from one material to another.

Parameters:
srcMaterialNameThe source material name.
srcGroupNameThe source group name.
dstMaterialNameThe destination material name.
dstGroupNameThe destination group name.
Returns:
True if successful

Returns a requested render state.

If the render state does not exist this function creates it.

Parameters:
schemeNameThe scheme name to retrieve.

Returns a requested scheme.

If the scheme does not exist this function creates it.

Parameters:
schemeNameThe scheme name to retrieve.

Create a scheme.

Parameters:
schemeNameThe scheme name to create.
bool Ogre::RTShader::ShaderGenerator::createShaderBasedTechnique ( const String materialName,
const String srcTechniqueSchemeName,
const String dstTechniqueSchemeName,
bool  overProgrammable = false 
)

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:
materialNameThe source material name.
groupNameThe source group name.
srcTechniqueSchemeNameThe source technique scheme name.
dstTechniqueSchemeNameThe destination shader based technique scheme name.
overProgrammableIf true a shader will be created even if the material has shaders
bool Ogre::RTShader::ShaderGenerator::createShaderBasedTechnique ( const String materialName,
const String groupName,
const String srcTechniqueSchemeName,
const String dstTechniqueSchemeName,
bool  overProgrammable = false 
)

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

Parameters:
typeThe type of sub render state to create.

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

See also:
SubRenderStateFactory::createInstance
Parameters:
compilerThe compiler instance.
propThe abstract property node.
passThe pass that is the parent context of this node.
thetranslator for the specific SubRenderState

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

See also:
SubRenderStateFactory::createInstance
Parameters:
compilerThe compiler instance.
propThe abstract property node.
texStateThe texture unit state that is the parent context of this node.
thetranslator for the specific SubRenderState

Create sub render state core extensions factories.

Destroy an instance of sub render state.

Parameters:
subRenderStateThe instance to destroy.

Destroy sub render state core extensions factories.

Finalize the Shader Generator instance.

SGMaterialIterator Ogre::RTShader::ShaderGenerator::findMaterialEntryIt ( const String materialName,
const String groupName 
) [protected]

Finds an entry iterator in the mMaterialEntriesMap map.

This function is able to find materials with group specified as AUTODETECT_RESOURCE_GROUP_NAME

SGMaterialConstIterator Ogre::RTShader::ShaderGenerator::findMaterialEntryIt ( const String materialName,
const String groupName 
) const [protected]
Technique* Ogre::RTShader::ShaderGenerator::findSourceTechnique ( const String materialName,
const String groupName,
const String srcTechniqueSchemeName 
) [protected]

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

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.

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

This attribute will be update on the call to preFindVisibleObjects.

Returns whether shaders are created for passes with shaders.

See also:
setCreateShaderOverProgrammablePass().

Definition at line 416 of file OgreShaderGenerator.h.

Return the current number of generated fragment shaders.

Get the output fragment shader target profiles.

Definition at line 161 of file OgreShaderGenerator.h.

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

Definition at line 166 of file OgreShaderGenerator.h.

Used to check if finalizing.

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.

Returns the number of existing factories.

Return number of script translators.

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

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:
schemeNameThe 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:
schemeNameThe destination scheme name.
materialNameThe specific material name.
groupNameThe specific material name.
passIndexThe pass index.
RenderState* Ogre::RTShader::ShaderGenerator::getRenderState ( const String schemeName,
const String materialName,
const String groupName,
unsigned short  passIndex 
)

Returns the scheme name used in the for RT shader generation by index.

Returns the amount of schemes used in the for RT shader generation.

Get the output shader cache path.

Definition at line 179 of file OgreShaderGenerator.h.

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.

Reimplemented from Ogre::Singleton< ShaderGenerator >.

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.

Reimplemented from Ogre::Singleton< ShaderGenerator >.

Returns a sub render state factory by index.

Note:
index must be lower than the value returned by getNumSubRenderStateFactories()

Returns a sub render state factory by name.

Return the target shader language currently in use.

Definition at line 133 of file OgreShaderGenerator.h.

Return a matching script translator.

Return the current number of generated vertex shaders.

Get the vertex shader outputs compaction policy.

See also:
VSOutputCompactPolicy.

Definition at line 403 of file OgreShaderGenerator.h.

Get the output vertex shader target profiles.

Definition at line 144 of file OgreShaderGenerator.h.

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

Definition at line 149 of file OgreShaderGenerator.h.

bool Ogre::RTShader::ShaderGenerator::hasRenderState ( const String schemeName) const

Tells if a given render state exists.

Parameters:
schemeNameThe scheme name to check.
bool Ogre::RTShader::ShaderGenerator::hasShaderBasedTechnique ( const String materialName,
const String srcTechniqueSchemeName,
const String dstTechniqueSchemeName 
) const

Checks if a shader based technique has been created for a given technique.

Return true if exist. False if not.

Parameters:
materialNameThe source material name.
groupNameThe source group name.
srcTechniqueSchemeNameThe source technique scheme name.
dstTechniqueSchemeNameThe destination shader based technique scheme name.
bool Ogre::RTShader::ShaderGenerator::hasShaderBasedTechnique ( const String materialName,
const String groupName,
const String srcTechniqueSchemeName,
const String dstTechniqueSchemeName 
) const

Initialize the Shader Generator System.

Return true upon success.

Parameters:
sceneMgrThe scene manager that the shader generator will be bound to.
void Ogre::RTShader::ShaderGenerator::invalidateMaterial ( const String schemeName,
const String materialName,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Invalidate specific material scheme.

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

Parameters:
schemeNameThe scheme to invalidate.
materialNameThe material to invalidate.
groupNameThe source group name.

Invalidate a given scheme.

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

Parameters:
schemeNameThe scheme to invalidate.
bool Ogre::RTShader::ShaderGenerator::isProgrammable ( Technique tech) const [protected]

Checks if a given technique has passes with shaders.

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) [inherited]

Definition at line 95 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,
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) [inherited]

Definition at line 112 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 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) [inherited]

Definition at line 72 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.

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

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

Remove all shader based techniques of the given material.

Return true upon success.

Parameters:
materialNameThe source material name.
groupNameThe source group name.

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

Remove custom script translator.

Return true upon success.

Parameters:
keyThe key name of the translator to remove.

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

Parameters:
sceneMgrThe 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:
materialNameThe source material name.
groupNameThe source group name.
srcTechniqueSchemeNameThe source technique scheme name.
dstTechniqueSchemeNameThe destination shader based technique scheme name.
bool Ogre::RTShader::ShaderGenerator::removeShaderBasedTechnique ( const String materialName,
const String groupName,
const String srcTechniqueSchemeName,
const String dstTechniqueSchemeName 
)

Remove sub render state factory.

Parameters:
factoryThe factory to remove.

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

Parameters:
serThe material serializer.
passEntryThe SGPass instance.
void Ogre::RTShader::ShaderGenerator::serializeTextureUnitStateAttributes ( MaterialSerializer ser,
SGPass passEntry,
const TextureUnitState srcTextureUnit 
) [protected]

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

Parameters:
serThe material serializer.
passEntryThe SGPass instance.
srcTextureUnitThe TextureUnitState being serialized.

Sets whether shaders are created for passes with shaders.

Note that this only refers to when the system parses the materials itself. Not for when calling the createShaderBasedTechnique() function directly

Parameters:
valueThe value to set this attribute pass.

Definition at line 411 of file OgreShaderGenerator.h.

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

Set the output fragment shader target profiles.

Parameters:
fragmentShaderProfileThe target profiles for the fragment shader.

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:
cachePathThe cache path of the shader. The default is empty cache path.

Set the target shader language.

Parameters:
shaderLanguageThe output shader language to use.
Remarks:
The default shader language is cg.

Set the vertex shader outputs compaction policy.

See also:
VSOutputCompactPolicy.
Parameters:
policyThe policy to set.

Definition at line 398 of file OgreShaderGenerator.h.

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

Set the output vertex shader target profiles.

Parameters:
vertexShaderProfileThe target profiles for the vertex shader.
bool Ogre::RTShader::ShaderGenerator::validateMaterial ( const String schemeName,
const String materialName,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Validate specific material scheme.

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

Parameters:
schemeNameThe scheme to validate.
materialNameThe material to validate.
groupNameThe source group name.

Validate a given scheme.

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

Parameters:
schemeNameThe scheme to validate.

Friends And Related Function Documentation

friend class FFPRenderStateBuilder [friend]

Definition at line 973 of file OgreShaderGenerator.h.

friend class SGMaterialSerializerListener [friend]

Definition at line 976 of file OgreShaderGenerator.h.

friend class SGPass [friend]

Definition at line 972 of file OgreShaderGenerator.h.

friend class SGScriptTranslator [friend]

Definition at line 975 of file OgreShaderGenerator.h.

friend class SGScriptTranslatorManager [friend]

Definition at line 974 of file OgreShaderGenerator.h.


Member Data Documentation

Default material scheme of the shader generator.

Definition at line 428 of file OgreShaderGenerator.h.

Definition at line 918 of file OgreShaderGenerator.h.

Definition at line 962 of file OgreShaderGenerator.h.

Definition at line 932 of file OgreShaderGenerator.h.

Definition at line 968 of file OgreShaderGenerator.h.

Definition at line 950 of file OgreShaderGenerator.h.

Definition at line 940 of file OgreShaderGenerator.h.

Definition at line 942 of file OgreShaderGenerator.h.

Definition at line 970 of file OgreShaderGenerator.h.

Definition at line 964 of file OgreShaderGenerator.h.

Definition at line 952 of file OgreShaderGenerator.h.

Definition at line 928 of file OgreShaderGenerator.h.

Definition at line 946 of file OgreShaderGenerator.h.

Definition at line 948 of file OgreShaderGenerator.h.

Definition at line 922 of file OgreShaderGenerator.h.

Definition at line 924 of file OgreShaderGenerator.h.

Definition at line 920 of file OgreShaderGenerator.h.

Definition at line 954 of file OgreShaderGenerator.h.

Definition at line 926 of file OgreShaderGenerator.h.

Definition at line 930 of file OgreShaderGenerator.h.

Definition at line 944 of file OgreShaderGenerator.h.

Definition at line 934 of file OgreShaderGenerator.h.

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

Definition at line 75 of file OgreSingleton.h.

Definition at line 960 of file OgreShaderGenerator.h.

Definition at line 958 of file OgreShaderGenerator.h.

Definition at line 956 of file OgreShaderGenerator.h.

Definition at line 936 of file OgreShaderGenerator.h.

Definition at line 938 of file OgreShaderGenerator.h.

Definition at line 966 of file OgreShaderGenerator.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:28:05