Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Screen framebuffer VS. QQuickFramebufferObject in texture blending

Screen framebuffer VS. QQuickFramebufferObject in texture blending

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 983 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jiancaiyangJ Offline
    jiancaiyangJ Offline
    jiancaiyang
    wrote on last edited by
    #1

    I found some difference between default framebuffer provided by screen. Look at this:
    0_1503412545815_2017-08-22-223516_642x516_scrot.png
    When I use QQuickFramebufferObject the texture blending is strange:
    0_1503412595083_2017-08-22-223629_642x516_scrot.png Blending texture is lighter than the default framebuffer.
    Could anybody give me a hint on how to cause this difference?

    我们自己的论坛:http://qtdream.com
    擅长三维角色仿真动画。

    1 Reply Last reply
    0
    • timdayT Offline
      timdayT Offline
      timday
      wrote on last edited by timday
      #2

      Which blending mode are you selecting in each version? (If you're not explicitly controlling it, it might default to something different in each case). My first guess would be it's something to do with whether premultiplied alpha is being used or not, just because so many people get tripped up by that.

      jiancaiyangJ 1 Reply Last reply
      0
      • timdayT timday

        Which blending mode are you selecting in each version? (If you're not explicitly controlling it, it might default to something different in each case). My first guess would be it's something to do with whether premultiplied alpha is being used or not, just because so many people get tripped up by that.

        jiancaiyangJ Offline
        jiancaiyangJ Offline
        jiancaiyang
        wrote on last edited by
        #3

        @timday Yeah, something must be set before QQuickWindow::beforeSynchronizing.
        However, I tested so many flags using glGetIntegerv but got not much useful information. I use the following code:

            GLboolean blend = -1;
            glGetBooleanv( GL_BLEND, &blend );
            qDebug( ) << "Blend state is: " << ( blend? "enabled": "disabled" );
        
            GLfloat colors[4];
            glGetFloatv( GL_BLEND_COLOR, colors );
            qDebug( ) << "Blend color is: " << colors[0] << colors[1] << colors[2] << colors[3];
        
            GLint equationRGB = -1, equationAlpha = -1;
            glGetIntegerv( GL_BLEND_EQUATION_RGB, &equationRGB );
            qDebug( ) << "Equation RGB is: " << equationRGB;
        
            glGetIntegerv( GL_BLEND_EQUATION_ALPHA, &equationAlpha );
            qDebug( ) << "Equation Alpha is: " << equationAlpha;
        
            glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
        
            GLint srcRGB = 0, srcAlpha = 0;
            GLint destRGB = 0, destAlpha = 0;
            glGetIntegerv( GL_BLEND_SRC_RGB, &srcRGB );
            glGetIntegerv( GL_BLEND_SRC_ALPHA, &srcAlpha );
            glGetIntegerv( GL_BLEND_DST_RGB, &destRGB );
            glGetIntegerv( GL_BLEND_DST_ALPHA, &destAlpha );
        
            qDebug( ) << "source RGB is: " << srcRGB <<
                         "source Alpha is: " << srcAlpha <<
                         "dest RGB is: " << destRGB <<
                         "dest Alpha is: " << destAlpha;
            glEnable( GL_DITHER );
            GLboolean doubleBuffering = -1;
            glGetBooleanv( GL_DOUBLEBUFFER, &doubleBuffering );
            qDebug( ) << "Double buffering is: " << ( doubleBuffering? "enabled": "disabled" );
        

        我们自己的论坛:http://qtdream.com
        擅长三维角色仿真动画。

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved