Page 1 of 1

Why isn't my transparency transparent?

Posted: Sat Aug 09, 2008 1:45 am
by CameroKid
Here's my code:

Code: Select all

	
anode->setMaterialFlag(video::EMF_LIGHTING, false);
    anode->setMaterialTexture( 0, driverA->getTexture("data\\a.png") ); 
	anode->getMaterial(0).MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
I have transparency information in a.png. Why is it drawing my green transparent color then?

Posted: Sat Aug 09, 2008 4:35 am
by pera
code looks good, maybe the problem is in the image?
what version of irrlicht you yousing?

Posted: Sat Aug 09, 2008 4:00 pm
by CameroKid
1.4

Posted: Mon Aug 11, 2008 3:54 pm
by jontan6
hello,

not sure if this will help. usually i load the object as .OBJ, do i dont need to apply the texture manually in code. then in code i just do this

mesh = smgr->getMesh("test.obj");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);

Posted: Mon Aug 11, 2008 3:58 pm
by JP
Yeah try seeing if node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); gives you any better results than editing the Material directly....

Posted: Mon Aug 11, 2008 11:55 pm
by vitek
You might have a look at the documentation for that material type. If that doesn't help, you might just post a link to a test png (and possibly a minimal sample app) so that others can see it first hand.

Travis