Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGLWidget stereo rendering using glDrawBuffer
Forum Updated to NodeBB v4.3 + New Features

QOpenGLWidget stereo rendering using glDrawBuffer

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 1.9k Views 3 Watching
  • 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.
  • N Offline
    N Offline
    Nicolas
    wrote on last edited by
    #1

    Hello,

    i'm trying to draw in the GL_BACK_LEFT and GL_BACK_RIGHT but i get a GL_INVALID_OPERATION just after calling glDrawBuffer.
    It seems that the framebuffer does not support GL_BACK_LEFT and GL_BACK_RIGHT buffers.
    I've set up the QSurfaceFormat like this:

    QSurfaceFormat format = QSurfaceFormat::defaultFormat();
    format.setOption(QSurfaceFormat::StereoBuffers);
    format.setStereo(true);
    QSurfaceFormat::setDefaultFormat(format);**
    

    so that all my QOpenGLWidgets have the same pixel format.
    The stereo is correctly activated because Areo is disabled at launch

    for the rendering (in the painGL method), i simply do a texture draw using the fixed pipeline:

    void draw(int w, int h, float u, float v, int textureId, int buffer)
    {
      glViewport(0, 0, w, h);
      glDrawBuffer(buffer); // Generate the GL_INVALID_OPERATION
      GLenum error = glGetError();
    
      if (error != GL_NO_ERROR)
        std::cout << "GL ERROR: " << error << std::endl;
    
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    
      glEnable(GL_TEXTURE_2D);
      glBindTexture(GL_TEXTURE_2D, textureId);
      glBegin(GL_QUADS);
    
      glTexCoord2f(0, 0);
      glVertex2f(-1, -1);
    
      glTexCoord2f(u, 0);
      glVertex2f(1, -1);
    
      glTexCoord2f(u, v);
      glVertex2f(1, 1);
    
      glTexCoord2f(0, v);
      glVertex2f(-1, 1);
    
      glEnd();
    
      glBindTexture(GL_TEXTURE_2D, 0);
      glDisable(GL_TEXTURE_2D);
    }
    

    Pretty simple.... Is there a known issue with the defaultFramebufferObject when stereo is enabled?

    Sincerelly

    PS: i use Qt 5.4.1 under Windows 8.1

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nicolas
      wrote on last edited by
      #2

      Up

      No one?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        Sorry I can't help you on that matter, however you can also try the #qt irc channel on freenode

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aamesAtTanzle
          wrote on last edited by
          #4

          This issue is getting some love in the form of a bug report: https://bugreports.qt.io/browse/QTBUG-64587

          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