Page 1 of 1

Layered Textures

Posted: Mon Jul 09, 2007 8:29 pm
by Dukdalf
Hi guys,

I require many different cubes, and I thought that using layers of transparant textures would prevent me to make many different textures.

But i seem to not be able to use textures over each other. I do use different layers, but only the 0th layer displays.

Code: Select all

player->setMaterialFlag(EMF_LIGHTING, false);
player->setPosition(core::vector3df(pos,151.f,pos));
player->setScale(core::vector3df(-150.f,150.f,150.f));
player->setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL);
player->setMaterialTexture( 2, driver->getTexture("media/teamdarkred.png") );	//background
player->setMaterialTexture( 1, driver->getTexture("media/blueedge.png") );		//edge color
player->setMaterialTexture( 0, driver->getTexture("media/number1.png") );		//number
Thanks in advance!

Posted: Mon Jul 09, 2007 9:05 pm
by vitek
The EMT_TRANSPARENT_ALPHA_CHANNEL material only uses the first material texture. You need to use or make a material type that supports multiple texture layers and transparency.

Travis

Posted: Tue Jul 10, 2007 7:34 am
by Dukdalf
hmm, that is way out of my league at this moment!

so that will have to wait untill I am more used to C++ and irrlicht!

THanks anyways.

Posted: Tue Jul 10, 2007 9:18 am
by arras
I am using Irrlicht for seweral years now and I would be realy happy if I could be able to do what you try to do in your code. That is blending few textures on mesh. To accomplish what you want, appart from C++ and Irrlicht you would need knoweledge of shaders and DirectX or OpenGL.

There are seweral material types already in Irrlicht but none works with more than 2 textures so far.

Look at E_MATERIAL_TYPE enumeration in API, there are all materials and desciptions of what they do.

Posted: Tue Jul 10, 2007 9:44 am
by Dukdalf
Thanks for the info,

I will skip this solution then.