I am confronted with following scenario:
My framebuffer contains already the “background” of my scene and should not be changed for now.
Over this background, I want to blend a semi-transparent textured geometry. As an example you can think of a partly transparent courtain.
Now comes the “masking”:
I want to implement a “cut” tool that can cut the courtain.
this cutting shall be done by drawing (per mouse) into a greyvalue image which is used as mask for the alpha channel of the courtain.
Black means invisible, white means no change (and intermediate values of eg 50% mean 50% opaque.
In practice I would plan to do as follows:
- get framebufferobject
1.1 render mask with glbendfunc(?,?)
1.2 render geometry with glblendfunc(?,?)
- render fbo texture into normal framebuffer
Am I on the right path?