How to get alpha from openGL output?


So I’m quite new to OpenGL. I mainly use QT GL implementation as I find it quite helpful to get into the GPU stuff.

I was recently trying to get some renders out of OpenGL but I struggle with alpha channel.

Say I have a few cubes and geometries. I’d like to get that in a raw format of ints or anything like that. But I would like to get alpha as well so that I can later blend it properly.

Would any1 be so kind and direct me in to correct way of thinking as to how accomplish this? Google results seem to not help or I don’t know what to google for…


You need to create the framebuffer with an alpha channel. For Qt, use e.g.

QSurfaceFormat format;