I have a little paint application which was based on the GLPaint sample code. It is working fine. My Problem is that I need to implement a "brush" that erases the textures which were already drawn.
My goal is to have an eraser which has soft edges. Right now I just took the same texture which I used for drawing but switched the blending functions from
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
to
glBlendFunc(GL_ZERO, GL_ZERO);
The result is a square rectangular eraser. That is ok but it's not what I actually want. I need soft edges. I want to make a round eraser not a square rectangular.
Do you have any guess how to achieve that? Or do you know if there is a way to create my own custom blending function?