Why isn't my transparency transparent?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Why isn't my transparency transparent?

Post 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?
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

code looks good, maybe the problem is in the image?
what version of irrlicht you yousing?
CameroKid
Posts: 71
Joined: Tue Jul 11, 2006 8:54 pm

Post by CameroKid »

1.4
jontan6
Posts: 278
Joined: Fri Jun 13, 2008 5:29 pm

Post 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);
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Yeah try seeing if node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); gives you any better results than editing the Material directly....
Image Image Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
Post Reply