Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Has QT QPixmap / QImage / bindTexture limitations that prevent loading / rendering?
Forum Updated to NodeBB v4.3 + New Features

Has QT QPixmap / QImage / bindTexture limitations that prevent loading / rendering?

Scheduled Pinned Locked Moved Unsolved Game Development
9 Posts 2 Posters 1.1k Views 1 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
    newgen23
    wrote on last edited by newgen23
    #1

    Hi,

    I try to bind a texture to a GL object, which work for me for several years using:

    environment_textures[1]=bindTexture (QPixmap(QString("../texture/earth4.png")));
    glBindTexture( GL_TEXTURE_2D, environment_textures[1] );
    

    About 1-2 years ago, something with QPixmap / QImage or bindTexture must have changed. All textures still get loaded and redered except one.

    earth4.png is a 8MB picture with a resolution of 7979x3948 pixels. It's the only big image I have.

    I tried to debug the problem, step by step.

    QImage * imagen = new QImage("../texture/earth4.png");
        if(imagen->isNull())
                {
                    cout<<"QImage failed to load earth4"<< endl;
                }
        else cout<<"QImage loaded earth4 successfully"<< endl;
    

    This code will return "QImage loaded earth4 successfully".
    However, the bindTexture normally returns a single digit GLuint. With the earth4.png image, bindTexture returns: 1906110480
    When I change the texture to a smaler image (also png), the texture renders without problem.

    My question: Are there any limitations in QPixmap / QImage or bindTexture that might prevent the loading rendering?

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

      Hi,

      If memory serves well: 32767x32767 pixels however I do not think the issue is from QImage. Did you check GL_MAX_TEXTURE_SIZE ? I suspect it will be smaller that your image.

      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
      • N Offline
        N Offline
        newgen23
        wrote on last edited by
        #3

        Thanks for the reply. If I understand GL_MAX_TEXTURE_SIZE correctly, it should return the max size of a texture my graphics card supports. However, the texture had already works till ... i guess 2019 or so. On all my systems with very different cards. According to my git repo, I have not change the code responsible for the texture or the rendering. The texture itself was also not modified. I therefore assume that it was a change in the QT code, as I have read somewhere that there has been some development. But I will try to check GL_MAX_TEXTURE_SIZE anyway. Thanks.

        1 Reply Last reply
        0
        • N Offline
          N Offline
          newgen23
          wrote on last edited by
          #4

          Ok, I included the following code:

          GLint maxtexsize;
              glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxtexsize);
              cout<<"Maximum texture size is "<<maxtexsize<<endl;
          

          and it returns:
          Maximum texture size is 16384

          That would mean that my card could handly textures of 16384 x 16384.Should be more than enough. (geforce gtx 1070)

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

            Just to be sure, you changed nothing to your code ?
            If so, did you check the graphics card driver ?

            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
            • N Offline
              N Offline
              newgen23
              wrote on last edited by newgen23
              #6

              I find your last 2 questions confusing. I already wrote that I had not changed the code. And what is that question about the graphics card driver? Why should the driver fail to render on texture but load another? With the same c++ code? As I stated: all other textures load and render fine, except one.
              Any suggestions how I could further debug where the texture code fails?

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

                The question about the driver comes from you writing that the only one failing is the one weighing 8MB. As any other piece of software, drivers can have bugs and regressions. Hence there might be a bug there triggered by the size of your image.

                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
                1
                • N Offline
                  N Offline
                  newgen23
                  wrote on last edited by
                  #8

                  Sorry, didn't want to sound angry. As the code runs on different systems with different grafic cards / drivers and always this one texture fails to render, I am just clueless to the reason.

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

                    I thought that this image only failed on your system.
                    Does it have any other properties beside the size that makes it different from your other images ?
                    Would it be possible for you to create a minimal compilable example using it ?

                    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

                    • Login

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