Transparent FrameBuffer background in OpenGL

前端 未结 3 1625
执笔经年
执笔经年 2021-02-10 13:53

I want to use glClear and glClearColor to fill a frame buffer with a colour including alpha transparency. However the framebuffer always renders as opaque when binded to a textu

3条回答
  •  野性不改
    2021-02-10 14:20

    The clear color alpha of the FBO must be equal to 0 :

    glColorMask(TRUE, TRUE, TRUE, TRUE);
    glClearColor(0, 0, 0, 0);
    glClear(GL_COLOR_BUFFER_BIT);
    

提交回复
热议问题