OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::RTShader::ShaderGenerator Class Reference

Shader generator system main interface. More...

#include <OgreShaderGenerator.h>

+ Inheritance diagram for Ogre::RTShader::ShaderGenerator:

Public Types

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

Public Member Functions

void _setActiveSceneManager (SceneManager *sceneManager)
 Set the active scene manager against which new render states are compiled. More...
 
void addSceneManager (SceneManager *sceneMgr)
 Add a scene manager to the shader generator scene managers list. More...
 
void addSubRenderStateFactory (SubRenderStateFactory *factory)
 Add sub render state factory. More...
 
bool cloneShaderBasedTechniques (const String &srcMaterialName, const String &srcGroupName, const String &dstMaterialName, const String &dstGroupName)
 Clone all shader based techniques from one material to another. More...
 
RenderStateCreateOrRetrieveResult createOrRetrieveRenderState (const String &schemeName)
 Returns a requested render state. More...
 
void createScheme (const String &schemeName)
 Create a scheme. More...
 
bool createShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName, bool overProgrammable=false)
 Create shader based technique from a given technique. More...
 
bool createShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName, bool overProgrammable=false)
 Create shader based technique from a given technique. More...
 
SubRenderStatecreateSubRenderState (const String &type)
 Create an instance of sub render state from a given type. More...
 
void destroySubRenderState (SubRenderState *subRenderState)
 Destroy an instance of sub render state. More...
 
void flushShaderCache ()
 Flush the shader cache. More...
 
SceneManagergetActiveSceneManager ()
 Get the active scene manager that is doint the actual scene rendering. More...
 
bool getCreateShaderOverProgrammablePass () const
 Returns whether shaders are created for passes with shaders. More...
 
size_t getFragmentShaderCount () const
 Return the current number of generated fragment shaders. More...
 
const StringgetFragmentShaderProfiles () const
 Get the output fragment shader target profiles. More...
 
const StringVectorgetFragmentShaderProfilesList () const
 Get the output fragment shader target profiles as list of strings. More...
 
SGMaterialSerializerListenergetMaterialSerializerListener ()
 Return custom material Serializer of the shader generator. More...
 
size_t getNumSubRenderStateFactories () const
 Returns the number of existing factories. More...
 
RenderStategetRenderState (const String &schemeName)
 Return a global render state associated with the given scheme name. More...
 
RenderStategetRenderState (const String &schemeName, const String &materialName, const String &groupName, unsigned short passIndex)
 Get render state of specific pass. More...
 
RenderStategetRenderState (const String &schemeName, const String &materialName, unsigned short passIndex)
 Get render state of specific pass. More...
 
const StringgetRTShaderScheme (size_t index) const
 Returns the scheme name used in the for RT shader generation by index. More...
 
size_t getRTShaderSchemeCount () const
 Returns the amount of schemes used in the for RT shader generation. More...
 
const StringgetShaderCachePath () const
 Get the output shader cache path. More...
 
SubRenderStateFactorygetSubRenderStateFactory (const String &type)
 Returns a sub render state factory by name. More...
 
SubRenderStateFactorygetSubRenderStateFactory (size_t index)
 Returns a sub render state factory by index. More...
 
const StringgetTargetLanguage () const
 Return the target shader language currently in use. More...
 
float getTargetLanguageVersion () const
 Return the target shader language version currently in use. More...
 
size_t getVertexShaderCount () const
 Return the current number of generated vertex shaders. More...
 
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy () const
 Get the vertex shader outputs compaction policy. More...
 
const StringgetVertexShaderProfiles () const
 Get the output vertex shader target profiles. More...
 
const StringVectorgetVertexShaderProfilesList () const
 Get the output vertex shader target profiles as list of strings. More...
 
bool hasRenderState (const String &schemeName) const
 Tells if a given render state exists. More...
 
bool hasShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName) const
 Checks if a shader based technique has been created for a given technique. More...
 
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. More...
 
void invalidateMaterial (const String &schemeName, const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Invalidate specific material scheme. More...
 
void invalidateMaterialIlluminationPasses (const String &schemeName, const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Invalidate specific material scheme. More...
 
void invalidateScheme (const String &schemeName)
 Invalidate a given scheme. More...
 
bool IsHlsl4 () const
 Return if hlsl 4.0 shading language is currently in use. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void removeAllShaderBasedTechniques ()
 Remove all shader based techniques that created by this shader generator. More...
 
bool removeAllShaderBasedTechniques (const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Remove all shader based techniques of the given material. More...
 
void removeSceneManager (SceneManager *sceneMgr)
 Remove a scene manager from the shader generator scene managers list. More...
 
bool removeShaderBasedTechnique (const String &materialName, const String &groupName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
 Remove shader based technique from a given technique. More...
 
bool removeShaderBasedTechnique (const String &materialName, const String &srcTechniqueSchemeName, const String &dstTechniqueSchemeName)
 Remove shader based technique from a given technique. More...
 
void removeSubRenderStateFactory (SubRenderStateFactory *factory)
 Remove sub render state factory. More...
 
void setCreateShaderOverProgrammablePass (bool value)
 Sets whether shaders are created for passes with shaders. More...
 
void setFragmentShaderProfiles (const String &fragmentShaderProfiles)
 Set the output fragment shader target profiles. More...
 
void setShaderCachePath (const String &cachePath)
 Set the output shader cache path. More...
 
void setTargetLanguage (const String &shaderLanguage, const float version=1.0)
 Set the target shader language. More...
 
void setVertexShaderOutputsCompactPolicy (VSOutputCompactPolicy policy)
 Set the vertex shader outputs compaction policy. More...
 
void setVertexShaderProfiles (const String &vertexShaderProfiles)
 Set the output vertex shader target profiles. More...
 
bool validateMaterial (const String &schemeName, const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Validate specific material scheme. More...
 
bool validateMaterialIlluminationPasses (const String &schemeName, const String &materialName, const String &groupName=ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME)
 Validate specific material scheme. More...
 
bool validateScheme (const String &schemeName)
 Validate a given scheme. More...
 

Static Public Member Functions

static void destroy ()
 Destroy the Shader Generator instance. More...
 
static ShaderGeneratorgetSingleton ()
 Override standard Singleton retrieval. More...
 
static ShaderGeneratorgetSingletonPtr ()
 Override standard Singleton retrieval. More...
 
static bool initialize ()
 Initialize the Shader Generator System. More...
 

Static Public Attributes

static String DEFAULT_SCHEME_NAME
 Default material scheme of the shader generator. More...
 

Friends

class FFPRenderStateBuilder
 
class SGMaterialSerializerListener
 
class SGPass
 
class SGScriptTranslator
 
class SGScriptTranslatorManager
 

Detailed Description

Shader generator system main interface.

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

Member Typedef Documentation

◆ RenderStateCreateOrRetrieveResult

Member Function Documentation

◆ _setActiveSceneManager()

void Ogre::RTShader::ShaderGenerator::_setActiveSceneManager ( SceneManager sceneManager)

Set the active scene manager against which new render states are compiled.

Note that normally the setting of the active scene manager is updated through the preFindVisibleObjects method.

◆ addSceneManager()

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

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

Parameters
sceneMgrThe scene manager to add to the list.

◆ addSubRenderStateFactory()

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
factoryThe factory to add.

◆ cloneShaderBasedTechniques()

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

◆ createOrRetrieveRenderState()

RenderStateCreateOrRetrieveResult Ogre::RTShader::ShaderGenerator::createOrRetrieveRenderState ( const String schemeName)

Returns a requested render state.

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

Parameters
schemeNameThe scheme name to retrieve.

◆ createScheme()

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

Create a scheme.

Parameters
schemeNameThe scheme name to create.

◆ createShaderBasedTechnique() [1/2]

bool Ogre::RTShader::ShaderGenerator::createShaderBasedTechnique ( const String materialName,
const String groupName,
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

◆ createShaderBasedTechnique() [2/2]

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.
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

◆ createSubRenderState()

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

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

Parameters
typeThe type of sub render state to create.

◆ destroy()

static void Ogre::RTShader::ShaderGenerator::destroy ( )
static

Destroy the Shader Generator instance.

◆ destroySubRenderState()

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

Destroy an instance of sub render state.

Parameters
subRenderStateThe instance to destroy.

◆ flushShaderCache()

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.

◆ getActiveSceneManager()

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.

◆ getCreateShaderOverProgrammablePass()

bool Ogre::RTShader::ShaderGenerator::getCreateShaderOverProgrammablePass ( ) const
inline

Returns whether shaders are created for passes with shaders.

See also
setCreateShaderOverProgrammablePass().

◆ getFragmentShaderCount()

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

Return the current number of generated fragment shaders.

◆ getFragmentShaderProfiles()

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

Get the output fragment shader target profiles.

◆ getFragmentShaderProfilesList()

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

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

◆ getMaterialSerializerListener()

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.

◆ getNumSubRenderStateFactories()

size_t Ogre::RTShader::ShaderGenerator::getNumSubRenderStateFactories ( ) const

Returns the number of existing factories.

◆ getRenderState() [1/3]

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
schemeNameThe destination scheme name.

◆ getRenderState() [2/3]

RenderState* Ogre::RTShader::ShaderGenerator::getRenderState ( const String schemeName,
const String materialName,
const String groupName,
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.

◆ getRenderState() [3/3]

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.
passIndexThe pass index.

◆ getRTShaderScheme()

const String& Ogre::RTShader::ShaderGenerator::getRTShaderScheme ( size_t  index) const

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

◆ getRTShaderSchemeCount()

size_t Ogre::RTShader::ShaderGenerator::getRTShaderSchemeCount ( ) const

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

◆ getShaderCachePath()

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

Get the output shader cache path.

◆ getSingleton()

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.

◆ getSingletonPtr()

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.

◆ getSubRenderStateFactory() [1/2]

SubRenderStateFactory* Ogre::RTShader::ShaderGenerator::getSubRenderStateFactory ( const String type)

Returns a sub render state factory by name.

◆ getSubRenderStateFactory() [2/2]

SubRenderStateFactory* Ogre::RTShader::ShaderGenerator::getSubRenderStateFactory ( size_t  index)

Returns a sub render state factory by index.

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

◆ getTargetLanguage()

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

Return the target shader language currently in use.


◆ getTargetLanguageVersion()

float Ogre::RTShader::ShaderGenerator::getTargetLanguageVersion ( ) const
inline

Return the target shader language version currently in use.


◆ getVertexShaderCount()

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

Return the current number of generated vertex shaders.

◆ getVertexShaderOutputsCompactPolicy()

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

Get the vertex shader outputs compaction policy.

See also
VSOutputCompactPolicy.

◆ getVertexShaderProfiles()

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

Get the output vertex shader target profiles.


◆ getVertexShaderProfilesList()

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

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


◆ hasRenderState()

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

Tells if a given render state exists.

Parameters
schemeNameThe scheme name to check.

◆ hasShaderBasedTechnique() [1/2]

bool Ogre::RTShader::ShaderGenerator::hasShaderBasedTechnique ( const String materialName,
const String groupName,
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.

◆ hasShaderBasedTechnique() [2/2]

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.
srcTechniqueSchemeNameThe source technique scheme name.
dstTechniqueSchemeNameThe destination shader based technique scheme name.

◆ initialize()

static bool Ogre::RTShader::ShaderGenerator::initialize ( )
static

Initialize the Shader Generator System.

Return true upon success.

◆ invalidateMaterial()

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.

◆ invalidateMaterialIlluminationPasses()

void Ogre::RTShader::ShaderGenerator::invalidateMaterialIlluminationPasses ( 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.

◆ invalidateScheme()

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
schemeNameThe scheme to invalidate.

◆ IsHlsl4()

bool Ogre::RTShader::ShaderGenerator::IsHlsl4 ( ) const
inline

Return if hlsl 4.0 shading language is currently in use.


◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ removeAllShaderBasedTechniques() [1/2]

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

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


◆ removeAllShaderBasedTechniques() [2/2]

bool Ogre::RTShader::ShaderGenerator::removeAllShaderBasedTechniques ( const String materialName,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Remove all shader based techniques of the given material.

Return true upon success.

Parameters
materialNameThe source material name.
groupNameThe source group name.

◆ removeSceneManager()

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

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

Parameters
sceneMgrThe scene manager to remove from the list.

◆ removeShaderBasedTechnique() [1/2]

bool Ogre::RTShader::ShaderGenerator::removeShaderBasedTechnique ( const String materialName,
const String groupName,
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.

◆ removeShaderBasedTechnique() [2/2]

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.
srcTechniqueSchemeNameThe source technique scheme name.
dstTechniqueSchemeNameThe destination shader based technique scheme name.

◆ removeSubRenderStateFactory()

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

Remove sub render state factory.

Parameters
factoryThe factory to remove.

◆ setCreateShaderOverProgrammablePass()

void Ogre::RTShader::ShaderGenerator::setCreateShaderOverProgrammablePass ( bool  value)
inline

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.

◆ setFragmentShaderProfiles()

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

Set the output fragment shader target profiles.

Parameters
fragmentShaderProfilesThe target profiles for the fragment shader.

◆ setShaderCachePath()

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

◆ setTargetLanguage()

void Ogre::RTShader::ShaderGenerator::setTargetLanguage ( const String shaderLanguage,
const float  version = 1.0 
)

Set the target shader language.

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

◆ setVertexShaderOutputsCompactPolicy()

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

Set the vertex shader outputs compaction policy.

See also
VSOutputCompactPolicy.
Parameters
policyThe policy to set.

◆ setVertexShaderProfiles()

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

Set the output vertex shader target profiles.

Parameters
vertexShaderProfilesThe target profiles for the vertex shader.

◆ validateMaterial()

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.

◆ validateMaterialIlluminationPasses()

bool Ogre::RTShader::ShaderGenerator::validateMaterialIlluminationPasses ( const String schemeName,
const String materialName,
const String groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME 
)

Validate specific material scheme.

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

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

◆ validateScheme()

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
schemeNameThe scheme to validate.

Friends And Related Function Documentation

◆ FFPRenderStateBuilder

friend class FFPRenderStateBuilder
friend

◆ SGMaterialSerializerListener

friend class SGMaterialSerializerListener
friend

◆ SGPass

friend class SGPass
friend

◆ SGScriptTranslator

friend class SGScriptTranslator
friend

◆ SGScriptTranslatorManager

friend class SGScriptTranslatorManager
friend

Member Data Documentation

◆ DEFAULT_SCHEME_NAME

String Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME
static

Default material scheme of the shader generator.


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