I haven't implemented this yet, as far a I can see setRGBAWriteMask() would have to be added to Ogre::Technique and Ogre::Pass and to all available Rendersystem plugins.
Ogre::MaterialSerializer (with backward material compatibility)
Code: Select all
bool parseColourWrite(String& params, MaterialScriptContext& context)
{
StringVector vecparams = StringUtil::split(params, " \t");
// Must be 1 or 4 parameters
if (vecparams.size() == 1) {
if (vecparams[0] == "on")
context.pass->setColourWriteEnabled(true);
else if (vecparams[0] == "off")
context.pass->setColourWriteEnabled(false);
else
logParseError(
"Bad colour_write attribute, valid single parameters are 'on' or 'off'.",
context);
}
else if (vecparams.size() == 4)
{
bool red = false;
bool green = false;
bool blue = false;
bool alpha = false;
if (vecparams[0] == "on")
red = true;
if (vecparams[1] == "on")
green = true;
if (vecparams[2] == "on")
blue = true;
if (vecparams[3] == "on")
alpha = true;
context.pass->setRGBAWriteMask(red, green, blue, alpha);
}
else
{
logParseError(
"Bad colour_write attribute, wrong number of parameters (expected 1 or 4)",
context);
} return false;
}