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

Problems with fast changing textures

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.0
    • 5.9.1
    • Qt3D
    • None

    Description

      This is a problem I've seen for a long time and now I need a way to fix it. 

      I use a QTextureImageDataGenerator functor to generate textures. I also use OnDemand rendering. It all works fine if the user is manipulating the scene with the mouse, as the scene is constantly redrawn. However, if the textures are changing rapidly, the result is incorrect rendering. I've traced the problem to this:

      gltexture.cpp: GLTexture::getOrCreateGLTexture() returns nullptr and issues the warning

      [Qt3DRender::GLTexture] No QTextureData generated from Texture Generator yet. Texture will be invalid for this frame

      That causes the callee GraphicsContext::activateTexture to return -1 which again causes the texUniform textureId to be -1 in GraphicsContext::setParameters, and then the sampler2D uniform is not set for this frame.

      When the scene is rendered, another texture is sampled instead, see wrong.png. 

      And as I use OnDemand rendering, the scene is not immediately rendered again, resulting in very bad artifacts.

      I'll gladly contribute to the fix if I can, as this bug is getting critical for me.

       

      Attachments

        1. ok.png
          54 kB
          Harald Vistnes
        2. wrong.png
          143 kB
          Harald Vistnes
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dragly Svenn-Arne Dragly
            harald Harald Vistnes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes