In my app, I currently use alpha blending, just to achieve the normal effect of translucency (glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)).
In addition, I want to do some masking. Some portions of the screen should be opaque, some translucent. So, I guess I need something like an alpha mask, but without affecting my original blending I described above.
Is there a way to achieve this with destination alpha or some other method?
I haven’t really done much alpha stuff but can’t you change the blend mode after you have drawn the stuff using the first blending mode to a different more useful one then switch back again?
Well, my problem is how do I apply the alpha mask to the image? E.g. when I first draw the whole scene (which is actually 2D only) then I could switch to a different glBlendFunc() that uses destination alpha and draw a big rectangle over the whole scene. This would apply the alpha mask.
The problem with this approach is it would lead to an effect that I do not desire. I would draw the whole scene first and then apply the alpha mask instead of applying the alpha mask everytime I draw a … well, lets call it primitive. This would be possible with the stencil buffer, I know, but can you imagine an approach using destination alpha or some other method (except stencil buffer, I actually use it for various other things)?