OgreShaderGenerator.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef _ShaderGenerator_
#define _ShaderGenerator_
#include "OgreShaderPrerequisites.h"
#include "OgreSingleton.h"
#include "OgreFileSystemLayer.h"
#include "OgreRenderObjectListener.h"
#include "OgreSceneManager.h"
#include "OgreShaderRenderState.h"
#include "OgreScriptTranslator.h"
#include "OgreShaderScriptTranslator.h"
namespace Ogre {
namespace RTShader {
class _OgreRTSSExport ShaderGenerator : public Singleton<ShaderGenerator>, public RTShaderSystemAlloc
{
// Interface.
public:
static bool initialize();
static void destroy();
static ShaderGenerator& getSingleton();
static ShaderGenerator* getSingletonPtr();
void addSceneManager(SceneManager* sceneMgr);
void removeSceneManager(SceneManager* sceneMgr);
SceneManager* getActiveSceneManager();
void setTargetLanguage(const String& shaderLanguage);
const String& getTargetLanguage() const { return mShaderLanguage; }
void setVertexShaderProfiles(const String& vertexShaderProfiles);
const String& getVertexShaderProfiles() const { return mVertexShaderProfiles; }
const StringVector& getVertexShaderProfilesList() const { return mVertexShaderProfilesList; }
void setFragmentShaderProfiles(const String& fragmentShaderProfiles);
const String& getFragmentShaderProfiles() const { return mFragmentShaderProfiles; }
const StringVector& getFragmentShaderProfilesList() const { return mFragmentShaderProfilesList; }
void setShaderCachePath(const String& cachePath);
const String& getShaderCachePath() const { return mShaderCachePath; }
void flushShaderCache();
RenderState* getRenderState(const String& schemeName);
typedef std::pair<RenderState*, bool> RenderStateCreateOrRetrieveResult;
RenderStateCreateOrRetrieveResult createOrRetrieveRenderState(const String& schemeName);
bool hasRenderState(const String& schemeName) const;
RenderState* getRenderState(const String& schemeName, const String& materialName, unsigned short passIndex);
RenderState* getRenderState(const String& schemeName, const String& materialName, const String& groupName, unsigned short passIndex);
void addSubRenderStateFactory(SubRenderStateFactory* factory);
size_t getNumSubRenderStateFactories() const;
SubRenderStateFactory* getSubRenderStateFactory(size_t index);
SubRenderStateFactory* getSubRenderStateFactory(const String& type);
void removeSubRenderStateFactory(SubRenderStateFactory* factory);
SubRenderState* createSubRenderState(const String& type);
void destroySubRenderState(SubRenderState* subRenderState);
bool hasShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
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);
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);
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);
bool cloneShaderBasedTechniques(const String& srcMaterialName,
const String& srcGroupName, const String& dstMaterialName, const String& dstGroupName);
void removeAllShaderBasedTechniques();
void createScheme(const String& schemeName);
void invalidateScheme(const String& schemeName);
bool validateScheme(const String& schemeName);
void invalidateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
bool validateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
SGMaterialSerializerListener* getMaterialSerializerListener();
size_t getVertexShaderCount() const;
size_t getFragmentShaderCount() const;
void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy) { mVSOutputCompactPolicy = policy; }
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const { return mVSOutputCompactPolicy; }
void setCreateShaderOverProgrammablePass(bool value) { mCreateShaderOverProgrammablePass = value; }
bool getCreateShaderOverProgrammablePass() const { return mCreateShaderOverProgrammablePass; }
size_t getRTShaderSchemeCount() const;
const String& getRTShaderScheme(size_t index) const;
static String DEFAULT_SCHEME_NAME;
// Protected types.
protected:
class SGPass;
class SGTechnique;
class SGMaterial;
class SGScheme;
typedef std::pair<String,String> MatGroupPair;
struct MatGroupPair_less
{
// ensure we arrange the list first by material name then by group name
bool operator()(const MatGroupPair& p1, const MatGroupPair& p2) const
{
int cmpVal = strcmp(p1.first.c_str(),p2.first.c_str());
return (cmpVal < 0) || ((cmpVal == 0) && (strcmp(p1.second.c_str(),p2.second.c_str()) < 0));
}
};
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;
class _OgreRTSSExport SGPass : public RTShaderSystemAlloc
{
public:
SGPass(SGTechnique* parent, Pass* srcPass, Pass* dstPass);
~SGPass();
void buildTargetRenderState();
void acquirePrograms();
void releasePrograms();
void notifyRenderSingleObject(Renderable* rend, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
Pass* getSrcPass() { return mSrcPass; }
Pass* getDstPass() { return mDstPass; }
SubRenderState* getCustomFFPSubState(int subStateOrder);
RenderState* getCustomRenderState() { return mCustomRenderState; }
void setCustomRenderState(RenderState* customRenderState) { mCustomRenderState = customRenderState; }
// Key name for associating with a Pass instance.
static String UserKey;
protected:
SubRenderState* getCustomFFPSubState(int subStateOrder, const RenderState* renderState);
protected:
// Parent technique.
SGTechnique* mParent;
// Source pass.
Pass* mSrcPass;
// Destination pass.
Pass* mDstPass;
// Custom render state.
RenderState* mCustomRenderState;
// The compiled render state.
TargetRenderState* mTargetRenderState;
};
class _OgreRTSSExport SGTechnique : public RTShaderSystemAlloc
{
public:
SGTechnique(SGMaterial* parent, Technique* srcTechnique, const String& dstTechniqueSchemeName);
~SGTechnique();
const SGMaterial* getParent() const { return mParent; }
Technique* getSourceTechnique() { return mSrcTechnique; }
Technique* getDestinationTechnique() { return mDstTechnique; }
const String& getDestinationTechniqueSchemeName() const { return mDstTechniqueSchemeName; }
void buildTargetRenderState();
void acquirePrograms();
void releasePrograms();
void setBuildDestinationTechnique(bool buildTechnique) { mBuildDstTechnique = buildTechnique; }
bool getBuildDestinationTechnique() const { return mBuildDstTechnique; }
RenderState* getRenderState(unsigned short passIndex);
bool hasRenderState(unsigned short passIndex);
// Key name for associating with a Technique instance.
static String UserKey;
protected:
void createSGPasses();
void destroySGPasses();
protected:
// Parent material.
SGMaterial* mParent;
// Source technique.
Technique* mSrcTechnique;
// Destination technique.
Technique* mDstTechnique;
// All passes entries.
SGPassList mPassEntries;
// The custom render states of all passes.
RenderStateList mCustomRenderStates;
// Flag that tells if destination technique should be build.
bool mBuildDstTechnique;
// Scheme name of destination technique.
String mDstTechniqueSchemeName;
};
class _OgreRTSSExport SGMaterial : public RTShaderSystemAlloc
{
public:
SGMaterial(const String& materialName, const String& groupName) : mName(materialName), mGroup(groupName)
{
}
const String& getMaterialName() const { return mName; }
const String& getGroupName() const { return mGroup; }
const SGTechniqueList& getTechniqueList() const { return mTechniqueEntries; }
SGTechniqueList& getTechniqueList() { return mTechniqueEntries; }
protected:
// The material name.
String mName;
// The group name.
String mGroup;
// All passes entries.
SGTechniqueList mTechniqueEntries;
};
class _OgreRTSSExport SGScheme : public RTShaderSystemAlloc
{
public:
SGScheme(const String& schemeName);
~SGScheme();
bool empty() const { return mTechniqueEntries.empty(); }
void invalidate();
void validate();
void invalidate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
bool validate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
void addTechniqueEntry(SGTechnique* techEntry);
void removeTechniqueEntry(SGTechnique* techEntry);
RenderState* getRenderState();
RenderState* getRenderState(const String& materialName, const String& groupName, unsigned short passIndex);
protected:
void synchronizeWithLightSettings();
void synchronizeWithFogSettings();
protected:
// Scheme name.
String mName;
// Technique entries.
SGTechniqueList mTechniqueEntries;
// Tells if this scheme is out of date.
bool mOutOfDate;
// The global render state of this scheme.
RenderState* mRenderState;
// Current fog mode.
FogMode mFogMode;
};
// Protected types.
protected:
class _OgreRTSSExport SGRenderObjectListener : public RenderObjectListener, public RTShaderSystemAlloc
{
public:
SGRenderObjectListener(ShaderGenerator* owner)
{
mOwner = owner;
}
virtual void notifyRenderSingleObject(Renderable* rend, const Pass* pass,
const AutoParamDataSource* source,
const LightList* pLightList, bool suppressRenderStateChanges)
{
mOwner->notifyRenderSingleObject(rend, pass, source, pLightList, suppressRenderStateChanges);
}
protected:
ShaderGenerator* mOwner;
};
class _OgreRTSSExport SGSceneManagerListener : public SceneManager::Listener, public RTShaderSystemAlloc
{
public:
SGSceneManagerListener(ShaderGenerator* owner)
{
mOwner = owner;
}
virtual void preFindVisibleObjects(SceneManager* source,
SceneManager::IlluminationRenderStage irs, Viewport* v)
{
mOwner->preFindVisibleObjects(source, irs, v);
}
virtual void postFindVisibleObjects(SceneManager* source,
SceneManager::IlluminationRenderStage irs, Viewport* v)
{
}
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
{
}
virtual void shadowTextureCasterPreViewProj(Light* light,
Camera* camera, size_t iteration)
{
}
virtual void shadowTextureReceiverPreViewProj(Light* light,
Frustum* frustum)
{
}
protected:
// The shader generator instance.
ShaderGenerator* mOwner;
};
class _OgreRTSSExport SGScriptTranslatorManager : public ScriptTranslatorManager
{
public:
SGScriptTranslatorManager(ShaderGenerator* owner)
{
mOwner = owner;
}
virtual size_t getNumTranslators() const
{
return mOwner->getNumTranslators();
}
virtual ScriptTranslator *getTranslator(const AbstractNodePtr& node)
{
return mOwner->getTranslator(node);
}
protected:
// The shader generator instance.
ShaderGenerator* mOwner;
};
//-----------------------------------------------------------------------------
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:
ShaderGenerator();
~ShaderGenerator();
bool _initialize();
void _destroy();
Technique* findSourceTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, bool allowProgrammable);
bool isProgrammable(Technique* tech) const;
void notifyRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v);
void createSubRenderStateExFactories();
void destroySubRenderStateExFactories();
SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
bool addCustomScriptTranslator(const String& key, ScriptTranslator* translator);
bool removeCustomScriptTranslator(const String& key);
size_t getNumTranslators() const;
ScriptTranslator* getTranslator(const AbstractNodePtr& node);
void serializePassAttributes(MaterialSerializer* ser, SGPass* passEntry);
void serializeTextureUnitStateAttributes(MaterialSerializer* ser, SGPass* passEntry, const TextureUnitState* srcTextureUnit);
SGMaterialIterator findMaterialEntryIt(const String& materialName, const String& groupName);
SGMaterialConstIterator findMaterialEntryIt(const String& materialName, const String& groupName) const;
typedef std::pair<SGScheme*, bool> SchemeCreateOrRetrieveResult;
SchemeCreateOrRetrieveResult createOrRetrieveScheme(const String& schemeName);
bool getIsFinalizing() const;
protected:
// Auto mutex.
OGRE_AUTO_MUTEX;
// The active scene manager.
SceneManager* mActiveSceneMgr;
// A map of all scene managers this generator is bound to.
SceneManagerMap mSceneManagerMap;
// Render object listener.
SGRenderObjectListener* mRenderObjectListener;
// Scene manager listener.
SGSceneManagerListener* mSceneManagerListener;
// Script translator manager.
SGScriptTranslatorManager* mScriptTranslatorManager;
// Custom material Serializer listener - allows exporting material that contains shader generated techniques.
SGMaterialSerializerListener* mMaterialSerializerListener;
// A map of the registered custom script translators.
SGScriptTranslatorMap mScriptTranslatorsMap;
// The core translator of the RT Shader System.
SGScriptTranslator mCoreScriptTranslator;
// The target shader language (currently only cg supported).
String mShaderLanguage;
// The target vertex shader profile. Will be used as argument for program compilation.
String mVertexShaderProfiles;
// List of target vertex shader profiles.
StringVector mVertexShaderProfilesList;
// The target fragment shader profile. Will be used as argument for program compilation.
String mFragmentShaderProfiles;
// List of target fragment shader profiles..
StringVector mFragmentShaderProfilesList;
// Path for caching the generated shaders.
String mShaderCachePath;
// Shader program manager.
ProgramManager* mProgramManager;
// Shader program writer manager.
ProgramWriterManager* mProgramWriterManager;
// File system layer manager.
FileSystemLayer* mFSLayer;
// Fixed Function Render state builder.
FFPRenderStateBuilder* mFFPRenderStateBuilder;
// Material entries map.
SGMaterialMap mMaterialEntriesMap;
// Scheme entries map.
SGSchemeMap mSchemeEntriesMap;
// All technique entries map.
SGTechniqueMap mTechniqueEntriesMap;
// Sub render state registered factories.
SubRenderStateFactoryMap mSubRenderStateFactories;
// Sub render state core extension factories.
SubRenderStateFactoryMap mSubRenderStateExFactories;
// True if active view port use a valid SGScheme.
bool mActiveViewportValid;
// Light count per light type.
int mLightCount[3];
// Vertex shader outputs compact policy.
VSOutputCompactPolicy mVSOutputCompactPolicy;
// Tells whether shaders are created for passes with shaders
bool mCreateShaderOverProgrammablePass;
// a flag to indicate finalizing
bool mIsFinalizing;
private:
friend class SGPass;
friend class FFPRenderStateBuilder;
friend class SGScriptTranslatorManager;
friend class SGScriptTranslator;
friend class SGMaterialSerializerListener;
};
}
}
#endif
Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryMap
map< String, SubRenderStateFactory * >::type SubRenderStateFactoryMap
Definition: OgreShaderGenerator.h:836
Ogre::RTShader::ShaderGenerator::getVertexShaderProfilesList
const StringVector & getVertexShaderProfilesList() const
Get the output vertex shader target profiles as list of strings.
Definition: OgreShaderGenerator.h:149
Ogre::RTShader::ShaderGenerator::MatGroupPair
std::pair< String, String > MatGroupPair
Definition: OgreShaderGenerator.h:470
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorIterator
SGScriptTranslatorMap::iterator SGScriptTranslatorIterator
Definition: OgreShaderGenerator.h:503
Ogre::RTShader::ShaderGenerator::mSceneManagerListener
SGSceneManagerListener * mSceneManagerListener
Definition: OgreShaderGenerator.h:960
Ogre::RTShader::ShaderGenerator::mMaterialSerializerListener
SGMaterialSerializerListener * mMaterialSerializerListener
Definition: OgreShaderGenerator.h:964
Ogre::RTShader::ShaderGenerator::SGMaterial::getTechniqueList
SGTechniqueList & getTechniqueList()
Get the techniques list of this material.
Definition: OgreShaderGenerator.h:654
OgreShaderRenderState.h
Ogre::RTShader::ShaderGenerator::SGScheme::mFogMode
FogMode mFogMode
Definition: OgreShaderGenerator.h:733
Ogre::FogMode
FogMode
Fog modes.
Definition: OgreCommon.h:121
Ogre::Renderable
Abstract class defining the interface all renderable objects must implement.
Definition: OgreRenderable.h:63
Ogre::RTShader::ShaderGenerator::SGScheme
Shader generator scheme class.
Definition: OgreShaderGenerator.h:667
Ogre::MaterialSerializer
Class for serializing Materials to / from a .material script.
Definition: OgreMaterialSerializer.h:106
Ogre::Pass
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
Ogre::RTShader::ShaderGenerator::SGTechnique::mDstTechnique
Technique * mDstTechnique
Definition: OgreShaderGenerator.h:621
Ogre::ScriptTranslatorManager
The ScriptTranslatorManager manages the lifetime and access to script translators.
Definition: OgreScriptTranslator.h:101
Ogre::RTShader::ShaderGenerator::mFSLayer
FileSystemLayer * mFSLayer
Definition: OgreShaderGenerator.h:986
Ogre::RTShader::ShaderGenerator::SGTechnique::mParent
SGMaterial * mParent
Definition: OgreShaderGenerator.h:617
Ogre::RTShader::TargetRenderState
This is the target render state.
Definition: OgreShaderRenderState.h:138
Ogre::RTShader::ShaderGenerator::SGPassConstIterator
SGPassList::const_iterator SGPassConstIterator
Definition: OgreShaderGenerator.h:485
Ogre::RTShader::ShaderGenerator::SGScheme::mTechniqueEntries
SGTechniqueList mTechniqueEntries
Definition: OgreShaderGenerator.h:727
Ogre::RTShader::SubRenderState
This class is the base interface of sub part from a shader based rendering pipeline.
Definition: OgreShaderSubRenderState.h:56
Ogre::RTShader::ShaderGenerator::SGMaterialMap
map< MatGroupPair, SGMaterial *, MatGroupPair_less >::type SGMaterialMap
Definition: OgreShaderGenerator.h:494
Ogre::RTShader::ShaderGenerator::mSchemeEntriesMap
SGSchemeMap mSchemeEntriesMap
Definition: OgreShaderGenerator.h:992
Ogre::RTShader::ShaderGenerator::SGMaterial::getMaterialName
const String & getMaterialName() const
Get the material name.
Definition: OgreShaderGenerator.h:645
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager
Shader generator ScriptTranslatorManager sub class.
Definition: OgreShaderGenerator.h:810
Ogre::RTShader::ShaderGenerator::SGPass::mTargetRenderState
TargetRenderState * mTargetRenderState
Definition: OgreShaderGenerator.h:559
Ogre::RTShader::ShaderGenerator::MatGroupPair_less::operator()
bool operator()(const MatGroupPair &p1, const MatGroupPair &p2) const
Definition: OgreShaderGenerator.h:476
Ogre::RTShader::ShaderGenerator::SGMaterial::mGroup
String mGroup
Definition: OgreShaderGenerator.h:660
Ogre::RTShader::ShaderGenerator::SGScheme::mRenderState
RenderState * mRenderState
Definition: OgreShaderGenerator.h:731
Ogre::RTShader::ShaderGenerator::SGPassIterator
SGPassList::iterator SGPassIterator
Definition: OgreShaderGenerator.h:484
Ogre::RTShader::ShaderGenerator::SGTechnique::setBuildDestinationTechnique
void setBuildDestinationTechnique(bool buildTechnique)
Tells the technique that it needs to generate shader code.
Definition: OgreShaderGenerator.h:592
Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryConstIterator
SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator
Definition: OgreShaderGenerator.h:838
Ogre::RTShader::ShaderGenerator::RenderStateCreateOrRetrieveResult
std::pair< RenderState *, bool > RenderStateCreateOrRetrieveResult
Definition: OgreShaderGenerator.h:198
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorConstIterator
SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator
Definition: OgreShaderGenerator.h:504
Ogre::RTShader::ShaderGenerator::mShaderCachePath
String mShaderCachePath
Definition: OgreShaderGenerator.h:980
Ogre::RTShader::ShaderGenerator::SGMaterial::SGMaterial
SGMaterial(const String &materialName, const String &groupName)
Class constructor.
Definition: OgreShaderGenerator.h:639
Ogre::RTShader::ShaderGenerator::SGRenderObjectListener::notifyRenderSingleObject
virtual void notifyRenderSingleObject(Renderable *rend, const Pass *pass, const AutoParamDataSource *source, const LightList *pLightList, bool suppressRenderStateChanges)
Listener overridden function notify the shader generator when rendering single object.
Definition: OgreShaderGenerator.h:752
Ogre::RTShader::ShaderGenerator::mCreateShaderOverProgrammablePass
bool mCreateShaderOverProgrammablePass
Definition: OgreShaderGenerator.h:1006
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
Definition: OgreResourceGroupManager.h:270
Ogre::RTShader::ShaderGenerator::mFragmentShaderProfiles
String mFragmentShaderProfiles
Definition: OgreShaderGenerator.h:976
Ogre::RTShader::ShaderGenerator::SGRenderObjectListener::mOwner
ShaderGenerator * mOwner
Definition: OgreShaderGenerator.h:760
Ogre::RTShader::ShaderGenerator::mActiveSceneMgr
SceneManager * mActiveSceneMgr
Definition: OgreShaderGenerator.h:954
Ogre::RTShader::ShaderGenerator::SGTechnique::mBuildDstTechnique
bool mBuildDstTechnique
Definition: OgreShaderGenerator.h:627
Ogre::StringVector
vector< String >::type StringVector
Definition: OgreStringVector.h:45
Ogre::RTShader::ShaderGenerator
Shader generator system main interface.
Definition: OgreShaderGenerator.h:53
Ogre::FileSystemLayer
Provides methods to find out where the Ogre config files are stored and where logs and settings files...
Definition: OgreFileSystemLayer.h:49
Ogre::ScriptTranslator
This class translates script AST (abstract syntax tree) into Ogre resources.
Definition: OgreScriptTranslator.h:48
Ogre::RTShader::ShaderGenerator::mIsFinalizing
bool mIsFinalizing
Definition: OgreShaderGenerator.h:1008
Ogre::RTShader::ShaderGenerator::mProgramManager
ProgramManager * mProgramManager
Definition: OgreShaderGenerator.h:982
Ogre::RTShader::ShaderGenerator::SGPass::mSrcPass
Pass * mSrcPass
Definition: OgreShaderGenerator.h:553
Ogre::SceneManager::IlluminationRenderStage
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
Definition: OgreSceneManager.h:173
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorMap
map< String, ScriptTranslator * >::type SGScriptTranslatorMap
Definition: OgreShaderGenerator.h:502
Ogre::Viewport
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager::mOwner
ShaderGenerator * mOwner
Definition: OgreShaderGenerator.h:832
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::shadowTextureReceiverPreViewProj
virtual void shadowTextureReceiverPreViewProj(Light *light, Frustum *frustum)
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiv...
Definition: OgreShaderGenerator.h:798
Ogre::RTShader::ShaderGenerator::SGPass::mDstPass
Pass * mDstPass
Definition: OgreShaderGenerator.h:555
OgreShaderPrerequisites.h
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::SGSceneManagerListener
SGSceneManagerListener(ShaderGenerator *owner)
Definition: OgreShaderGenerator.h:767
Ogre::RTShader::ShaderGenerator::mCoreScriptTranslator
SGScriptTranslator mCoreScriptTranslator
Definition: OgreShaderGenerator.h:968
Ogre::SceneManager::Listener
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
Definition: OgreSceneManager.h:222
Ogre::RTShader::ShaderGenerator::SGTechnique::getSourceTechnique
Technique * getSourceTechnique()
Get the source technique.
Definition: OgreShaderGenerator.h:574
Ogre::RTShader::ShaderGenerator::SGMaterial::getTechniqueList
const SGTechniqueList & getTechniqueList() const
Get the const techniques list of this material.
Definition: OgreShaderGenerator.h:651
Ogre::RTShader::ShaderGenerator::SGSchemeConstIterator
SGSchemeMap::const_iterator SGSchemeConstIterator
Definition: OgreShaderGenerator.h:500
Ogre::RTShader::ShaderGenerator::mSubRenderStateFactories
SubRenderStateFactoryMap mSubRenderStateFactories
Definition: OgreShaderGenerator.h:996
Ogre::RTShader::ShaderGenerator::getFragmentShaderProfilesList
const StringVector & getFragmentShaderProfilesList() const
Get the output fragment shader target profiles as list of strings.
Definition: OgreShaderGenerator.h:166
Ogre::RTShader::ShaderGenerator::SGSchemeIterator
SGSchemeMap::iterator SGSchemeIterator
Definition: OgreShaderGenerator.h:499
OgreSingleton.h
Ogre::RTShader::ShaderGenerator::getShaderCachePath
const String & getShaderCachePath() const
Get the output shader cache path.
Definition: OgreShaderGenerator.h:179
Ogre::RTShader::ShaderGenerator::SGPass::getDstPass
Pass * getDstPass()
Get destination pass.
Definition: OgreShaderGenerator.h:532
Ogre::RTShader::ShaderGenerator::SGTechnique::mPassEntries
SGPassList mPassEntries
Definition: OgreShaderGenerator.h:623
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::shadowTextureCasterPreViewProj
virtual void shadowTextureCasterPreViewProj(Light *light, Camera *camera, size_t iteration)
This event occurs just before the view & projection matrices are set for rendering into a shadow text...
Definition: OgreShaderGenerator.h:792
Ogre::TextureUnitState
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
Definition: OgreTextureUnitState.h:62
Ogre::RTShader::ProgramWriterManager
Definition: OgreShaderProgramWriterManager.h:59
Ogre::RTShader::ShaderGenerator::mProgramWriterManager
ProgramWriterManager * mProgramWriterManager
Definition: OgreShaderGenerator.h:984
Ogre::RTShader::RenderState
This is a container class for sub render state class.
Definition: OgreShaderRenderState.h:49
Ogre::RTShader::ShaderGenerator::mActiveViewportValid
bool mActiveViewportValid
Definition: OgreShaderGenerator.h:1000
Ogre::RTShader::ShaderGenerator::mFragmentShaderProfilesList
StringVector mFragmentShaderProfilesList
Definition: OgreShaderGenerator.h:978
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager::SGScriptTranslatorManager
SGScriptTranslatorManager(ShaderGenerator *owner)
Definition: OgreShaderGenerator.h:813
Ogre::RTShader::ShaderGenerator::SGScheme::mName
String mName
Definition: OgreShaderGenerator.h:725
Ogre::RTShader::ShaderGenerator::mRenderObjectListener
SGRenderObjectListener * mRenderObjectListener
Definition: OgreShaderGenerator.h:958
Ogre::RTShader::ShaderGenerator::mVertexShaderProfilesList
StringVector mVertexShaderProfilesList
Definition: OgreShaderGenerator.h:974
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::shadowTexturesUpdated
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
Event raised after all shadow textures have been rendered into for all queues / targets but before an...
Definition: OgreShaderGenerator.h:787
Ogre::RTShader::SGScriptTranslator
This class responsible for translating core features of the RT Shader System for Ogre material script...
Definition: OgreShaderScriptTranslator.h:47
Ogre::HashedVector
A hashed vector.
Definition: OgreCommon.h:332
Ogre::RTShader::ShaderGenerator::SGPassList
vector< SGPass * >::type SGPassList
Definition: OgreShaderGenerator.h:483
Ogre::RTShader::ShaderGenerator::SGRenderObjectListener
Shader generator RenderObjectListener sub class.
Definition: OgreShaderGenerator.h:741
Ogre::RTShader::ShaderGenerator::SGTechnique::getDestinationTechniqueSchemeName
const String & getDestinationTechniqueSchemeName() const
Get the destination technique scheme name.
Definition: OgreShaderGenerator.h:580
Ogre::RTShader::ShaderGenerator::SGPass::UserKey
static String UserKey
Definition: OgreShaderGenerator.h:544
Ogre::RTShader::ShaderGenerator::SGMaterial::mName
String mName
Definition: OgreShaderGenerator.h:658
Ogre::RTShader::ShaderGenerator::getCreateShaderOverProgrammablePass
bool getCreateShaderOverProgrammablePass() const
Returns whether shaders are created for passes with shaders.
Definition: OgreShaderGenerator.h:451
Ogre::RTShader::ShaderGenerator::SGTechnique::getBuildDestinationTechnique
bool getBuildDestinationTechnique() const
Tells if the destination technique should be build.
Definition: OgreShaderGenerator.h:595
Ogre::PropertyAbstractNode
This abstract node represents a script property.
Definition: OgreScriptCompiler.h:147
Ogre::RTShader::ProgramManager
A singleton manager class that manages shader based programs.
Definition: OgreShaderProgramManager.h:46
Ogre::RenderObjectListener
Abstract interface which classes must implement if they wish to receive events from the scene manager...
Definition: OgreRenderObjectListener.h:43
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener
Shader generator scene manager sub class.
Definition: OgreShaderGenerator.h:764
Ogre::RTShader::ShaderGenerator::OGRE_AUTO_MUTEX
OGRE_AUTO_MUTEX
Definition: OgreShaderGenerator.h:952
Ogre::RTShader::ShaderGenerator::SGMaterialIterator
SGMaterialMap::iterator SGMaterialIterator
Definition: OgreShaderGenerator.h:495
Ogre::String
_StringBase String
Definition: OgrePrerequisites.h:439
Ogre::RTShader::ShaderGenerator::SGScheme::empty
bool empty() const
Return true if this scheme dose not contains any techniques.
Definition: OgreShaderGenerator.h:676
Ogre::RTShader::ShaderGenerator::setCreateShaderOverProgrammablePass
void setCreateShaderOverProgrammablePass(bool value)
Sets whether shaders are created for passes with shaders.
Definition: OgreShaderGenerator.h:446
Ogre::RTShader::ShaderGenerator::SubRenderStateFactoryIterator
SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator
Definition: OgreShaderGenerator.h:837
Ogre::RTShader::VSOutputCompactPolicy
VSOutputCompactPolicy
Definition: OgreShaderPrerequisites.h:81
Ogre::RTShader::ShaderGenerator::SGPass::setCustomRenderState
void setCustomRenderState(RenderState *customRenderState)
Set the custom render state of this pass.
Definition: OgreShaderGenerator.h:541
Ogre::RTShader::ShaderGenerator::SGPass::getSrcPass
Pass * getSrcPass()
Get source pass.
Definition: OgreShaderGenerator.h:529
Ogre::RTShader::ShaderGenerator::SGTechniqueMapIterator
SGTechniqueMap::iterator SGTechniqueMapIterator
Definition: OgreShaderGenerator.h:492
Ogre::RTShader::ShaderGenerator::SGPass
Shader generator pass wrapper class.
Definition: OgreShaderGenerator.h:509
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
Ogre::RTShader::ShaderGenerator::SceneManagerMap
map< String, SceneManager * >::type SceneManagerMap
Definition: OgreShaderGenerator.h:841
Ogre::RTShader::ShaderGenerator::SGPass::mCustomRenderState
RenderState * mCustomRenderState
Definition: OgreShaderGenerator.h:557
Ogre::RTShader::ShaderGenerator::SGTechnique::getParent
const SGMaterial * getParent() const
Get the parent SGMaterial.
Definition: OgreShaderGenerator.h:571
Ogre::RTShader::ShaderGenerator::SGTechnique
Shader generator technique wrapper class.
Definition: OgreShaderGenerator.h:564
Ogre::RTShader::ShaderGenerator::SGPass::getCustomRenderState
RenderState * getCustomRenderState()
Get custom render state of this pass.
Definition: OgreShaderGenerator.h:538
Ogre::RTShader::ShaderGenerator::getVertexShaderOutputsCompactPolicy
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const
Get the vertex shader outputs compaction policy.
Definition: OgreShaderGenerator.h:438
OgreSceneManager.h
_OgreRTSSExport
#define _OgreRTSSExport
Definition: OgreShaderPrerequisites.h:108
Ogre::RTShader::ShaderGenerator::SGTechnique::mSrcTechnique
Technique * mSrcTechnique
Definition: OgreShaderGenerator.h:619
Ogre::RTShader::ShaderGenerator::mVSOutputCompactPolicy
VSOutputCompactPolicy mVSOutputCompactPolicy
Definition: OgreShaderGenerator.h:1004
Ogre::RTShader::ShaderGenerator::SchemeCreateOrRetrieveResult
std::pair< SGScheme *, bool > SchemeCreateOrRetrieveResult
Definition: OgreShaderGenerator.h:941
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::mOwner
ShaderGenerator * mOwner
Definition: OgreShaderGenerator.h:806
Ogre::RTShader::ShaderGenerator::SGScheme::mOutOfDate
bool mOutOfDate
Definition: OgreShaderGenerator.h:729
Ogre::RTShader::SubRenderStateFactory
Abstract factory interface for creating SubRenderState implementation instances.
Definition: OgreShaderSubRenderState.h:232
OgreShaderScriptTranslator.h
Ogre::RTShader::ShaderGenerator::SGPass::mParent
SGTechnique * mParent
Definition: OgreShaderGenerator.h:551
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::RTShader::ShaderGenerator::SGTechniqueIterator
SGTechniqueList::iterator SGTechniqueIterator
Definition: OgreShaderGenerator.h:488
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::preFindVisibleObjects
virtual void preFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Listener overridden function notify the shader generator when finding visible objects process started...
Definition: OgreShaderGenerator.h:775
Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME
static String DEFAULT_SCHEME_NAME
Default material scheme of the shader generator.
Definition: OgreShaderGenerator.h:463
Ogre::RTShader::ShaderGenerator::mSceneManagerMap
SceneManagerMap mSceneManagerMap
Definition: OgreShaderGenerator.h:956
Ogre::RTShader::ShaderGenerator::SGMaterial
Shader generator material wrapper class.
Definition: OgreShaderGenerator.h:634
Ogre::RTShader::ShaderGenerator::SGMaterialConstIterator
SGMaterialMap::const_iterator SGMaterialConstIterator
Definition: OgreShaderGenerator.h:496
Ogre::RTShader::ShaderGenerator::SGTechniqueConstIterator
SGTechniqueList::const_iterator SGTechniqueConstIterator
Definition: OgreShaderGenerator.h:489
Ogre::SharedPtr
Reference-counted shared pointer, used for objects where implicit destruction is required.
Definition: OgrePrerequisites.h:310
Ogre::RTShader::ShaderGenerator::SGTechniqueList
vector< SGTechnique * >::type SGTechniqueList
Definition: OgreShaderGenerator.h:487
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager::getNumTranslators
virtual size_t getNumTranslators() const
Returns the number of translators being managed.
Definition: OgreShaderGenerator.h:819
Ogre::RTShader::ShaderGenerator::mShaderLanguage
String mShaderLanguage
Definition: OgreShaderGenerator.h:970
Ogre::RTShader::ShaderGenerator::SGMaterial::mTechniqueEntries
SGTechniqueList mTechniqueEntries
Definition: OgreShaderGenerator.h:662
Ogre::RTShader::ShaderGenerator::SGSceneManagerListener::postFindVisibleObjects
virtual void postFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Called after searching for visible objects in this SceneManager.
Definition: OgreShaderGenerator.h:781
Ogre::RTShader::ShaderGenerator::mVertexShaderProfiles
String mVertexShaderProfiles
Definition: OgreShaderGenerator.h:972
Ogre::RTShader::ShaderGenerator::setVertexShaderOutputsCompactPolicy
void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy)
Set the vertex shader outputs compaction policy.
Definition: OgreShaderGenerator.h:433
Ogre::Singleton
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
Ogre::RTShader::ShaderGenerator::mSubRenderStateExFactories
SubRenderStateFactoryMap mSubRenderStateExFactories
Definition: OgreShaderGenerator.h:998
Ogre::Technique
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:53
Ogre::RTShader::ShaderGenerator::SGMaterial::getGroupName
const String & getGroupName() const
Get the group name.
Definition: OgreShaderGenerator.h:648
Ogre::RTShader::ShaderGenerator::getFragmentShaderProfiles
const String & getFragmentShaderProfiles() const
Get the output fragment shader target profiles.
Definition: OgreShaderGenerator.h:161
OgreRenderObjectListener.h
Ogre::map
Definition: OgrePrerequisites.h:533
Ogre::RTShader::ShaderGenerator::getVertexShaderProfiles
const String & getVertexShaderProfiles() const
Get the output vertex shader target profiles.
Definition: OgreShaderGenerator.h:144
Ogre::AutoParamDataSource
This utility class is used to hold the information used to generate the matrices and other informatio...
Definition: OgreAutoParamDataSource.h:60
OgreFileSystemLayer.h
Ogre::RTShader::ShaderGenerator::SGScriptTranslatorManager::getTranslator
virtual ScriptTranslator * getTranslator(const AbstractNodePtr &node)
Returns a manager for the given object abstract node, or null if it is not supported.
Definition: OgreShaderGenerator.h:825
Ogre::Frustum
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:85
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::RTShader::ShaderGenerator::SGTechniqueMap
map< SGTechnique *, SGTechnique * >::type SGTechniqueMap
Definition: OgreShaderGenerator.h:491
Ogre::RTShader::ShaderGenerator::SceneManagerIterator
SceneManagerMap::iterator SceneManagerIterator
Definition: OgreShaderGenerator.h:842
Ogre::RTShader::ShaderGenerator::SGTechnique::mCustomRenderStates
RenderStateList mCustomRenderStates
Definition: OgreShaderGenerator.h:625
Ogre::RTShader::ShaderGenerator::SceneManagerConstIterator
SceneManagerMap::const_iterator SceneManagerConstIterator
Definition: OgreShaderGenerator.h:843
Ogre::RTShader::RenderStateList
vector< RenderState * >::type RenderStateList
Definition: OgreShaderRenderState.h:129
Ogre::RTShader::ShaderGenerator::SGSchemeMap
map< String, SGScheme * >::type SGSchemeMap
Definition: OgreShaderGenerator.h:498
Ogre::RTShader::ShaderGenerator::mTechniqueEntriesMap
SGTechniqueMap mTechniqueEntriesMap
Definition: OgreShaderGenerator.h:994
Ogre::RTShader::ShaderGenerator::getTargetLanguage
const String & getTargetLanguage() const
Return the target shader language currently in use.
Definition: OgreShaderGenerator.h:133
Ogre::RTShader::SGMaterialSerializerListener
This class responsible for translating core features of the RT Shader System for Ogre material script...
Definition: OgreShaderMaterialSerializerListener.h:47
Ogre::RTShader::ShaderGenerator::mScriptTranslatorsMap
SGScriptTranslatorMap mScriptTranslatorsMap
Definition: OgreShaderGenerator.h:966
Ogre::RTShader::ShaderGenerator::mScriptTranslatorManager
SGScriptTranslatorManager * mScriptTranslatorManager
Definition: OgreShaderGenerator.h:962
Ogre::Light
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
Ogre::RTShader::ShaderGenerator::MatGroupPair_less
Definition: OgreShaderGenerator.h:473
Ogre::RTShader::ShaderGenerator::SGTechnique::mDstTechniqueSchemeName
String mDstTechniqueSchemeName
Definition: OgreShaderGenerator.h:629
Ogre::RTShader::ShaderGenerator::SGTechnique::UserKey
static String UserKey
Definition: OgreShaderGenerator.h:605
Ogre::ScriptCompiler
This is the main class for the compiler.
Definition: OgreScriptCompiler.h:188
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre::RTShader::ShaderGenerator::SGRenderObjectListener::SGRenderObjectListener
SGRenderObjectListener(ShaderGenerator *owner)
Definition: OgreShaderGenerator.h:744
OgreScriptTranslator.h
Ogre::RTShader::ShaderGenerator::SGTechnique::getDestinationTechnique
Technique * getDestinationTechnique()
Get the destination technique.
Definition: OgreShaderGenerator.h:577
Ogre::RTShader::ShaderGenerator::mMaterialEntriesMap
SGMaterialMap mMaterialEntriesMap
Definition: OgreShaderGenerator.h:990
Ogre::RTShader::ShaderGenerator::mFFPRenderStateBuilder
FFPRenderStateBuilder * mFFPRenderStateBuilder
Definition: OgreShaderGenerator.h:988

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.