how to apply a mask?

luis

16-06-2008 20:32:00

Hello!
I want to apply a texture has a mask/guide and use alpha blending to control how much is it visible over the terrain.

I'm trying this with no results (I see nothing):

std::string lightMapFile = "./media/gbeditor/mask.png";
std::ifstream test( lightMapFile.c_str(), std::ios::in );
if( !test.fail() )
{
test.close();
MaterialPtr material( MaterialManager::getSingleton().getByName("ETTerrainMaterial") );
Pass *p = material->getTechnique(0)->createPass();
TextureUnitState * tu = p->createTextureUnitState( lightMapFile );
p->setSceneBlending( SBT_MODULATE );
p->getTextureUnitState(0)->setColourOperation( LBO_MODULATE );
}


any idea?
thanks.

luis

16-06-2008 22:59:11

:oops: oops i forget I'm using a decal ! I'll use the same code to apply the mask :)