IMGlib & .pngs problem with OpenGL

If you are using IMGlib to load textures for OpenGL be aware that the alpha
values are inverted. I guess that is so that it can correctly load images
for SDL - not sure, never loaded a png with an alpha for use with SDL. To
fix the problem comment out the line with png_set_invert_alpha in IMG_png.c

Gerry

If you are using IMGlib to load textures for OpenGL be aware that the alpha
values are inverted. I guess that is so that it can correctly load images
for SDL - not sure, never loaded a png with an alpha for use with SDL. To
fix the problem comment out the line with png_set_invert_alpha in IMG_png.c

Hmm. I think SDL and OpenGL have inverse ideas of the semantics of the alpha
channel. SDL takes the alpha value to mean the transparency of the source
pixel. If the alpha is 0, then the pixel is fully visible. I can easily
invert this, but it would break all current SDL applications using surfaces
with an alpha channel.

How many people use surfaces with source alpha?
Would it be worth it to change the sematics of the alpha channel?

See ya!
-Sam Lantinga (slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Hmm. I think SDL and OpenGL have inverse ideas of the semantics of the alpha
channel. SDL takes the alpha value to mean the transparency of the source

Hey, it’s a contest for who can post latest, but I win because I’m at
the office :).

Anyway, from the Red Book:

“By convention, OpenGL alpha corresponds to the notion of opacity
rather than transparency, meaning that an alpha value of 1.0 implies
complete opacity, and an alpha value of 0.0 complete transparency.”

I wonder if you could use glAlphaFunc() to invert the comparison?

Going home now,

m.On Wed, Jan 05, 2000 at 11:47:59PM -0800, Sam Lantinga wrote:


Programmer "I wrote a song about dental floss,
Loki Entertainment Software but did anyone’s teeth get cleaner?"
http://lokigames.com/~briareos/ - Frank Zappa, re: the PMRC