SO3Engine
|
SO3MaterialGenerator.h
Go to the documentation of this file.
53 typedef typename Ogre::map<SGBuffer*, typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap*>::type ProgramMap;
55 typedef typename Ogre::map<SGBuffer*, typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap*>::type MaterialMap;
72 Function to get statistic on how many materials (instances) resources where created by this deferred material generator.
77 Function to get statistic on how many materials (templates) resources where created by this deferred material generator.
106 const Ogre::GpuProgramPtr& GetVertexShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue);
110 const Ogre::GpuProgramPtr& GetFragmentShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue);
114 const Ogre::MaterialPtr& GetTemplateMaterial(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue);
118 virtual Ogre::GpuProgramPtr GenerateVertexShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue) = 0;
122 virtual Ogre::GpuProgramPtr GenerateFragmentShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue) = 0;
126 virtual Ogre::MaterialPtr GenerateTemplateMaterial(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue) = 0;
134template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::SMaterialGenerator(const Ogre::String& typeName) : materialBaseName(Ogre::String("SO3/Deferred/") + typeName)
138template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::SMaterialGenerator() : materialBaseName("")
143template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::~SMaterialGenerator()
147 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator iTemplateMaterials = templateMaterials.begin();
164template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> unsigned int SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetDeferredMaterialNumber(SGBuffer* gbuffer)
166 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator i = materials.find(gbuffer);
173template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> unsigned int SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetDeferredMaterialTemplateNumber(SGBuffer* gbuffer)
175 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator i = templateMaterials.find(gbuffer);
182template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> unsigned int SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetDeferredVertexShaderNumber(SGBuffer* gbuffer)
184 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator i = mVs.find(gbuffer);
191template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> unsigned int SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetDeferredPixelShaderNumber(SGBuffer* gbuffer)
193 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator i = mFs.find(gbuffer);
200template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> void SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ResetResources(SGBuffer* gbuffer)
204 Ogre::HighLevelGpuProgramManager* programManager = Ogre::HighLevelGpuProgramManager::getSingletonPtr();
207 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator iTemplateMaterials = templateMaterials.find(gbuffer);
210 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap* materialPermMap = iTemplateMaterials->second;
211 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::iterator iTemplatePermutations = materialPermMap->begin();
218 // Erase from our list, this will erase the last reference to MaterialPtr, and will effectively destroy it.
224 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator iMaterials = materials.find(gbuffer);
227 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap* materialPermMap = iMaterials->second;
228 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::iterator iPermutations = materialPermMap->begin();
235 // Erase from our list, this will erase the last reference to MaterialPtr, and will effectively destroy it.
241 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator iVertex = mVs.find(gbuffer);
244 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap* vertexPermMap = iVertex->second;
245 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::iterator iPermutations = vertexPermMap->begin();
252 // Erase from our list, this will erase the last reference to MaterialPtr, and will effectively destroy it.
258 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator iFragment = mFs.find(gbuffer);
261 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap* fragmentPermMap = iFragment->second;
262 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::iterator iPermutations = fragmentPermMap->begin();
275template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> const Ogre::MaterialPtr& SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetMaterial(SGBuffer* gbuffer, PERMUTATION_CLASS permutation)
278 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap* materialPermMap = 0;
279 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator i = materials.find(gbuffer);
283 materialPermMap = new SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap();
293 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::iterator j = materialPermMap->find(permutationValue);
317 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::value_type val(permutationValue, mat);
323template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> const Ogre::GpuProgramPtr& SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetVertexShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue)
326 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap* programPermMap = 0;
327 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator i = mVs.find(gbuffer);
339 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::iterator j = programPermMap->find(permutationValue);
348 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::value_type val(permutationValue, progptr);
354template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> const Ogre::GpuProgramPtr& SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetFragmentShader(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue)
357 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap* programPermMap = 0;
358 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramMap::iterator i = mFs.find(gbuffer);
370 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::iterator j = programPermMap->find(permutationValue);
379 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::ProgramPermMap::value_type val(permutationValue, progptr);
385template <class PERMUTATION_CLASS, typename PERMUTATION_TYPE> const Ogre::MaterialPtr& SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::GetTemplateMaterial(SGBuffer* gbuffer, PERMUTATION_TYPE permutationValue)
388 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap* materialPermMap = 0;
389 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialMap::iterator i = templateMaterials.find(gbuffer);
393 materialPermMap = new SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap();
401 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::iterator j = materialPermMap->find(permutationValue);
410 typename SMaterialGenerator<PERMUTATION_CLASS, PERMUTATION_TYPE>::MaterialPermMap::value_type val(permutationValue, matptr);
librairies include
Definition SO3GBuffer.h:37
SMaterialGenerator(const Ogre::String &typeName)
Definition SO3MaterialGenerator.h:134
const Ogre::MaterialPtr & GetTemplateMaterial(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)
Definition SO3MaterialGenerator.h:385
unsigned int GetDeferredMaterialNumber(SGBuffer *gbuffer)
Definition SO3MaterialGenerator.h:164
virtual Ogre::MaterialPtr GenerateTemplateMaterial(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0
unsigned int GetDeferredMaterialTemplateNumber(SGBuffer *gbuffer)
Definition SO3MaterialGenerator.h:173
const Ogre::GpuProgramPtr & GetFragmentShader(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)
Definition SO3MaterialGenerator.h:354
virtual ~SMaterialGenerator()
Definition SO3MaterialGenerator.h:143
const Ogre::MaterialPtr & GetMaterial(SGBuffer *gbuffer, PERMUTATION_CLASS permutation)
Definition SO3MaterialGenerator.h:275
void ResetResources(SGBuffer *gbuffer)
Definition SO3MaterialGenerator.h:200
const Ogre::String materialBaseName
Base name of materials generated by this.
Definition SO3MaterialGenerator.h:50
virtual Ogre::GpuProgramPtr GenerateVertexShader(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0
unsigned int GetDeferredVertexShaderNumber(SGBuffer *gbuffer)
Definition SO3MaterialGenerator.h:182
PERMUTATION_TYPE Perm
Bitfield used to signify a material permutations.
Definition SO3MaterialGenerator.h:48
virtual Ogre::GpuProgramPtr GenerateFragmentShader(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0
const Ogre::GpuProgramPtr & GetVertexShader(SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)
Definition SO3MaterialGenerator.h:323
unsigned int GetDeferredPixelShaderNumber(SGBuffer *gbuffer)
Definition SO3MaterialGenerator.h:191
Definition OgreNewt_Debugger.h:21
Definition SO3DataScol.h:38
Generated by 1.9.8