No alpha in RTTlayer [SOLVED]

marten

12-02-2011 21:44:41

Hello!
I've managed to get RTTLayers working but the texture or material is that the gui is rendered to doesn't seem to have any alpha. This results in the widgets not being semi-transparent and the area of the texture that has no is completely black. Can I turn this on? Is it somewhere in MyGUI or for the material the problem lies?


This is how I create the material:
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("textureName", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::Technique* technique = material->createTechnique();
technique->createPass();
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->createTextureUnitState("textureName");


Thanks!

Altren

13-02-2011 01:30:40

You also need scene_blend alpha_blend See Media/UnitTests/UnitTest_Layers/PanelMonitor.material for proper material.
If this won't help then try to set this RTT texture on StaticImage to see if problem in texture itself and it have no alpha.
image->setImageTexture("textureName");

marten

13-02-2011 17:46:02

Thanks, I added the source blend to the material creation and it works now!

material->getTechnique(0)->getPass(0)->setSceneBlending(SceneBlendType::SBT_TRANSPARENT_ALPHA);