Question about Premultiplied Alphas

[ Language C++ ]

Ive been scouring google for the info I need to solve this problem I,m having involving glBlendFunc. I can’t get my 2d images to show up correctly. They’re always half transparent or don’t remove the black pixels, and overlap incorrectly.

I found a potential solution involving Premultiplied Alphas. But I don’t know how they work or how to apply them. Do I apply it in an image editor like Gimp? Though the texture loading process? Or though OpenGL commands perhaps?

If I have to apply it to images, what format should I use? I have been using PNG’s with black background for transparency.

If anyone could tell me how it works that would be mighty nice of ya.

Suggest you read this first to see how it works, and then you’ll be able to intuit what method will work best for you:

To your question, it can be done in the file, or after loading in many cases. Whatever works best. Excepting special cases like precompressed DXT1 textures, where premultiplied alpha is assumed.