transparency problem

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
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

transparency problem

Post by Chet »

I know I had this working - maybe back when using 1.5.1, not sure when it changed because I was working on other things. The windows and other objects with have transparent parts are a separate model and for some reason now some of the parts that are not supposed to be transparent come up that way (I lose the frames on the windows).
So far I have tried using all the transparency setting listed in the documentation
  • # EMT_TRANSPARENT_ADD_COLOR : irr::video
    # EMT_TRANSPARENT_ALPHA_CHANNEL : irr::video
    # EMT_TRANSPARENT_ALPHA_CHANNEL_REF : irr::video
    # EMT_TRANSPARENT_REFLECTION_2_LAYER : irr::video
    # EMT_TRANSPARENT_VERTEX_ALPHA : irr::video
I tried different versions of the transparent texture (jpg/png)
Depending on the combination I get either nothing transparent or everything transparent. (the vertex alpha messes up the models).

Code: Select all

scene::ISceneNode * window = smgr->addMeshSceneNode(smgr->getMesh(path+"/towers1win.x"));
                          window->setPosition(core::vector3df(512,26.2,575));
             window->setRotation(core::vector3df(0,90,0));
             window->setMaterialFlag(video::EMF_LIGHTING, true);
window->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR); 
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

A jpg texture is not transparent at all - except for the addColor transparency. png may or may not have a correct alpha channel. We'd need to see the texture, the model, and some screenshots to help you more.
Chet
Posts: 53
Joined: Wed Sep 10, 2008 5:34 am

Post by Chet »

ok first a picture from the model software
Image (I placed a cube behind it so you could see the transparency)

here it is exported and in irrlicht. this one uses jpg and add_color method. jpg is what I wind up with by default exporting so I am pretty sure thats what I used before - I did not make changes to the .x file back when I had this working.

Image


and here I tried making a png texture with transparent setting and using alpha channel ref and editing the .x file to use png for that part of the model.
Image

note: transparency is set to about 50% on the 'glass' it just occured to me while typing this to ask if that should be different - I have not experimented with that factor.
the png file is available in the same place the images are loading from. the actual model file is very large since it includes a lot more than 1 window I will make a single file and upload if thats really needed.
I am still completely stumped why this was working just fine with a plain jpg before and now the solid parts disappear ...
Post Reply