I am having a few issues rendering alpha channels from JUCE into OpenGL textures. Specifically, the issue is with anti-aliasing.
Please look at these tests, where I am loading a PNG image with transparency into an OpenGL texture. You will see white text on a color background. The text is the texture image (white text on transparent background), the background color is made by OpenGL.
In this example, the PNG is loaded with JUCE’s ImageFileFormat::loadFrom, and then sent to OpenGL:
In this one, the PNG is loaded via SDL and SDL_image, composed in OpenGL using JUCE.
Notice that JUCE’s image seems to blend those semi-transparent edge pixels to black. What is interesting is that none of this happens if the JUCE image is composed on a Component with a solid color background.
This behavior is repeated on anything that has an alpha channel in JUCE. For example, if you create a snapshot of a component that, say, has a Drawable on it, but no background, the edges of the pixels in that snapshot will also be black once they are rendered by GL.
It seems like the alpha channel in JUCE is not finalized unless the image is composed within JUCE. That is great if you are just working in JUCE, but it is not as nice if you are trying to use JUCE to load translucent textures to GL.