Hi! I cant make a hole in background with a help of partially transparent mask. Transparent part of mask fills with black color instead of transparency.
I have OPENGL initialization:
void AppDelegate::initGLContextAttrs()
{
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
GLView::setGLContextAttrs(glContextAttrs);
}
I have several images for testing:
lower back

higher back

mask sprite

and when I init my scene I code this:
Sprite* lower_back = Sprite::create("scenes/lower_back.png");
lower_back->setBlendFunc(BlendFunc::DISABLE);
lower_back->setAnchorPoint(Vec2(0, 0));
lower_back->setPosition(Vec2(0, 0));
addChild(lower_back);
Sprite* higher_back = Sprite::create("scenes/higher_back.png");
higher_back->setBlendFunc({ GL_ONE,GL_ONE});
higher_back->setAnchorPoint(Vec2(0, 0));
higher_back->setPosition(Vec2(50, 50));
lower_back->addChild(higher_back);
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
Sprite* mask_sprite = Sprite::create("scenes/mask_sprite.png");
mask_sprite->setBlendFunc({ GL_ZERO,GL_ONE_MINUS_SRC_ALPHA});
mask_sprite->setAnchorPoint(Vec2(0, 0));
mask_sprite->setPosition(Vec2(100, 100));
higher_back->addChild(mask_sprite);
And the result is:

Why there is a black hole , not transparent. I say to src GL_ZERO but it takes the black result.
Help me please. I have tested it on android device and result is the same. What am I doing wrong?
