I dont see any blending being done in that picture. You just draw image2 on top of image1.
Is this not blending, where alpha = 0?
Ist that not possible with glBlendFunc in general?
My idea was to do this overlay by using glBlendFunc. The Image2 should be a texture with alpha channel.
Last edited by susanne; 03-20-2014 at 02:34 PM.
Usually, these two lines should do the trick:
Code :glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
And yes, this is blending because otherwise, the white background would cover all the stars, which it does not due to alpha=0.
What you want is probably disabled blending with an Alpha-Test.
Alpha-Test will cull all fragments where the alpha value does not satisfy the test.
With the blending provided by Brokenmind it will work too. If you want to do it without blending (because you really dont need blending if you only use alpha values of 1 and 0) then you can do:
This will make it so that only those fragments with an alpha value of exactly 1 will be drawn. All other fragments will be discarded.Code :glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_EQUAL, 1);