|
Public Member Functions |
| MaterialSerializer () |
| default constructor
|
virtual | ~MaterialSerializer () |
| default destructor
|
void | queueForExport (const MaterialPtr &pMat, bool clearQueued=false, bool exportDefaults=false) |
| Queue an in-memory Material to the internal buffer for export.
|
void | exportQueued (const String &filename, const bool includeProgDef=false, const String &programFilename="") |
| Exports queued material(s) to a named material script file.
|
void | exportMaterial (const MaterialPtr &pMat, const String &filename, bool exportDefaults=false, const bool includeProgDef=false, const String &programFilename="") |
| Exports a single in-memory Material to the named material script file.
|
const String & | getQueuedAsString () const |
| Returns a string representing the parsed material(s).
|
void | clearQueue () |
| Clears the internal buffer.
|
void | parseScript (DataStreamPtr &stream, const String &groupName) |
| Parses a Material script file passed as a stream.
|
Protected Types |
typedef std::map< String,
ATTRIBUTE_PARSER > | AttribParserList |
| Keyword-mapped attribute parsers.
|
typedef std::multimap< TextureUnitState::TextureEffectType,
TextureUnitState::TextureEffect > | EffectMap |
Protected Member Functions |
bool | parseScriptLine (String &line) |
| internal method for parsing a material
|
bool | invokeParser (String &line, AttribParserList &parsers) |
| internal method for finding & invoking an attribute parser.
|
void | finishProgramDefinition (void) |
| Internal method for saving a program definition which has been built up.
|
void | writeMaterial (const MaterialPtr &pMat) |
void | writeTechnique (const Technique *pTech) |
void | writePass (const Pass *pPass) |
void | writeVertexProgramRef (const Pass *pPass) |
void | writeShadowCasterVertexProgramRef (const Pass *pPass) |
void | writeShadowReceiverVertexProgramRef (const Pass *pPass) |
void | writeShadowReceiverFragmentProgramRef (const Pass *pPass) |
void | writeFragmentProgramRef (const Pass *pPass) |
void | writeGpuProgramRef (const String &attrib, const GpuProgramPtr &program, const GpuProgramParametersSharedPtr ¶ms) |
void | writeGpuPrograms (void) |
void | writeGPUProgramParameters (const GpuProgramParametersSharedPtr ¶ms, GpuProgramParameters *defaultParams, const int level=4, const bool useMainBuffer=true) |
void | writeTextureUnit (const TextureUnitState *pTex) |
void | writeSceneBlendFactor (const SceneBlendFactor sbf_src, const SceneBlendFactor sbf_dest) |
void | writeSceneBlendFactor (const SceneBlendFactor sbf) |
void | writeCompareFunction (const CompareFunction cf) |
void | writeColourValue (const ColourValue &colour, bool writeAlpha=false) |
void | writeLayerBlendOperationEx (const LayerBlendOperationEx op) |
void | writeLayerBlendSource (const LayerBlendSource lbs) |
void | writeRotationEffect (const TextureUnitState::TextureEffect &effect, const TextureUnitState *pTex) |
void | writeTransformEffect (const TextureUnitState::TextureEffect &effect, const TextureUnitState *pTex) |
void | writeScrollEffect (const TextureUnitState::TextureEffect &effect, const TextureUnitState *pTex) |
void | writeEnvironmentMapEffect (const TextureUnitState::TextureEffect &effect, const TextureUnitState *pTex) |
String | convertFiltering (FilterOptions fo) |
Protected Attributes |
MaterialScriptContext | mScriptContext |
AttribParserList | mRootAttribParsers |
| Parsers for the root of the material script.
|
AttribParserList | mMaterialAttribParsers |
| Parsers for the material section of a script.
|
AttribParserList | mTechniqueAttribParsers |
| Parsers for the technique section of a script.
|
AttribParserList | mPassAttribParsers |
| Parsers for the pass section of a script.
|
AttribParserList | mTextureUnitAttribParsers |
| Parsers for the texture unit section of a script.
|
AttribParserList | mProgramRefAttribParsers |
| Parsers for the program reference section of a script.
|
AttribParserList | mProgramAttribParsers |
| Parsers for the program definition section of a script.
|
AttribParserList | mProgramDefaultParamAttribParsers |
| Parsers for the program definition section of a script.
|
Private Types |
typedef std::set< String > | GpuProgramDefinitionContainer |
typedef GpuProgramDefinitionContainer::iterator | GpuProgramDefIterator |
Private Member Functions |
void | beginSection (unsigned short level, const bool useMainBuffer=true) |
void | endSection (unsigned short level, const bool useMainBuffer=true) |
void | writeAttribute (unsigned short level, const String &att, const bool useMainBuffer=true) |
void | writeValue (const String &val, const bool useMainBuffer=true) |
void | writeComment (unsigned short level, const String &comment, const bool useMainBuffer=true) |
Private Attributes |
String | mBuffer |
String | mGpuProgramBuffer |
GpuProgramDefinitionContainer | mGpuProgramDefinitionContainer |
bool | mDefaults |