Accname
2D-Graphics enthusiast
- Reaction score
- 1,462
Hi,
I currently have a problem with the blend function in my lwjgl openGL program.
The current blend function i am using is:
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
As i have read that it is the standard blend function used for RGBA images.
But the problem is, the alpha channel is not used properly.
If i am drawing an image on top of another image, and the image with the higher Z-level has pixels with an alpha below 255 then it will always be blended with black.
Look at this example image:
The "Stars" have a higher Z-value then the "Planet". Its a 32bit RGBA png image and alpha is set correctly for the image if i view it with Pain.net / other programs.
But when drawing its always blended on top of black colour.
Can anybody please point out what kind of setting I ve got wrong?
I currently have a problem with the blend function in my lwjgl openGL program.
The current blend function i am using is:
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
As i have read that it is the standard blend function used for RGBA images.
But the problem is, the alpha channel is not used properly.
If i am drawing an image on top of another image, and the image with the higher Z-level has pixels with an alpha below 255 then it will always be blended with black.
Look at this example image:
The "Stars" have a higher Z-value then the "Planet". Its a 32bit RGBA png image and alpha is set correctly for the image if i view it with Pain.net / other programs.
But when drawing its always blended on top of black colour.
Can anybody please point out what kind of setting I ve got wrong?