PNG Alpha Transparency

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
wopag
Posts: 13
Joined: Thu Mar 11, 2010 9:55 am

PNG Alpha Transparency

Post by wopag »

Im loading in a 3DS file that uses a PNG texture which has part of the texture as transparent.

Loading the 3ds file in shows the transparent sections as just white.

Do i need to load in the 3ds file then traverse the texture setting the transparency manually ?! I was expecting the transparency setting to be taken automatically from the PNG file

/Stu
wopag
Posts: 13
Joined: Thu Mar 11, 2010 9:55 am

Post by wopag »

Ok so forum trawling and Ive found

setMaterialType(EMT_TRANSPARENT_ALPHA_CHANNEL_REF)

does the trick.
andres
Competition winner
Posts: 78
Joined: Tue Jul 08, 2008 5:18 pm
Location: Guarapuava/Brazil
Contact:

Post by andres »

you can also use EMT_TRANSPARENT_ALPHA_CHANNEL if u want more precision (for example semi-transparent surfaces).
Prof. Andres Jessé Porfirio
Federal Technological University of Parana (UTFPR)
www.andresjesse.com
http://irrrpgbuilder.sourceforge.net

Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you set the material properly in your 3ds file, it should be supported automatically.
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Be aware of the differences between EMT_ALPHA_CHANNEL and EMT_ALPHA_CHANNEL_REF. Alpha channel ref doesn't do any blending, so is less accurate, but it's also much faster because it doesn't matter in what order it's drawn because it doesn't blend with anything. Alpha channel on the other hand blends correctly, but is much slower.
wopag
Posts: 13
Joined: Thu Mar 11, 2010 9:55 am

Post by wopag »

Im MAX you can only add alpha stuff to materials ? The transparency is stored in the PNG file, which isnt automagically being applied......
wopag
Posts: 13
Joined: Thu Mar 11, 2010 9:55 am

Post by wopag »

I've just converted the model to B3D, load that into irrlicht and again the PNG transparency is ignored.
Bear_130278
Posts: 237
Joined: Mon Jan 16, 2006 1:18 pm
Location: Odessa,Russian Federation

Post by Bear_130278 »

Try TGA instead 8)))
Do you like VODKA???
Image
Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, if all images are required to treat alpha channels from images for transparency, this needs to be properly exported. Both 3ds and b3d have flags for this purpose, which would need to be set in this case. Otherwise you are required to set these flags manually after loading, e.g. by checking the texture names and enabling the transparency material.
Post Reply