Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64587

Adding stereo hardware support to QOpenGLWidget

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.6.2, 5.9.2
    • Fix Version/s: None
    • Component/s: GUI: OpenGL
    • Environment:

      Description

      This is a follow-up of the webinar Qt graphics AMA from November 16 2017 where it has been recommended to open this case.

      It is not currently possible (tested in 5.6.2 and 5.9.2) to deal with hardware stereo with a QOpenGLWidget, the replacement class for QGLWidget, marked as deprecated. In this regard, QOpenGLWidget is not a full replacement of QGLWidget.

      With QGLWidget, once the execution reaches paintGL(), the bound framebuffer for drawing and reading is the default framebuffer. Therefore, if you requested a stereo context with QGLFormat, you have access to the back left and back right buffers.

      With QOpenGLWidget, once the execution reaches paintGL(), the bound framebuffer for drawing and reading is a FBO prepared by Qt with a single colorbuffer attachment, even if you requested a stereo context with QSurfaceFormat.

      During the webinar, the proposed alternate solution was to use QOpenGLWindow instead. Unfortunately, this is not an option if you use QOpenGLWidget as the viewport set on a QGraphicsView and you try to render a 3D scene in QGraphicsScene::drawBackground() in order to have QWidgets rendered as an overlay on top of the 3D scene.

      I don't know the details of the implementation of QOpenGLwidget but I imagine that it would be possible to have a FBO set with two colorbuffer attachments instead of one. The custom code in paintGL() would be able to draw in the desired attachment by using glDrawBuffer*() and after the execution of paintGL(), Qt would blit one of the them to the actual back left color buffer of the default framebuffer and the other to the back right color buffer.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            fbertelschrodinger François Bertel
            Votes:
            10 Vote for this issue
            Watchers:
            13 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes