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. Render OpenGL texture inside Qt's interface
QtWS25 Last Chance

Render OpenGL texture inside Qt's interface

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 707 Views
  • 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.
  • S Offline
    S Offline
    Skarn
    wrote on 29 Nov 2021, 12:43 last edited by
    #1

    I have a 3D graphics-heavy application written in C++ with QtWidgets and I am currently working on optimizing its VRAM usage. The issue is that there is a texture browser (shown on the picture below) which displays textures to the user with QPixmap as QLIstView's model's item decoration role. At the same time the same textures are also loaded into OpenGL to be displayed inside the viewport (QOpenGLWidget). This results into the same data potentially duplicated in video memory.

    Is there a way to render a texture as a decoration role inside the Qt's UI using a texture handle from OpenGL without the need of constructing a pixmap with duplicated data?

    85e990d7-1f99-4aa6-97ad-8fa222573b4c-image.png

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 29 Nov 2021, 20:44 last edited by
      #2

      Hi and welcome to devnet,

      AFAIK, not directly no.

      The two are using two different rendering mechanisms.

      One is using the raster engine and the other OpenGL.

      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
      • S Offline
        S Offline
        Skarn
        wrote on 2 Dec 2021, 13:56 last edited by Skarn 12 Feb 2021, 13:57
        #3

        @SGaist said in Render OpenGL texture inside Qt's interface:

        raster engine

        Thanks for the answer! Does it maybe allow to store images compressed then? For example, using DXT compression.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 2 Dec 2021, 20:07 last edited by
          #4

          What kind of storage do you have in mind ?

          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
          • S Offline
            S Offline
            Skarn
            wrote on 3 Dec 2021, 00:46 last edited by Skarn 12 Mar 2021, 00:47
            #5

            So, afaik QImage/QPixmap store image pixels raw, which would mean that there is no compression applied to them. There are about 670 512x512 textures, and about a thousand 1024x1024 textures which results in a lot of RAM and VRAM space wasted just for texture previews in the UI. So, it'd be good to at least store them compressed.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 3 Dec 2021, 20:47 last edited by
              #6

              That's the kind of case where you would use moving window and a pixmap cache to limit the amount of image loaded at a time.

              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
              • J Offline
                J Offline
                jordanestelle
                Banned
                wrote on 30 Aug 2022, 17:56 last edited by
                #7
                This post is deleted!
                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