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.
CameroKid
Posts: 71 Joined: Tue Jul 11, 2006 8:54 pm
Post
by CameroKid » Sat Aug 09, 2008 1:45 am
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 » Sat Aug 09, 2008 4:35 am
code looks good, maybe the problem is in the image?
what version of irrlicht you yousing?
jontan6
Posts: 278 Joined: Fri Jun 13, 2008 5:29 pm
Post
by jontan6 » Mon Aug 11, 2008 3:54 pm
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 » Mon Aug 11, 2008 3:58 pm
Yeah try seeing if node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL); gives you any better results than editing the Material directly....
vitek
Bug Slayer
Posts: 3919 Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR
Post
by vitek » Mon Aug 11, 2008 11:55 pm
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