Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: How to get alpha from openGL output?

  1. #1
    Newbie Newbie
    Join Date
    Feb 2018
    Posts
    1

    How to get alpha from openGL output?

    Hey

    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...

    Regards
    Dariusz

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,926
    Quote Originally Posted by Dariusz View Post
    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.
    You need to create the framebuffer with an alpha channel. For Qt, use e.g.
    Code :
    QSurfaceFormat format;
    format.setAlphaBufferSize(8);
    QSurfaceFormat::setDefaultFormat(format);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •