OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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"
33 #include "OgreSceneManager.h"
34 #include "OgreShaderRenderState.h"
35 #include "OgreScriptTranslator.h"
37 
38 
39 namespace Ogre {
40 
41  class FileSystemLayer;
42 
43 namespace RTShader {
44 
55 class _OgreRTSSExport ShaderGenerator : public Singleton<ShaderGenerator>, public RTShaderSystemAlloc
56 {
57 // Interface.
58 public:
59 
64  static bool initialize();
65 
69  static void destroy();
70 
71 
87  static ShaderGenerator& getSingleton();
88 
89 
105  static ShaderGenerator* getSingletonPtr();
106 
111  void addSceneManager(SceneManager* sceneMgr);
112 
117  void removeSceneManager(SceneManager* sceneMgr);
118 
123  SceneManager* getActiveSceneManager();
124 
131  void _setActiveSceneManager(SceneManager* sceneManager);
132 
138  void setTargetLanguage(const String& shaderLanguage,const float version = 1.0);
139 
143  bool IsHlsl4() const { return mShaderLanguage == "hlsl" && mShaderLanguageVersion == 4.0f; }
147  const String& getTargetLanguage() const { return mShaderLanguage; }
148 
152  float getTargetLanguageVersion() const { return mShaderLanguageVersion; }
153 
158  void setVertexShaderProfiles(const String& vertexShaderProfiles);
159 
163  const String& getVertexShaderProfiles() const { return mVertexShaderProfiles; }
164 
168  const StringVector& getVertexShaderProfilesList() const { return mVertexShaderProfilesList; }
169 
170 
175  void setFragmentShaderProfiles(const String& fragmentShaderProfiles);
176 
180  const String& getFragmentShaderProfiles() const { return mFragmentShaderProfiles; }
181 
185  const StringVector& getFragmentShaderProfilesList() const { return mFragmentShaderProfilesList; }
186 
193  void setShaderCachePath(const String& cachePath);
194 
198  const String& getShaderCachePath() const { return mShaderCachePath; }
199 
204  void flushShaderCache();
205 
214  RenderState* getRenderState(const String& schemeName);
215 
216 
217  typedef std::pair<RenderState*, bool> RenderStateCreateOrRetrieveResult;
222  RenderStateCreateOrRetrieveResult createOrRetrieveRenderState(const String& schemeName);
223 
224 
229  bool hasRenderState(const String& schemeName) const;
230 
231 
239  RenderState* getRenderState(const String& schemeName, const String& materialName, unsigned short passIndex);
240 
249  RenderState* getRenderState(const String& schemeName, const String& materialName, const String& groupName, unsigned short passIndex);
250 
257  void addSubRenderStateFactory(SubRenderStateFactory* factory);
258 
262  size_t getNumSubRenderStateFactories() const;
263 
268  SubRenderStateFactory* getSubRenderStateFactory(size_t index);
269 
273  SubRenderStateFactory* getSubRenderStateFactory(const String& type);
274 
279  void removeSubRenderStateFactory(SubRenderStateFactory* factory);
280 
285  SubRenderState* createSubRenderState(const String& type);
286 
287 
292  void destroySubRenderState(SubRenderState* subRenderState);
293 
294 
302  bool hasShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
303 
312  bool hasShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName) const;
313 
323  bool createShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
324 
335  bool createShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName, bool overProgrammable = false);
336 
337 
346  bool removeShaderBasedTechnique(const String& materialName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
347 
357  bool removeShaderBasedTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, const String& dstTechniqueSchemeName);
358 
359 
366  bool removeAllShaderBasedTechniques(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
367 
378  bool cloneShaderBasedTechniques(const String& srcMaterialName,
379  const String& srcGroupName, const String& dstMaterialName, const String& dstGroupName);
380 
384  void removeAllShaderBasedTechniques();
385 
390  void createScheme(const String& schemeName);
391 
397  void invalidateScheme(const String& schemeName);
398 
404  bool validateScheme(const String& schemeName);
405 
413  void invalidateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
414 
422  bool validateMaterial(const String& schemeName, const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
423 
424 
436  SGMaterialSerializerListener* getMaterialSerializerListener();
437 
438 
440  size_t getVertexShaderCount() const;
441 
442 
444  size_t getFragmentShaderCount() const;
445 
446 
447 
452  void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy) { mVSOutputCompactPolicy = policy; }
453 
457  VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const { return mVSOutputCompactPolicy; }
458 
459 
465  void setCreateShaderOverProgrammablePass(bool value) { mCreateShaderOverProgrammablePass = value; }
466 
470  bool getCreateShaderOverProgrammablePass() const { return mCreateShaderOverProgrammablePass; }
471 
472 
475  size_t getRTShaderSchemeCount() const;
476 
479  const String& getRTShaderScheme(size_t index) const;
480 
483 
484 // Protected types.
485 protected:
486  class SGPass;
487  class SGTechnique;
488  class SGMaterial;
489  class SGScheme;
490 
491  typedef std::pair<String,String> MatGroupPair;
493  {
494  // ensure we arrange the list first by material name then by group name
495  bool operator()(const MatGroupPair& p1, const MatGroupPair& p2) const
496  {
497  int cmpVal = strcmp(p1.first.c_str(),p2.first.c_str());
498  return (cmpVal < 0) || ((cmpVal == 0) && (strcmp(p1.second.c_str(),p2.second.c_str()) < 0));
499  }
500  };
501 
503  typedef SGPassList::iterator SGPassIterator;
504  typedef SGPassList::const_iterator SGPassConstIterator;
505 
507  typedef SGTechniqueList::iterator SGTechniqueIterator;
508  typedef SGTechniqueList::const_iterator SGTechniqueConstIterator;
509 
511  typedef SGTechniqueMap::iterator SGTechniqueMapIterator;
512 
514  typedef SGMaterialMap::iterator SGMaterialIterator;
515  typedef SGMaterialMap::const_iterator SGMaterialConstIterator;
516 
518  typedef SGSchemeMap::iterator SGSchemeIterator;
519  typedef SGSchemeMap::const_iterator SGSchemeConstIterator;
520 
522  typedef SGScriptTranslatorMap::iterator SGScriptTranslatorIterator;
523  typedef SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator;
524 
525 
526 
529  {
530  public:
531  SGPass(SGTechnique* parent, Pass* srcPass, Pass* dstPass);
532  ~SGPass();
533 
535  void buildTargetRenderState();
536 
538  void acquirePrograms();
539 
541  void releasePrograms();
542 
543 
545  void notifyRenderSingleObject(Renderable* rend, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
546 
548  Pass* getSrcPass() { return mSrcPass; }
549 
551  Pass* getDstPass() { return mDstPass; }
552 
554  SubRenderState* getCustomFFPSubState(int subStateOrder);
555 
557  RenderState* getCustomRenderState() { return mCustomRenderState; }
558 
560  void setCustomRenderState(RenderState* customRenderState) { mCustomRenderState = customRenderState; }
561 
563  static String UserKey;
564 
565  protected:
566  SubRenderState* getCustomFFPSubState(int subStateOrder, const RenderState* renderState);
567 
568  protected:
569  // Parent technique.
571  // Source pass.
573  // Destination pass.
575  // Custom render state.
577  // The compiled render state.
579  };
580 
581 
584  {
585  public:
586  SGTechnique(SGMaterial* parent, Technique* srcTechnique, const String& dstTechniqueSchemeName);
587  ~SGTechnique();
588 
590  const SGMaterial* getParent() const { return mParent; }
591 
593  Technique* getSourceTechnique() { return mSrcTechnique; }
594 
596  Technique* getDestinationTechnique() { return mDstTechnique; }
597 
599  const String& getDestinationTechniqueSchemeName() const { return mDstTechniqueSchemeName; }
600 
602  void buildTargetRenderState();
603 
605  void acquirePrograms();
606 
608  void releasePrograms();
609 
611  void setBuildDestinationTechnique(bool buildTechnique) { mBuildDstTechnique = buildTechnique; }
612 
614  bool getBuildDestinationTechnique() const { return mBuildDstTechnique; }
615 
619  RenderState* getRenderState(unsigned short passIndex);
621  bool hasRenderState(unsigned short passIndex);
622 
623  // Key name for associating with a Technique instance.
624  static String UserKey;
625 
626  protected:
627 
629  void createSGPasses();
630 
632  void destroySGPasses();
633 
634  protected:
635  // Parent material.
637  // Source technique.
639  // Destination technique.
641  // All passes entries.
643  // The custom render states of all passes.
645  // Flag that tells if destination technique should be build.
647  // Scheme name of destination technique.
649  };
650 
651 
654  {
655 
656  public:
658  SGMaterial(const String& materialName, const String& groupName) : mName(materialName), mGroup(groupName)
659  {
660 
661  }
662 
664  const String& getMaterialName() const { return mName; }
665 
667  const String& getGroupName() const { return mGroup; }
668 
670  const SGTechniqueList& getTechniqueList() const { return mTechniqueEntries; }
671 
673  SGTechniqueList& getTechniqueList() { return mTechniqueEntries; }
674 
675  protected:
676  // The material name.
678  // The group name.
680  // All passes entries.
682  };
683 
684 
687  {
688  public:
689  SGScheme(const String& schemeName);
690  ~SGScheme();
691 
692 
695  bool empty() const { return mTechniqueEntries.empty(); }
696 
700  void invalidate();
701 
705  void validate();
706 
710  void invalidate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
711 
715  bool validate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
716 
718  void addTechniqueEntry(SGTechnique* techEntry);
719 
721  void removeTechniqueEntry(SGTechnique* techEntry);
722 
723 
727  RenderState* getRenderState();
728 
732  RenderState* getRenderState(const String& materialName, const String& groupName, unsigned short passIndex);
733 
734  protected:
736  void synchronizeWithLightSettings();
737 
739  void synchronizeWithFogSettings();
740 
741 
742  protected:
743  // Scheme name.
745  // Technique entries.
747  // Tells if this scheme is out of date.
749  // The global render state of this scheme.
751  // Current fog mode.
753  };
754 
755 
756 // Protected types.
757 protected:
758 
761  {
762  public:
764  {
765  mOwner = owner;
766  }
767 
771  virtual void notifyRenderSingleObject(Renderable* rend, const Pass* pass,
772  const AutoParamDataSource* source,
773  const LightList* pLightList, bool suppressRenderStateChanges)
774  {
775  mOwner->notifyRenderSingleObject(rend, pass, source, pLightList, suppressRenderStateChanges);
776  }
777 
778  protected:
780  };
781 
784  {
785  public:
787  {
788  mOwner = owner;
789  }
790 
794  virtual void preFindVisibleObjects(SceneManager* source,
796  {
797  mOwner->preFindVisibleObjects(source, irs, v);
798  }
799 
800  virtual void postFindVisibleObjects(SceneManager* source,
802  {
803 
804  }
805 
806  virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
807  {
808 
809  }
810 
811  virtual void shadowTextureCasterPreViewProj(Light* light,
812  Camera* camera, size_t iteration)
813  {
814 
815  }
816 
818  Frustum* frustum)
819  {
820 
821  }
822 
823  protected:
824  // The shader generator instance.
826  };
827 
830  {
831  public:
833  {
834  mOwner = owner;
835  }
836 
838  virtual size_t getNumTranslators() const
839  {
840  return mOwner->getNumTranslators();
841  }
842 
845  {
846  return mOwner->getTranslator(node);
847  }
848 
849  protected:
850  // The shader generator instance.
852  };
853 
854  //-----------------------------------------------------------------------------
856  typedef SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator;
857  typedef SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator;
858 
859  //-----------------------------------------------------------------------------
861  typedef SceneManagerMap::iterator SceneManagerIterator;
862  typedef SceneManagerMap::const_iterator SceneManagerConstIterator;
863 
864 protected:
866  ShaderGenerator();
867 
869  ~ShaderGenerator();
870 
872  bool _initialize();
873 
875  void _destroy();
876 
878  Technique* findSourceTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, bool allowProgrammable);
879 
881  bool isProgrammable(Technique* tech) const;
882 
884  void notifyRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
885 
887  void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v);
888 
890  void createSubRenderStateExFactories();
891 
893  void destroySubRenderStateExFactories();
894 
903  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
904 
913  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
914 
921  bool addCustomScriptTranslator(const String& key, ScriptTranslator* translator);
922 
928  bool removeCustomScriptTranslator(const String& key);
929 
931  size_t getNumTranslators() const;
932 
934  ScriptTranslator* getTranslator(const AbstractNodePtr& node);
935 
936 
942  void serializePassAttributes(MaterialSerializer* ser, SGPass* passEntry);
943 
950  void serializeTextureUnitStateAttributes(MaterialSerializer* ser, SGPass* passEntry, const TextureUnitState* srcTextureUnit);
951 
956  SGMaterialIterator findMaterialEntryIt(const String& materialName, const String& groupName);
957  SGMaterialConstIterator findMaterialEntryIt(const String& materialName, const String& groupName) const;
958 
959 
960  typedef std::pair<SGScheme*, bool> SchemeCreateOrRetrieveResult;
965  SchemeCreateOrRetrieveResult createOrRetrieveScheme(const String& schemeName);
966 
968  bool getIsFinalizing() const;
969 protected:
970  // Auto mutex.
972  // The active scene manager.
974  // A map of all scene managers this generator is bound to.
976  // Render object listener.
978  // Scene manager listener.
980  // Script translator manager.
982  // Custom material Serializer listener - allows exporting material that contains shader generated techniques.
984  // A map of the registered custom script translators.
986  // The core translator of the RT Shader System.
988  // The target shader language (currently only cg supported).
990  // The target shader language version.
992  // The target vertex shader profile. Will be used as argument for program compilation.
994  // List of target vertex shader profiles.
996  // The target fragment shader profile. Will be used as argument for program compilation.
998  // List of target fragment shader profiles..
1000  // Path for caching the generated shaders.
1002  // Shader program manager.
1004  // Shader program writer manager.
1006  // File system layer manager.
1008  // Fixed Function Render state builder.
1009  FFPRenderStateBuilder* mFFPRenderStateBuilder;
1010  // Material entries map.
1012  // Scheme entries map.
1014  // All technique entries map.
1016  // Sub render state registered factories.
1018  // Sub render state core extension factories.
1020  // True if active view port use a valid SGScheme.
1022  // Light count per light type.
1023  int mLightCount[3];
1024  // Vertex shader outputs compact policy.
1026  // Tells whether shaders are created for passes with shaders
1028  // A flag to indicate finalizing
1030 private:
1031  friend class SGPass;
1032  friend class FFPRenderStateBuilder;
1034  friend class SGScriptTranslator;
1036 
1037 };
1038 
1042 }
1043 }
1044 
1045 #endif
1046 
Shader generator RenderObjectListener sub class.
std::pair< SGScheme *, bool > SchemeCreateOrRetrieveResult
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:82
Provides methods to find out where the Ogre config files are stored and where logs and settings files...
SGMaterialMap::iterator SGMaterialIterator
map< MatGroupPair, SGMaterial *, MatGroupPair_less >::type SGMaterialMap
vector< SGPass * >::type SGPassList
The ScriptTranslatorManager manages the lifetime and access to script translators.
Shader generator ScriptTranslatorManager sub class.
SGScriptTranslatorMap::iterator SGScriptTranslatorIterator
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.
void setBuildDestinationTechnique(bool buildTechnique)
Tells the technique that it needs to generate shader code.
virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
Event raised after all shadow textures have been rendered into for all queues / targets but before an...
vector< RenderState * >::type RenderStateList
SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator
void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy)
Set the vertex shader outputs compaction policy.
bool getCreateShaderOverProgrammablePass() const
Returns whether shaders are created for passes with shaders.
map< String, ScriptTranslator * >::type SGScriptTranslatorMap
ProgramWriterManager * mProgramWriterManager
SGScriptTranslatorMap mScriptTranslatorsMap
FogMode
Fog modes.
Definition: OgreCommon.h:152
bool operator()(const MatGroupPair &p1, const MatGroupPair &p2) const
Abstract interface which classes must implement if they wish to receive events from the scene manager...
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
virtual void preFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Listener overridden function notify the shader generator when finding visible objects process started...
SGSchemeMap::const_iterator SGSchemeConstIterator
SceneManagerMap::const_iterator SceneManagerConstIterator
Pass * getDstPass()
Get destination pass.
SGScriptTranslatorManager * mScriptTranslatorManager
bool getBuildDestinationTechnique() const
Tells if the destination technique should be build.
VSOutputCompactPolicy mVSOutputCompactPolicy
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Definition: OgreFrustum.h:84
Shader generator pass wrapper class.
SGTechniqueMap::iterator SGTechniqueMapIterator
Manages the organisation and rendering of a 'scene' i.e.
Technique * getSourceTechnique()
Get the source technique.
FFPRenderStateBuilder * mFFPRenderStateBuilder
static String AUTODETECT_RESOURCE_GROUP_NAME
Special resource group name which causes resource group to be automatically determined based on searc...
SGTechniqueList::const_iterator SGTechniqueConstIterator
std::pair< RenderState *, bool > RenderStateCreateOrRetrieveResult
const String & getShaderCachePath() const
Get the output shader cache path.
SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator
SGMaterial(const String &materialName, const String &groupName)
Class constructor.
SceneManagerMap::iterator SceneManagerIterator
IlluminationRenderStage
Describes the stage of rendering when performing complex illumination.
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:50
std::pair< String, String > MatGroupPair
Class that allows listening in on the various stages of SceneManager processing, so that custom behav...
#define _OgreRTSSExport
SGPassList::const_iterator SGPassConstIterator
This class responsible for translating core features of the RT Shader System for Ogre material script...
Shader generator technique wrapper class.
SubRenderStateFactoryMap mSubRenderStateFactories
SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator
const String & getDestinationTechniqueSchemeName() const
Get the destination technique scheme name.
SGSceneManagerListener * mSceneManagerListener
virtual size_t getNumTranslators() const
Returns the number of translators being managed.
SGRenderObjectListener * mRenderObjectListener
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:78
Abstract class defining the interface all renderable objects must implement.
This class translates script AST (abstract syntax tree) into Ogre resources.
void setCustomRenderState(RenderState *customRenderState)
Set the custom render state of this pass.
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:70
Class for serializing Materials to / from a .material script.
Abstract factory interface for creating SubRenderState implementation instances.
This abstract node represents a script property.
This is the target render state.
map< String, SGScheme * >::type SGSchemeMap
This is a container class for sub render state class.
Shader generator system main interface.
virtual ScriptTranslator * getTranslator(const AbstractNodePtr &node)
Returns a manager for the given object abstract node, or null if it is not supported.
Shader generator scene manager sub class.
bool IsHlsl4() const
Return if hlsl 4.0 shading language is currently in use.
RenderState * getCustomRenderState()
Get custom render state of this pass.
This class responsible for translating core features of the RT Shader System for Ogre material script...
SGSchemeMap::iterator SGSchemeIterator
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void postFindVisibleObjects(SceneManager *source, SceneManager::IlluminationRenderStage irs, Viewport *v)
Called after searching for visible objects in this SceneManager.
Shader generator material wrapper class.
map< String, SceneManager * >::type SceneManagerMap
vector< String >::type StringVector
const StringVector & getVertexShaderProfilesList() const
Get the output vertex shader target profiles as list of strings.
const String & getTargetLanguage() const
Return the target shader language currently in use.
SGTechniqueList & getTechniqueList()
Get the techniques list of this material.
VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const
Get the vertex shader outputs compaction policy.
const String & getFragmentShaderProfiles() const
Get the output fragment shader target profiles.
map< SGTechnique *, SGTechnique * >::type SGTechniqueMap
const String & getVertexShaderProfiles() const
Get the output vertex shader target profiles.
virtual void shadowTextureCasterPreViewProj(Light *light, Camera *camera, size_t iteration)
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:56
This class is the base interface of sub part from a shader based rendering pipeline.
const SGTechniqueList & getTechniqueList() const
Get the const techniques list of this material.
static String UserKey
Key name for associating with a Pass instance.
map< String, SubRenderStateFactory * >::type SubRenderStateFactoryMap
Technique * getDestinationTechnique()
Get the destination technique.
Reference-counted shared pointer, used for objects where implicit destruction is required.
virtual void shadowTextureReceiverPreViewProj(Light *light, Frustum *frustum)
_StringBase String
Definition: OgreCommon.h:53
This is the main class for the compiler.
vector< SGTechnique * >::type SGTechniqueList
void setCreateShaderOverProgrammablePass(bool value)
Sets whether shaders are created for passes with shaders.
const String & getGroupName() const
Get the group name.
float getTargetLanguageVersion() const
Return the target shader language version currently in use.
SGMaterialMap::const_iterator SGMaterialConstIterator
SGMaterialSerializerListener * mMaterialSerializerListener
const String & getMaterialName() const
Get the material name.
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
SubRenderStateFactoryMap mSubRenderStateExFactories
bool empty() const
Return true if this scheme dose not contains any techniques.
A singleton manager class that manages shader based programs.
static String DEFAULT_SCHEME_NAME
Default material scheme of the shader generator.
SGTechniqueList::iterator SGTechniqueIterator
This utility class is used to hold the information used to generate the matrices and other informatio...
const SGMaterial * getParent() const
Get the parent SGMaterial.
const StringVector & getFragmentShaderProfilesList() const
Get the output fragment shader target profiles as list of strings.