Painting the alpha channel of an image

I’m trying to “discover” an image using a brush to paint the image alpha channel. But I can’t make it work. I’ve used a reference made with cocos2d-x 2.x, but is not working on 3.x. I’ve tried using a RenderTexture (rtex), to this texture I add a Sprite->visit()… But I don’t know how to clear the alpha, so later with the brush I could add the alpha, painting it. How should I solve this?

I’ve tried with this (in a onTouchMoved function)

 brush->setBlendFunc({ GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA });
        rtex->begin();
        glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
        brush->setPosition(pos);
        brush->visit();
        rtex->end();