Caching, on-the-fly material generator. More...
#include <MaterialGenerator.hh>
Classes | |
class | Impl |
Implementation class that takes care of actual generation or lookup of the various constituent parts (template material, fragment shader and vertex shader). More... | |
Public Types | |
typedef uint32_t | Perm |
Bitfield used to signify a material permutations. More... | |
Public Member Functions | |
virtual | ~MaterialGenerator () |
const Ogre::MaterialPtr & | GetMaterial (Perm permutation) |
Protected Types | |
typedef std::map< Perm, Ogre::MaterialPtr > | MaterialMap |
typedef std::map< Perm, Ogre::GpuProgramPtr > | ProgramMap |
Protected Member Functions | |
MaterialGenerator () | |
constructor is protected as this base class should never be constructed as-is. More... | |
const Ogre::GpuProgramPtr & | GetFragmentShader (Perm _perm) |
const Ogre::MaterialPtr & | GetTemplateMaterial (Perm _perm) |
const Ogre::GpuProgramPtr & | GetVertexShader (Perm _perm) |
Protected Attributes | |
ProgramMap | fs |
Perm | fsMask |
Mask of permutation bits that influence fragment shader choice. More... | |
Impl * | impl |
Generator. More... | |
Ogre::String | materialBaseName |
Base name of materials generated by this. More... | |
MaterialMap | materials |
Perm | matMask |
Mask of permutation bits that influence template material choice. More... | |
std::string | schemeName |
MaterialMap | templateMat |
ProgramMap | vs |
Perm | vsMask |
Mask of permutation bits that influence vertex shader choice. More... | |
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.
|
protected |
typedef uint32_t gazebo::rendering::MaterialGenerator::Perm |
Bitfield used to signify a material permutations.
|
protected |
|
protected |
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, and most importantly, the mImpl field.
|
virtual |
|
protected |
const Ogre::MaterialPtr& gazebo::rendering::MaterialGenerator::GetMaterial | ( | Perm | permutation | ) |
|
protected |
|
protected |
|
protected |
|
protected |
Mask of permutation bits that influence fragment shader choice.
|
protected |
Generator.
|
protected |
Base name of materials generated by this.
|
protected |
|
protected |
Mask of permutation bits that influence template material choice.
|
protected |
|
protected |
|
protected |
|
protected |
Mask of permutation bits that influence vertex shader choice.