Wrong alpha blending when rendering on a QGLFramebufferObject

后端 未结 1 365
故里飘歌
故里飘歌 2021-01-18 22:39

I write an OpenGL based vector graphics renderer for my application. It needs to render to a framebuffer object rather to the screen directly. Since I write the application

相关标签:
1条回答
  • 2021-01-18 23:18

    Try the following:

    QGLFramebufferObjectFormat fmt;
    fmt.setSamples(1); // or 4 or disable this line
    fmt.setInternalTextureFormat(GL_RGBA8);
    QGLFramebufferObject fbo(width(), height(), fmt);
    

    This forces a specific pixel format and also disables rendering to a texture by using multisampling (otherwise QT always renders to a texture). That might produce different results. You can also experiment with the format.

    Also, what is your hardware? My maximal point size is only 64 pixels (GTX 260), you are trying to render 100 pixel points. That might be an issue. Are any OpenGL errors generated? Does the same happen on small points?

    You might also try hinting (if it's possible in QT):

    glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
    

    But i wouldn't expect this to change anything.

    0 讨论(0)
提交回复
热议问题