I’m using a framebuffer object and I’d like this fbo to generate a transparent texture.
I’ve tried to render transparent 2D objects to the fbo and then render its texture. However, this doesn’t seem to work, only pixels with alpha=1 are rendered to the fbo texture. (unless I use an opaque background)
So my new plan is now to let the fbo generate a black and white texture(I don’t need the colors) and use this texture’s whiteness-intensity as an alpha value instead.
At the moment I use this blending function:
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
This doesn’t use the white-intensity for transparency however.
So my question is: how can I make openGL use the white-intensity instead of the alpha channel for transparency during rendering?
I’m thinking about solutions like:
use a different blending function
use a different internal format for the fbo-texture