Confused about EMT_TRANSPARENT_ALPHA_CHANNEL
Confused about EMT_TRANSPARENT_ALPHA_CHANNEL
Hey
If I want to put an alpha mask on a model, say a tree, for the leaves. Do I use EMT_TRANSPARENT_ALPHA_CHANNEL? I have tried this but it didn't work.
If not then what should I use?
Just another question, what is the difference between EMT_TRANSPARENT_ALPHA_CHANNEL and EMT_TRANSPARENT_VERTEX_ALPHA?
Thanks
If I want to put an alpha mask on a model, say a tree, for the leaves. Do I use EMT_TRANSPARENT_ALPHA_CHANNEL? I have tried this but it didn't work.
If not then what should I use?
Just another question, what is the difference between EMT_TRANSPARENT_ALPHA_CHANNEL and EMT_TRANSPARENT_VERTEX_ALPHA?
Thanks
Code: Select all
video::ITexture* treeTexture = driver->getTexture(filename);
driver->makeColorKeyTexture(treeTexture, core::position2d<irr::s32>(0,0)); //change texture coordinates to choose diferent pixel
node->getMaterial(0).Texture1 = treeTexture;
node->getMaterial(0).BackfaceCulling = false; //will make all polygoons to be doublesided
node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
Yeah. I tried it and it didn't work. It seems as though it didn't even take the pixel thing into account. If I use the TRANSPARENT_ALPHA flag it takes the extra bits away but it also makes the whole model transparent/ which I don't want. It did the same thing regardless of whether I applied the pixel co-ordinate method or not.
Is there anything else I could try?
Is there anything else I could try?
that's strange, it works perfectly for me...
try this bug fixes (I think its for Irrlicht v.0.6):
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2977
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3130
try this bug fixes (I think its for Irrlicht v.0.6):
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2977
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3130
I dont remember anymore if I was applying that bug fixes. But it doesn't have nothing to do with object transparency.
look also here for some ideas:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2679
look also here for some ideas:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=2679
Well I eventually got it to work. It was because I was using OpenGL. I'm got a bit of a saga now because DX9 or DX8 looks bad but the Alphs works. Anyway..
There is still a bit of an issue with it though. It's making the (0,0) pixel co-oord which is black, transparent, but if I look at another model through the transparent parts it's like it's taken those pixels away but hasn't drawn whats behind it. It's quite odd because when I first load it in, I have a sky box, and it seems to be taking the color of the skybox for it's transparency.
Is there any way to fix this?
There is still a bit of an issue with it though. It's making the (0,0) pixel co-oord which is black, transparent, but if I look at another model through the transparent parts it's like it's taken those pixels away but hasn't drawn whats behind it. It's quite odd because when I first load it in, I have a sky box, and it seems to be taking the color of the skybox for it's transparency.
Is there any way to fix this?
Hi guys, i also have a problem with my transparency:
I know my .tga file is ok, (it laods fine in giles[s], with alpha channel). The code is:
IAnimatedMesh* follaje1 = smgr->getMesh("mediaf/afolla.obj");
IAnimatedMeshSceneNode* node4 = smgr->addAnimatedMeshSceneNode(follaje1);
node4 -> setMaterialFlag(EMF_LIGHTING, false);
node4 -> setMaterialTexture(0, driver->getTexture("mediaf/u34.tga"));
node4 -> setMaterialType (EMT_TRANSPARENT_ALPHA_CHANNEL);
I've read:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6116
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6104
http://irrlicht.sourceforge.net/phpBB2/ ... ik&start=0
but haven't yet found a fix.
I'm using dev-cpp with irrlicht .9, OpenGL (so no possibility to try with Direct X, as i haven't yet been able to compile a new .dll)
Please let me know if there is a fix.
I know my .tga file is ok, (it laods fine in giles[s], with alpha channel). The code is:
IAnimatedMesh* follaje1 = smgr->getMesh("mediaf/afolla.obj");
IAnimatedMeshSceneNode* node4 = smgr->addAnimatedMeshSceneNode(follaje1);
node4 -> setMaterialFlag(EMF_LIGHTING, false);
node4 -> setMaterialTexture(0, driver->getTexture("mediaf/u34.tga"));
node4 -> setMaterialType (EMT_TRANSPARENT_ALPHA_CHANNEL);
I've read:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6116
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=6104
http://irrlicht.sourceforge.net/phpBB2/ ... ik&start=0
but haven't yet found a fix.
I'm using dev-cpp with irrlicht .9, OpenGL (so no possibility to try with Direct X, as i haven't yet been able to compile a new .dll)
Please let me know if there is a fix.