SO3Engine
|
#include <SO3MaterialGenerator.h>
Public Types | |
typedef PERMUTATION_TYPE | Perm |
Bitfield used to signify a material permutations. | |
Public Member Functions | |
virtual | ~SMaterialGenerator () |
const Ogre::MaterialPtr & | GetMaterial (SGBuffer *gbuffer, PERMUTATION_CLASS permutation) |
unsigned int | GetDeferredMaterialNumber (SGBuffer *gbuffer) |
unsigned int | GetDeferredMaterialTemplateNumber (SGBuffer *gbuffer) |
unsigned int | GetDeferredVertexShaderNumber (SGBuffer *gbuffer) |
unsigned int | GetDeferredPixelShaderNumber (SGBuffer *gbuffer) |
void | ResetResources (SGBuffer *gbuffer) |
Protected Member Functions | |
SMaterialGenerator (const Ogre::String &typeName) | |
const Ogre::GpuProgramPtr & | GetVertexShader (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue) |
const Ogre::GpuProgramPtr & | GetFragmentShader (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue) |
const Ogre::MaterialPtr & | GetTemplateMaterial (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue) |
virtual Ogre::GpuProgramPtr | GenerateVertexShader (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0 |
virtual Ogre::GpuProgramPtr | GenerateFragmentShader (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0 |
virtual Ogre::MaterialPtr | GenerateTemplateMaterial (SGBuffer *gbuffer, PERMUTATION_TYPE permutationValue)=0 |
Protected Attributes | |
const Ogre::String | materialBaseName |
Base name of materials generated by this. | |
Detailed Description
class SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >
Caching, on-the-fly material generator. This is a class that automatically generates and stores different permutations of a material, and its shaders. It can be used if you have a material that has lots of slightly different variations, like whether to use a specular light, skinning, normal mapping and other options. Writing all these out is a tedious job. Of course it is possible to always use the material with all features, but that might result in large, slow shader programs. This class provides an efficient solution to that.
Definition at line 45 of file SO3MaterialGenerator.h.
Member Typedef Documentation
◆ Perm
typedef PERMUTATION_TYPE SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::Perm |
Bitfield used to signify a material permutations.
Definition at line 48 of file SO3MaterialGenerator.h.
Constructor & Destructor Documentation
◆ ~SMaterialGenerator()
|
virtual |
Definition at line 143 of file SO3MaterialGenerator.h.
◆ SMaterialGenerator()
|
protected |
The constructor is protected as this base class should never be constructed as-is. It is meant to be subclassed so that values can be assigned to the various fields controlling material generator.
Definition at line 134 of file SO3MaterialGenerator.h.
Member Function Documentation
◆ GenerateFragmentShader()
|
protectedpure virtual |
◆ GenerateTemplateMaterial()
|
protectedpure virtual |
◆ GenerateVertexShader()
|
protectedpure virtual |
◆ GetDeferredMaterialNumber()
unsigned int SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::GetDeferredMaterialNumber | ( | SGBuffer * | gbuffer | ) |
Definition at line 164 of file SO3MaterialGenerator.h.
◆ GetDeferredMaterialTemplateNumber()
unsigned int SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::GetDeferredMaterialTemplateNumber | ( | SGBuffer * | gbuffer | ) |
Definition at line 173 of file SO3MaterialGenerator.h.
◆ GetDeferredPixelShaderNumber()
unsigned int SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::GetDeferredPixelShaderNumber | ( | SGBuffer * | gbuffer | ) |
Function to get statistic on how many fragment shader resources where created by this deferred material generator.
Definition at line 191 of file SO3MaterialGenerator.h.
◆ GetDeferredVertexShaderNumber()
unsigned int SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::GetDeferredVertexShaderNumber | ( | SGBuffer * | gbuffer | ) |
Function to get statistic on how many vertex shader resources where created by this deferred material generator.
Definition at line 182 of file SO3MaterialGenerator.h.
◆ GetFragmentShader()
|
protected |
Definition at line 354 of file SO3MaterialGenerator.h.
◆ GetMaterial()
const Ogre::MaterialPtr & SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::GetMaterial | ( | SGBuffer * | gbuffer, |
PERMUTATION_CLASS | permutation | ||
) |
Get or create a material corresponding to the given permutation flags.
Definition at line 275 of file SO3MaterialGenerator.h.
◆ GetTemplateMaterial()
|
protected |
Definition at line 385 of file SO3MaterialGenerator.h.
◆ GetVertexShader()
|
protected |
Definition at line 323 of file SO3MaterialGenerator.h.
◆ ResetResources()
void SO3::SMaterialGenerator< PERMUTATION_CLASS, PERMUTATION_TYPE >::ResetResources | ( | SGBuffer * | gbuffer | ) |
Removes all the resources generated by this deferred material generator.
- Remarks
- : use with caution!
Definition at line 200 of file SO3MaterialGenerator.h.
Member Data Documentation
◆ materialBaseName
|
protected |
Base name of materials generated by this.
Definition at line 50 of file SO3MaterialGenerator.h.
The documentation for this class was generated from the following file:
- include/SO3Renderer/DeferredShading/SO3MaterialGenerator.h
Generated by 1.9.8