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

Qt 3D rendering lags behind Qt Quick rendering

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.14
    • 5.9.7, 5.10.1, 5.11.3, 5.12.0
    • Qt3D
    • None

    Description

      When integrating Qt Quick and Qt 3D (using for instance Scene3D and Studio3D), rendering in Qt 3D will always lag behind Qt Quick by one or multiple frames. This is because the change processing in Qt 3D is detached from the rendering loop of Qt Quick and/or the render thread in Qt 3D. While this enables parallelism (jobs for the current frame can start before changes for the next frame are incoming), it also adds additional input latency and is unsuitable for integration with Qt Quick.

      The following modified example of scene3d illustrates the issue. Here, I have made it so that the color of the upper left square and the sphere are changed from blue to green when the "Click me!" text is pressed.

      The following shows the scene right before the text is pressed (visualized with QApiTrace):

      The following shows the two frames are from after the text is pressed:

      As can be seen from these two frames, the 3D content is updated one frame after the Qt Quick content. While quite innocent in this case, this can lead to more serious glitches if for instance the size of the 3D view changes.

      In my opinion, the best option is to move towards a more synchronous approach for handling changes in Qt 3D. In other words, remove the aspect thread and put the processing performed by it on the main event loop instead. That would also be a more ideal setup to resolve issues like QTBUG-70035 and QTBUG-67412.

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            dragly Svenn-Arne Dragly
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes