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. Multitexturing problem
Qt 6.11 is out! See what's new in the release blog

Multitexturing problem

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • M Offline
    M Offline
    mauriziodiv
    wrote on last edited by
    #1

    Hi to everyone,
    I am struggling findind the right procedure for multitexturing in QT, i just would like to be able to load more than one texture for my shader. Should I use the shaderProgam.bindAttributeLocation. I know the theory, that each texture should be placed in a specific block of memory. I even know the procedure on a normal openGl program, but some of the function I am supposed to use are under QGLFunctions::... I know the Qt might manage things differently, so if you have a link or something to look at.
    Thank you in advance.

    Maurizio Di Vitto

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      First of all QGLFunctions is deprecated.
      You should be using "QOpenGLFunctions":QOpenGLFunctions or more specifically a subclass for the OpenGL version you want to use, like "QOpenGLFunctions_4_3_Core":https://qt-project.org/doc/qt-5.1/qtgui/qopenglfunctions-4-3-core.html

      What do you mean Qt handles things differently? The QOpenGLFunction_... classes give you pointers to raw OpenGL functions. You do everything as without Qt (apart Qt specific stuff like using QImage as a texture).

      You can do multitexturing in any of the usual ways. The older style: glActiveTexture and glEnable or, if you're using the newer, bindless version: glBindMultiTextureEXT.
      Then you bind shader samplers to specific slots with glUniform or use layout(binding=) specifier in your shaders.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mauriziodiv
        wrote on last edited by
        #3

        Thank you for your advices.

        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