setMaterialType makes objects completely invisible

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
Guest

setMaterialType makes objects completely invisible

Post by Guest »

Hi everybody! Can someone help me with a little bit of a materials problem. I'm rendering a quad with a texture on what should be a transparent black background. In the Node constructor I make the following calls:

Code: Select all

	setMaterialTexture(0, mgr->getVideoDriver()->getTexture("data/tex.bmp"));
	//setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
	setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL );
Now, if I remove the setMaterialType calls it renders the nodes fine (albeit without transparent black), however if I make either of the calls to setMaterialType it stops drawing them. The nodes are still there, because my collision detection still works with them, they just aren't visible. Anyone have any ideas what/where the problem might be?
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

I had the same problem and I couldn't solve it. There is a difference if you use darker or brighter backgrounds. I think (but it is too long ago) with a darker background, you can see the object. on white background you can't. But in both ways it was not the kind of transparancy I expected. That is why I tried to write my own transparency function, where you can set the transparency value. but sorry, this function doesn't work either and I don't know what I did wrong, it is probably a render problem or something. And as nobody could help me with that I didn't find a solution yet.

:cry:
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

if youre using opengl emt_transparent_alpha_channel isnt implemented.
look >here< for possible solution.
Last edited by mm765 on Wed Aug 11, 2004 11:59 am, edited 1 time in total.
Guest

Post by Guest »

I thought I reaad on here somewhere that it was implemented now, but either way that's not the problem because neither paramater works. EMT_TRANSPARENT_ALPHA_CHANNEL was just the one I tried last before copying & pasting it. I can probably hack together my own transparency, it's more a case of not having to do so if it can be easily fixed by changing a paramater somewhere.
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

mm765 is right, it is not implemented for OPENGL yet but it is for Direct3D.

If you hack something together for your own transparancy and it actually works, I would really appreciate if you post the code here, because like I said I tried it too but can't get it to work right. May be you like to take a look at my post :

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=3195
mm765
Posts: 172
Joined: Fri May 28, 2004 10:12 am

Post by mm765 »

look at the post i pointed to in my other reply the "here" is a link :)
joy
Posts: 124
Joined: Tue Apr 27, 2004 9:15 am
Location: Germany

Post by joy »

for me a better solution in DirectX9 would help alot because that is what I am using :lol:
Post Reply