What does ofClearAlpha do and when to use it?

I tried ofClearAlpha but it doesn’t seem to have any effect on my drawing.
I thought it would clear out the alpha blending but maybe it has a different usage?


ofClearAlpha() is like ofClear(…) but just for the alpha channel.

a common use would be that you draw transparent items into an fbo but when you go to draw the fbo, those pixels are transparent now so the fbo is blended with the background. I use it to make the fbo opaque again –

ofClear(…) // clear the fbo
draw some transparent stuff
ofClearAlpha() // clear the alpha

now fbo is fully opaque, even if it had some transparent stuff drawn in it…


Thank you @zach :slight_smile: