OGRE  1.9
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"
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 
405 
417  SGMaterialSerializerListener* getMaterialSerializerListener();
418 
419 
421  size_t getVertexShaderCount() const;
422 
423 
425  size_t getFragmentShaderCount() const;
426 
427 
428 
433  void setVertexShaderOutputsCompactPolicy(VSOutputCompactPolicy policy) { mVSOutputCompactPolicy = policy; }
434 
438  VSOutputCompactPolicy getVertexShaderOutputsCompactPolicy() const { return mVSOutputCompactPolicy; }
439 
440 
446  void setCreateShaderOverProgrammablePass(bool value) { mCreateShaderOverProgrammablePass = value; }
447 
451  bool getCreateShaderOverProgrammablePass() const { return mCreateShaderOverProgrammablePass; }
452 
453 
456  size_t getRTShaderSchemeCount() const;
457 
460  const String& getRTShaderScheme(size_t index) const;
461 
464 
465 // Protected types.
466 protected:
467  class SGPass;
468  class SGTechnique;
469  class SGMaterial;
470  class SGScheme;
471 
472  typedef std::pair<String,String> MatGroupPair;
474  {
475  // ensure we arrange the list first by material name then by group name
476  bool operator()(const MatGroupPair& p1, const MatGroupPair& p2) const
477  {
478  int cmpVal = strcmp(p1.first.c_str(),p2.first.c_str());
479  return (cmpVal < 0) || ((cmpVal == 0) && (strcmp(p1.second.c_str(),p2.second.c_str()) < 0));
480  }
481  };
482 
484  typedef SGPassList::iterator SGPassIterator;
485  typedef SGPassList::const_iterator SGPassConstIterator;
486 
488  typedef SGTechniqueList::iterator SGTechniqueIterator;
489  typedef SGTechniqueList::const_iterator SGTechniqueConstIterator;
490 
492  typedef SGTechniqueMap::iterator SGTechniqueMapIterator;
493 
495  typedef SGMaterialMap::iterator SGMaterialIterator;
496  typedef SGMaterialMap::const_iterator SGMaterialConstIterator;
497 
499  typedef SGSchemeMap::iterator SGSchemeIterator;
500  typedef SGSchemeMap::const_iterator SGSchemeConstIterator;
501 
503  typedef SGScriptTranslatorMap::iterator SGScriptTranslatorIterator;
504  typedef SGScriptTranslatorMap::const_iterator SGScriptTranslatorConstIterator;
505 
506 
507 
510  {
511  public:
512  SGPass(SGTechnique* parent, Pass* srcPass, Pass* dstPass);
513  ~SGPass();
514 
516  void buildTargetRenderState();
517 
519  void acquirePrograms();
520 
522  void releasePrograms();
523 
524 
526  void notifyRenderSingleObject(Renderable* rend, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
527 
529  Pass* getSrcPass() { return mSrcPass; }
530 
532  Pass* getDstPass() { return mDstPass; }
533 
535  SubRenderState* getCustomFFPSubState(int subStateOrder);
536 
538  RenderState* getCustomRenderState() { return mCustomRenderState; }
539 
541  void setCustomRenderState(RenderState* customRenderState) { mCustomRenderState = customRenderState; }
542 
543  // Key name for associating with a Pass instance.
544  static String UserKey;
545 
546  protected:
547  SubRenderState* getCustomFFPSubState(int subStateOrder, const RenderState* renderState);
548 
549  protected:
550  // Parent technique.
552  // Source pass.
554  // Destination pass.
556  // Custom render state.
558  // The compiled render state.
560  };
561 
562 
565  {
566  public:
567  SGTechnique(SGMaterial* parent, Technique* srcTechnique, const String& dstTechniqueSchemeName);
568  ~SGTechnique();
569 
571  const SGMaterial* getParent() const { return mParent; }
572 
574  Technique* getSourceTechnique() { return mSrcTechnique; }
575 
577  Technique* getDestinationTechnique() { return mDstTechnique; }
578 
580  const String& getDestinationTechniqueSchemeName() const { return mDstTechniqueSchemeName; }
581 
583  void buildTargetRenderState();
584 
586  void acquirePrograms();
587 
589  void releasePrograms();
590 
592  void setBuildDestinationTechnique(bool buildTechnique) { mBuildDstTechnique = buildTechnique; }
593 
595  bool getBuildDestinationTechnique() const { return mBuildDstTechnique; }
596 
600  RenderState* getRenderState(unsigned short passIndex);
602  bool hasRenderState(unsigned short passIndex);
603 
604  // Key name for associating with a Technique instance.
605  static String UserKey;
606 
607  protected:
608 
610  void createSGPasses();
611 
613  void destroySGPasses();
614 
615  protected:
616  // Parent material.
618  // Source technique.
620  // Destination technique.
622  // All passes entries.
624  // The custom render states of all passes.
626  // Flag that tells if destination technique should be build.
628  // Scheme name of destination technique.
630  };
631 
632 
635  {
636 
637  public:
639  SGMaterial(const String& materialName, const String& groupName) : mName(materialName), mGroup(groupName)
640  {
641 
642  }
643 
645  const String& getMaterialName() const { return mName; }
646 
648  const String& getGroupName() const { return mGroup; }
649 
651  const SGTechniqueList& getTechniqueList() const { return mTechniqueEntries; }
652 
654  SGTechniqueList& getTechniqueList() { return mTechniqueEntries; }
655 
656  protected:
657  // The material name.
659  // The group name.
661  // All passes entries.
663  };
664 
665 
668  {
669  public:
670  SGScheme(const String& schemeName);
671  ~SGScheme();
672 
673 
676  bool empty() const { return mTechniqueEntries.empty(); }
677 
681  void invalidate();
682 
686  void validate();
687 
691  void invalidate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
692 
696  bool validate(const String& materialName, const String& groupName = ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
697 
699  void addTechniqueEntry(SGTechnique* techEntry);
700 
702  void removeTechniqueEntry(SGTechnique* techEntry);
703 
704 
708  RenderState* getRenderState();
709 
713  RenderState* getRenderState(const String& materialName, const String& groupName, unsigned short passIndex);
714 
715  protected:
717  void synchronizeWithLightSettings();
718 
720  void synchronizeWithFogSettings();
721 
722 
723  protected:
724  // Scheme name.
726  // Technique entries.
728  // Tells if this scheme is out of date.
730  // The global render state of this scheme.
732  // Current fog mode.
734  };
735 
736 
737 // Protected types.
738 protected:
739 
742  {
743  public:
745  {
746  mOwner = owner;
747  }
748 
752  virtual void notifyRenderSingleObject(Renderable* rend, const Pass* pass,
753  const AutoParamDataSource* source,
754  const LightList* pLightList, bool suppressRenderStateChanges)
755  {
756  mOwner->notifyRenderSingleObject(rend, pass, source, pLightList, suppressRenderStateChanges);
757  }
758 
759  protected:
761  };
762 
765  {
766  public:
768  {
769  mOwner = owner;
770  }
771 
775  virtual void preFindVisibleObjects(SceneManager* source,
777  {
778  mOwner->preFindVisibleObjects(source, irs, v);
779  }
780 
781  virtual void postFindVisibleObjects(SceneManager* source,
783  {
784 
785  }
786 
787  virtual void shadowTexturesUpdated(size_t numberOfShadowTextures)
788  {
789 
790  }
791 
792  virtual void shadowTextureCasterPreViewProj(Light* light,
793  Camera* camera, size_t iteration)
794  {
795 
796  }
797 
799  Frustum* frustum)
800  {
801 
802  }
803 
804  protected:
805  // The shader generator instance.
807  };
808 
811  {
812  public:
814  {
815  mOwner = owner;
816  }
817 
819  virtual size_t getNumTranslators() const
820  {
821  return mOwner->getNumTranslators();
822  }
823 
826  {
827  return mOwner->getTranslator(node);
828  }
829 
830  protected:
831  // The shader generator instance.
833  };
834 
835  //-----------------------------------------------------------------------------
837  typedef SubRenderStateFactoryMap::iterator SubRenderStateFactoryIterator;
838  typedef SubRenderStateFactoryMap::const_iterator SubRenderStateFactoryConstIterator;
839 
840  //-----------------------------------------------------------------------------
842  typedef SceneManagerMap::iterator SceneManagerIterator;
843  typedef SceneManagerMap::const_iterator SceneManagerConstIterator;
844 
845 protected:
847  ShaderGenerator();
848 
850  ~ShaderGenerator();
851 
853  bool _initialize();
854 
856  void _destroy();
857 
859  Technique* findSourceTechnique(const String& materialName, const String& groupName, const String& srcTechniqueSchemeName, bool allowProgrammable);
860 
862  bool isProgrammable(Technique* tech) const;
863 
865  void notifyRenderSingleObject(Renderable* rend, const Pass* pass, const AutoParamDataSource* source, const LightList* pLightList, bool suppressRenderStateChanges);
866 
868  void preFindVisibleObjects(SceneManager* source, SceneManager::IlluminationRenderStage irs, Viewport* v);
869 
871  void createSubRenderStateExFactories();
872 
874  void destroySubRenderStateExFactories();
875 
884  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, Pass* pass, SGScriptTranslator* translator);
885 
894  SubRenderState* createSubRenderState(ScriptCompiler* compiler, PropertyAbstractNode* prop, TextureUnitState* texState, SGScriptTranslator* translator);
895 
902  bool addCustomScriptTranslator(const String& key, ScriptTranslator* translator);
903 
909  bool removeCustomScriptTranslator(const String& key);
910 
912  size_t getNumTranslators() const;
913 
915  ScriptTranslator* getTranslator(const AbstractNodePtr& node);
916 
917 
923  void serializePassAttributes(MaterialSerializer* ser, SGPass* passEntry);
924 
931  void serializeTextureUnitStateAttributes(MaterialSerializer* ser, SGPass* passEntry, const TextureUnitState* srcTextureUnit);
932 
937  SGMaterialIterator findMaterialEntryIt(const String& materialName, const String& groupName);
938  SGMaterialConstIterator findMaterialEntryIt(const String& materialName, const String& groupName) const;
939 
940 
941  typedef std::pair<SGScheme*, bool> SchemeCreateOrRetrieveResult;
946  SchemeCreateOrRetrieveResult createOrRetrieveScheme(const String& schemeName);
947 
949  bool getIsFinalizing() const;
950 protected:
951  // Auto mutex.
953  // The active scene manager.
955  // A map of all scene managers this generator is bound to.
957  // Render object listener.
959  // Scene manager listener.
961  // Script translator manager.
963  // Custom material Serializer listener - allows exporting material that contains shader generated techniques.
965  // A map of the registered custom script translators.
967  // The core translator of the RT Shader System.
969  // The target shader language (currently only cg supported).
971  // The target vertex shader profile. Will be used as argument for program compilation.
973  // List of target vertex shader profiles.
975  // The target fragment shader profile. Will be used as argument for program compilation.
977  // List of target fragment shader profiles..
979  // Path for caching the generated shaders.
981  // Shader program manager.
983  // Shader program writer manager.
985  // File system layer manager.
987  // Fixed Function Render state builder.
988  FFPRenderStateBuilder* mFFPRenderStateBuilder;
989  // Material entries map.
991  // Scheme entries map.
993  // All technique entries map.
995  // Sub render state registered factories.
997  // Sub render state core extension factories.
999  // True if active view port use a valid SGScheme.
1001  // Light count per light type.
1002  int mLightCount[3];
1003  // Vertex shader outputs compact policy.
1005  // Tells whether shaders are created for passes with shaders
1007  // a flag to indicate finalizing
1009 private:
1010  friend class SGPass;
1011  friend class FFPRenderStateBuilder;
1013  friend class SGScriptTranslator;
1015 
1016 };
1017 
1021 }
1022 }
1023 
1024 #endif
1025 
Shader generator RenderObjectListener sub class.
std::pair< SGScheme *, bool > SchemeCreateOrRetrieveResult
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
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:121
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:85
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:53
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:80
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:73
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.
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)
This event occurs just before the view & projection matrices are set for rendering into a shadow text...
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
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.
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)
This event occurs just before the view & projection matrices are set for re-rendering a shadow receiv...
_StringBase String
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.
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.