cant load png-texture

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
Borath
Posts: 10
Joined: Fri Nov 17, 2006 4:57 am

cant load png-texture

Post by Borath »

Hello

as i am completely new to irrlicht engine i just play arround with the examples. I am able to compile them and enjoy viewing them.

Then i made bigger step : changing models used in the tutorials - worked well.

Then i compressed the sydney texture as jpg and png. the irrlicht engine loads the jpg without any problems, but when trying to load the png the model is only white. No error message.

I converted the texture using MS Paint and ACDSee (dunno if there are differences in the png-format)

Did i make something wrong?

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

Post by hybrid »

Some formats of PNG are not supported by Irrlicht 1.1, but this will become better in 1.2. The loader should warn you, though, if loading fails due to wrong file formats.
Youen
Posts: 4
Joined: Sun Nov 26, 2006 5:30 pm

Post by Youen »

I have the same problem when using alpha channel in my texture. It seems to work when saving the png not interleaved. Anyway I got another problem when using the material type EMT_TRANSPARENT_ALPHA_CHANNEL : the texture, which should have a smooth border, is too tough (begins to slowly become transluscent, and the becomes totally transparent at once). I don't know if it is because of the texture loading (from png) or not.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Just a thought youen, is the image sized 2^n width and height?
Image Image Image
Youen
Posts: 4
Joined: Sun Nov 26, 2006 5:30 pm

Post by Youen »

Yes, it is a power of 2, and I have found the problem for transparency : I did not configure the MaterialTypeParam properly : it needs to be very low (since its the threshold at which the alpha value is considered to be completely transparent), but not zero because zero is considered the same as 0.5 (don't ask me why ^^). A value of 0.05 gives a correct result.
Post Reply