Reputation: 1625
I've written a test program using OpenGL on OS X that loads a PNG, compresses it in memory to DXT5 using libsquish (http://code.google.com/p/libsquish/), and textures a plane.
When I upload an image that contains an alpha channel, but no pixels have alpha values other than fully opaque, it displays correctly: https://i.sstatic.net/WlRcD.png
Given the same image but the black part is replaced with transparency, this is the output I get: https://i.sstatic.net/wOPqA.png
The code is not pretty, it is a thrown together proof of concept:
Any thoughts?
Upvotes: 0
Views: 802
Reputation: 1625
Turns out I forgot this:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Upvotes: 0