OGRE  1.9.0
OgreShaderGenerator.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14 
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 THE SOFTWARE.
25 -----------------------------------------------------------------------------
26 */
27 #ifndef _ShaderGenerator_
28 #define _ShaderGenerator_
29 
31 #include "OgreSingleton.h"
32 #include "OgreFileSystemLayer.h"
34 #include "OgreSceneManager.h"
35 #include "OgreShaderRenderState.h"
36 #include "OgreScriptTranslator.h"
38 
39 
40 namespace Ogre {
41 namespace RTShader {
42 
53 class _OgreRTSSExport ShaderGenerator : public Singleton<ShaderGenerator>, public RTShaderSystemAlloc
54 {
55 // Interface.
56 public:
57 
62  static bool initialize();
63 
67  static void destroy();
68 
69 
85  static ShaderGenerator& getSingleton();
86 
87 
103  static ShaderGenerator* getSingletonPtr();
104 
109  void addSceneManager(SceneManager* sceneMgr);
110 
115  void removeSceneManager(SceneManager* sceneMgr);
116 
121  SceneManager* getActiveSceneManager();
122 
128  void setTargetLanguage(const String& shaderLanguage);
129 
133  const String& getTargetLanguage() const { return mShaderLanguage; }
134 
139  void setVertexShaderProfiles(const String& vertexShaderProfiles);
140 
144  const String& getVertexShaderProfiles() const { return mVertexShaderProfiles; }
145 
149  const StringVector& getVertexShaderProfilesList() const { return mVertexShaderProfilesList; }
150 
151 
156  void setFragmentShaderProfiles(const String& fragmentShaderProfiles);
157 
161  const String& getFragmentShaderProfiles() const { return mFragmentShaderProfiles; }
162 
166  const StringVector& getFragmentShaderProfilesList() const { return mFragmentShaderProfilesList; }
167 
174  void setShaderCachePath(const String& cachePath);
175 
179  const String& getShaderCachePath() const { return mShaderCachePath; }
180 
185  void flushShaderCache();
186 
195  RenderState* getRenderState(const String& schemeName);
196 
197 
198  typedef std::pair<RenderState*, bool> RenderStateCreateOrRetrieveResult;
203  RenderStateCreateOrRetrieveResult createOrRetrieveRenderState(const String& schemeName);
204 
205 
210  bool hasRenderState(const String& schemeName) const;
211 
212 
220  RenderState* getRenderState(const String& schemeName, const String& materialName, unsigned short passIndex);
221 
230  RenderState* getRenderState(const String& schemeName, const String& materialName, const String& groupName, unsigned short passIndex);
231 
238  void addSubRenderStateFactory(SubRenderStateFactory* factory);
239 
243  size_t getNumSubRenderStateFactories() const;
244 
249  SubRenderStateFactory* getSubRenderStateFactory(size_t index);
250 
254  SubRenderStateFactory* getSubRenderStateFactory(const String& type);
255 
260  void removeSubRenderStateFactory(SubRenderStateFactory* factory);
261 
266  SubRenderState* createSubRenderState(const String& type);
267 
268 
273  void destroySubRenderState(SubRenderState* subRenderState);
274 
275 
283  bool hasShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
284 
293  bool hasShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
294 
304  bool createShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
305 
316  bool createShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
317 
318 
327  bool removeShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
328 
338  bool removeShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
339 
340 
347  bool removeAllShaderBasedTechniques(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
348 
359  bool cloneShaderBasedTechniques(const String& srcMaterialName,
360  const String& srcGroupName, const String& dstMaterialName, const String& dstGroupName);
361 
365  void removeAllShaderBasedTechniques();
366 
371  void createScheme(const String& schemeName);
372 
378  void invalidateScheme(const String& schemeName);
379 
385  bool validateScheme(const String& schemeName);
386 
394  void invalidateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
395 
403  bool validateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
404 
412  void invalidateMaterialIlluminationPasses(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
413 
421  bool validateMaterialIlluminationPasses(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
422 
434  SGMaterialSerializerListener* getMaterialSerializerListener();
435 
436 
438  size_t getVertexShaderCount() const;
439 
440 
442  size_t getFragmentShaderCount() const;
443 
444 
445 
450  void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy) { mVSOutputCompactPolicy = policy; }
451 
455  VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const { return mVSOutputCompactPolicy; }
456 
457 
463  void setCreateShaderOverProgrammablePass(bool value) { mCreateShaderOverProgrammablePass = value; }
464 
468  bool getCreateShaderOverProgrammablePass() const { return mCreateShaderOverProgrammablePass; }
469 
470 
473  size_t getRTShaderSchemeCount() const;
474 
477  const String& getRTShaderScheme(size_t index) const;
478 
481 
482 // Protected types.
483 protected:
484  class SGPass;
485  class SGTechnique;
486  class SGMaterial;
487  class SGScheme;
488 
489  typedef std::pair<String,String> MatGroupPair;
491  {
492  // ensure we arrange the list first by material name then by group name
493  bool operator()(const MatGroupPair& p1, const MatGroupPair& p2) const
494  {
495  int cmpVal = strcmp(p1.first.c_str(),p2.first.c_str());
496  return (cmpVal < 0) || ((cmpVal == 0) && (strcmp(p1.second.c_str(),p2.second.c_str()) < 0));
497  }
498  };
499 
501  typedef SGPassList::iterator SGPassIterator;
502  typedef SGPassList::const_iterator SGPassConstIterator;
503 
505  typedef SGTechniqueList::iterator SGTechniqueIterator;
506  typedef SGTechniqueList::const_iterator SGTechniqueConstIterator;
507 
509  typedef SGTechniqueMap::iterator SGTechniqueMapIterator;
510 
512  typedef SGMaterialMap::iterator SGMaterialIterator;
513  typedef SGMaterialMap::const_iterator SGMaterialConstIterator;
514 
516  typedef SGSchemeMap::iterator SGSchemeIterator;
517  typedef SGSchemeMap::const_iterator SGSchemeConstIterator;
518 
520  typedef SGScriptTranslatorMap::iterator SGScriptTranslatorIterator;
521  typedef SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator;
522 
523 
524 
527  {
528  public:
529  SGPass(SGTechnique* parent, Pass* srcPass, Pass* dstPass, IlluminationStage stage);
530  ~SGPass();
531 
533  void buildTargetRenderState();
534 
536  void acquirePrograms();
537 
539  void releasePrograms();
540 
541 
543  void notifyRenderSingleObject(Renderable* rend, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
544 
546  Pass* getSrcPass() { return mSrcPass; }
547 
549  Pass* getDstPass() { return mDstPass; }
550 
553 
555  bool isIlluminationPass() { return mStage != IS_UNKNOWN; }
556 
558  SubRenderState* getCustomFFPSubState(int subStateOrder);
559 
561  RenderState* getCustomRenderState() { return mCustomRenderState; }
562 
564  void setCustomRenderState(RenderState* customRenderState) { mCustomRenderState = customRenderState; }
565 
566  // Key name for associating with a Pass instance.
567  static String UserKey;
568 
569  protected:
570  SubRenderState* getCustomFFPSubState(int subStateOrder, const RenderState* renderState);
571 
572  protected:
573  // Parent technique.
575  // Source pass.
577  // Destination pass.
579  // Illumination stage
581  // Custom render state.
583  // The compiled render state.
585  };
586 
587 
590  {
591  public:
592  SGTechnique(SGMaterial* parent, Technique* srcTechnique, const String& dstTechniqueSchemeName);
593  ~SGTechnique();
594 
596  const SGMaterial* getParent() const { return mParent; }
597 
599  Technique* getSourceTechnique() { return mSrcTechnique; }
600 
602  Technique* getDestinationTechnique() { return mDstTechnique; }
603 
605  const String& getDestinationTechniqueSchemeName() const { return mDstTechniqueSchemeName; }
606 
608  void buildTargetRenderState();
609 
611  void acquirePrograms();
612 
614  void buildIlluminationTargetRenderState();
615 
617  void acquireIlluminationPrograms();
618 
620  void destroyIlluminationSGPasses();
621 
623  void releasePrograms();
624 
626  void setBuildDestinationTechnique(bool buildTechnique) { mBuildDstTechnique = buildTechnique; }
627 
629  bool getBuildDestinationTechnique() const { return mBuildDstTechnique; }
630 
634  RenderState* getRenderState(unsigned short passIndex);
636  bool hasRenderState(unsigned short passIndex);
637 
638  // Key name for associating with a Technique instance.
639  static String UserKey;
640 
641  protected:
642 
644  void createSGPasses();
645 
647  void createIlluminationSGPasses();
648 
650  void destroySGPasses();
651 
652  protected:
653  // Auto mutex.
655  // Parent material.
657  // Source technique.
659  // Destination technique.
661  // All passes entries, both normal and illumination.
663  // The custom render states of all passes.
665  // Flag that tells if destination technique should be build.
667  // Scheme name of destination technique.
669  };
670 
671 
674  {
675 
676  public:
678  SGMaterial(const String& materialName, const String& groupName) : mName(materialName), mGroup(groupName)
679  {
680 
681  }
682 
684  const String& getMaterialName() const { return mName; }
685 
687  const String& getGroupName() const { return mGroup; }
688 
690  const SGTechniqueList& getTechniqueList() const { return mTechniqueEntries; }
691 
693  SGTechniqueList& getTechniqueList() { return mTechniqueEntries; }
694 
695  protected:
696  // The material name.
698  // The group name.
700  // All passes entries.
702  };
703 
704 
707  {
708  public:
709  SGScheme(const String& schemeName);
710  ~SGScheme();
711 
712 
715  bool empty() const { return mTechniqueEntries.empty(); }
716 
720  void invalidate();
721 
725  void validate();
726 
730  void invalidate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
731 
735  bool validate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
736 
740  void invalidateIlluminationPasses(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
741 
745  bool validateIlluminationPasses(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
746 
748  void addTechniqueEntry(SGTechnique* techEntry);
749 
751  void removeTechniqueEntry(SGTechnique* techEntry);
752 
753 
757  RenderState* getRenderState();
758 
762  RenderState* getRenderState(const String& materialName, const String& groupName, unsigned short passIndex);
763 
764  protected:
766  void synchronizeWithLightSettings();
767 
769  void synchronizeWithFogSettings();
770 
771 
772  protected:
773  // Scheme name.
775  // Technique entries.
777  // Tells if this scheme is out of date.
779  // The global render state of this scheme.
781  // Current fog mode.
783  };
784 
785 
786 // Protected types.
787 protected:
788 
791  {
792  public:
794  {
795  mOwner = owner;
796  }
797 
801  virtual void notifyRenderSingleObject(Renderable* rend, const Pass* pass,
802  const AutoParamDataSource* source,
803  const LightList* pLightList, bool suppressRenderStateChanges)
804  {
805  mOwner->notifyRenderSingleObject(rend, pass, source, pLightList, suppressRenderStateChanges);
806  }
807 
808  protected:
810  };
811 
814  {
815  public:
817  {
818  mOwner = owner;
819  }
820 
824  virtual void preFindVisibleObjects(SceneManager* source,
826  {
827  mOwner->preFindVisibleObjects(source, irs, v);
828  }
829 
830  virtual void postFindVisibleObjects(SceneManager* source,
832  {
833 
834  }
835 
836  virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
837  {
838 
839  }
840 
841  virtual void shadowTextureCasterPreViewProj(Light* light,
842  Camera* camera, size_t iteration)
843  {
844 
845  }
846 
848  Frustum* frustum)
849  {
850 
851  }
852 
853  protected:
854  // The shader generator instance.
856  };
857 
860  {
861  public:
863  {
864  mOwner = owner;
865  }
866 
868  virtual size_t getNumTranslators() const
869  {
870  return mOwner->getNumTranslators();
871  }
872 
875  {
876  return mOwner->getTranslator(node);
877  }
878 
879  protected:
880  // The shader generator instance.
882  };
883 
884  //-----------------------------------------------------------------------------
886  typedef SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator;
887  typedef SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator;
888 
889  //-----------------------------------------------------------------------------
891  typedef SceneManagerMap::iterator SceneManagerIterator;
892  typedef SceneManagerMap::const_iterator SceneManagerConstIterator;
893 
894 protected:
896  ShaderGenerator();
897 
899  ~ShaderGenerator();
900 
902  bool _initialize();
903 
905  void _destroy();
906 
908  Technique* findSourceTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, bool allowProgrammable);
909 
911  bool isProgrammable(Technique* tech) const;
912 
914  void notifyRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
915 
917  void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v);
918 
920  void createSubRenderStateExFactories();
921 
923  void destroySubRenderStateExFactories();
924 
933  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
934 
943  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
944 
951  bool addCustomScriptTranslator(const String& key, ScriptTranslator* translator);
952 
958  bool removeCustomScriptTranslator(const String& key);
959 
961  size_t getNumTranslators() const;
962 
964  ScriptTranslator* getTranslator(const AbstractNodePtr& node);
965 
966 
972  void serializePassAttributes(MaterialSerializer* ser, SGPass* passEntry);
973 
980  void serializeTextureUnitStateAttributes(MaterialSerializer* ser, SGPass* passEntry, const TextureUnitState* srcTextureUnit);
981 
986  SGMaterialIterator findMaterialEntryIt(const String& materialName, const String& groupName);
987  SGMaterialConstIterator findMaterialEntryIt(const String& materialName, const String& groupName) const;
988 
989 
990  typedef std::pair<SGScheme*, bool> SchemeCreateOrRetrieveResult;
995  SchemeCreateOrRetrieveResult createOrRetrieveScheme(const String& schemeName);
996 
998  bool getIsFinalizing() const;
999 protected:
1000  // Auto mutex.
1002  // The active scene manager.
1004  // A map of all scene managers this generator is bound to.
1006  // Render object listener.
1008  // Scene manager listener.
1010  // Script translator manager.
1012  // Custom material Serializer listener - allows exporting material that contains shader generated techniques.
1014  // A map of the registered custom script translators.
1016  // The core translator of the RT Shader System.
1018  // The target shader language (currently only cg supported).
1020  // The target vertex shader profile. Will be used as argument for program compilation.
1022  // List of target vertex shader profiles.
1024  // The target fragment shader profile. Will be used as argument for program compilation.
1026  // List of target fragment shader profiles..
1028  // Path for caching the generated shaders.
1030  // Shader program manager.
1032  // Shader program writer manager.
1034  // File system layer manager.
1036  // Fixed Function Render state builder.
1037  FFPRenderStateBuilder* mFFPRenderStateBuilder;
1038  // Material entries map.
1040  // Scheme entries map.
1042  // All technique entries map.
1044  // Sub render state registered factories.
1046  // Sub render state core extension factories.
1048  // True if active view port use a valid SGScheme.
1050  // Light count per light type.
1051  int mLightCount[3];
1052  // Vertex shader outputs compact policy.
1054  // Tells whether shaders are created for passes with shaders
1056  // a flag to indicate finalizing
1058 private:
1059  friend class SGPass;
1060  friend class FFPRenderStateBuilder;
1062  friend class SGScriptTranslator;
1064 
1065 };
1066 
1070 }
1071 }
1072 
1073 #endif
1074 
map< String, SubRenderStateFactory * >::type SubRenderStateFactoryMap
const StringVector & getVertexShaderProfilesList() const
Get the output vertex shader target profiles as list of strings.
std::pair< String, String > MatGroupPair
SGScriptTranslatorMap::iterator SGScriptTranslatorIterator
SGSceneManagerListener * mSceneManagerListener
SGMaterialSerializerListener * mMaterialSerializerListener
SGTechniqueList & getTechniqueList()
Get the techniques list of this material.
FogMode
Fog modes.
Definition: OgreCommon.h:121
Abstract class defining the interface all renderable objects must implement.
Class for serializing Materials to / from a .material script.
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:80
The ScriptTranslatorManager manages the lifetime and access to script translators.
This is the target render state.
SGPassList::const_iterator SGPassConstIterator
This class is the base interface of sub part from a shader based rendering pipeline.
map< MatGroupPair, SGMaterial *, MatGroupPair_less >::type SGMaterialMap
const String & getMaterialName() const
Get the material name.
Shader generator ScriptTranslatorManager sub class.
bool operator()(const MatGroupPair &p1, const MatGroupPair &p2) const
IlluminationStage getIlluminationStage()
Get illumination stage.
void setBuildDestinationTechnique(bool buildTechnique)
Tells the technique that it needs to generate shader code.
SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator
std::pair< RenderState *, bool > RenderStateCreateOrRetrieveResult
SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator
SGMaterial(const String &materialName, const String &groupName)
Class constructor.
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.
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
vector< String >::type StringVector
Shader generator system main interface.
Provides methods to find out where the Ogre config files are stored and where logs and settings files...
This class translates script AST (abstract syntax tree) into Ogre resources.
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
map< String, ScriptTranslator * >::type SGScriptTranslatorMap
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
virtual void shadowTextureReceiverPreViewProj(Light *light, Frustum *frustum)
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiv...
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
Technique * getSourceTechnique()
Get the source technique.
const SGTechniqueList & getTechniqueList() const
Get the const techniques list of this material.
SGSchemeMap::const_iterator SGSchemeConstIterator
SubRenderStateFactoryMap mSubRenderStateFactories
const StringVector & getFragmentShaderProfilesList() const
Get the output fragment shader target profiles as list of strings.
SGSchemeMap::iterator SGSchemeIterator
const String & getShaderCachePath() const
Get the output shader cache path.
Pass * getDstPass()
Get destination pass.
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...
Class representing the state of a single texture unit during a Pass of a Technique,...
ProgramWriterManager * mProgramWriterManager
This is a container class for sub render state class.
SGRenderObjectListener * mRenderObjectListener
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
Event raised after all shadow textures have been rendered into for all queues / targets but before an...
This class responsible for translating core features of the RT Shader System for Ogre material script...
vector< SGPass * >::type SGPassList
Shader generator RenderObjectListener sub class.
const String & getDestinationTechniqueSchemeName() const
Get the destination technique scheme name.
Not determined.
Definition: OgrePass.h:58
bool getCreateShaderOverProgrammablePass() const
Returns whether shaders are created for passes with shaders.
bool getBuildDestinationTechnique() const
Tells if the destination technique should be build.
This abstract node represents a script property.
A singleton manager class that manages shader based programs.
Abstract interface which classes must implement if they wish to receive events from the scene manager...
SGMaterialMap::iterator SGMaterialIterator
_StringBase String
bool empty() const
Return true if this scheme dose not contains any techniques.
bool isIlluminationPass()
Get illumination state.
void setCreateShaderOverProgrammablePass(bool value)
Sets whether shaders are created for passes with shaders.
SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator
void setCustomRenderState(RenderState *customRenderState)
Set the custom render state of this pass.
SGTechniqueMap::iterator SGTechniqueMapIterator
Shader generator pass wrapper class.
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
map< String, SceneManager * >::type SceneManagerMap
const SGMaterial * getParent() const
Get the parent SGMaterial.
Shader generator technique wrapper class.
RenderState * getCustomRenderState()
Get custom render state of this pass.
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const
Get the vertex shader outputs compaction policy.
#define _OgreRTSSExport
VSOutputCompactPolicy mVSOutputCompactPolicy
std::pair< SGScheme *, bool > SchemeCreateOrRetrieveResult
Abstract factory interface for creating SubRenderState implementation instances.
SGTechniqueList::iterator SGTechniqueIterator
virtual void preFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Listener overridden function notify the shader generator when finding visible objects process started...
static String DEFAULT_SCHEME_NAME
Default material scheme of the shader generator.
Shader generator material wrapper class.
SGMaterialMap::const_iterator SGMaterialConstIterator
SGTechniqueList::const_iterator SGTechniqueConstIterator
Reference-counted shared pointer, used for objects where implicit destruction is required.
vector< SGTechnique * >::type SGTechniqueList
virtual size_t getNumTranslators() const
Returns the number of translators being managed.
IlluminationStage
Categorisation of passes for the purpose of additive lighting.
Definition: OgrePass.h:49
virtual void postFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Called after searching for visible objects in this SceneManager.
void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy)
Set the vertex shader outputs compaction policy.
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
SubRenderStateFactoryMap mSubRenderStateExFactories
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:53
const String & getGroupName() const
Get the group name.
const String & getFragmentShaderProfiles() const
Get the output fragment shader target profiles.
const String & getVertexShaderProfiles() const
Get the output vertex shader target profiles.
This utility class is used to hold the information used to generate the matrices and other informatio...
virtual ScriptTranslator * getTranslator(const AbstractNodePtr &node)
Returns a manager for the given object abstract node, or null if it is not supported.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:85
Manages the organisation and rendering of a 'scene' i.e.
map< SGTechnique *, SGTechnique * >::type SGTechniqueMap
SceneManagerMap::iterator SceneManagerIterator
SceneManagerMap::const_iterator SceneManagerConstIterator
vector< RenderState * >::type RenderStateList
map< String, SGScheme * >::type SGSchemeMap
const String & getTargetLanguage() const
Return the target shader language currently in use.
This class responsible for translating core features of the RT Shader System for Ogre material script...
SGScriptTranslatorMap mScriptTranslatorsMap
SGScriptTranslatorManager * mScriptTranslatorManager
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
This is the main class for the compiler.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Technique * getDestinationTechnique()
Get the destination technique.
FFPRenderStateBuilder * mFFPRenderStateBuilder