Hi all,
I'm new to OpenGl so please bear with me.
I'm trying to clear out alpha in a section of the frame-buffer and then later draw to only sections where alpha is 1. I'm using OpenGL ES 1.1 which doesn't allow masking of individual color channels.
So I figured I'd accomplish this by drawing sprites.
// Clear Alpha Pass
// Sprite color = (0,0,0,1)
glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
Does that look okay so far?
I'm testing it by drawing another sprite over it which should only draw in areas where the frame buffer has an alpha of 1.
So I drew the sprite with 0,0,1,0:
// Test Pass, nothing should show up
// Sprite color = (0,0,1,0)
glBlendFunc(GL_DST_ALPHA, GL_ONE);
The problem is this sprite draws when I think it shouldn't. Am I wrong? If I change the src factor in my test pass to GL_ONE_MINUS_DST_ALPHA, then the sprite doesn't draw...almost like its the reverse of what I expect.
Thanks,
BennyW