Code: Select all
panel->getMaterial()->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_TEXTURE, myAlpha);
Code: Select all
panel->getMaterial()->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_MANUAL, Ogre::LBS_TEXTURE, myAlpha);
Code: Select all
Ogre::RTShader::ShaderGenerator::getSingleton().invalidateMaterial(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, panel->getMaterial()->getName());
That does seem to "fix" the problem, however it's way too slow to invalidate each frame. Is there any other solution? I am using the iOS template, which uses RTSS by default. I tried disabling it, but all I get is a blank white screen (no console errors/crashes), so I assume that some part of the code must rely on it...c6burns wrote:What's probably happening is that you are using RTSS and you are modifying the original technique, but RTSS has generated a new shader based technique which is the one being used. The easiest thing might be to invalidate the material every time you change the alpha (but easiest is often not best for performance). This is how you would go about it in your case:Code: Select all
Ogre::RTShader::ShaderGenerator::getSingleton().invalidateMaterial(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME, panel->getMaterial()->getName());
RTSS emulates the fixed function pipeline (FFP for short); as long as your materials don't use custom shaders; you're going to need it since GLES2 doesn't support the FFP, as it is a shader-only API.fd9_ wrote:Do you happen to know if RTSS is required for my application if I'm using GLES2? I am not really using it, and I'd rather not have it enabled... but it breaks my application when I tried to remove it (nothing except the viewport background color is displayed).