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. Why are the attribute settings functions part of the QOpenGLShaderProgram ?

Why are the attribute settings functions part of the QOpenGLShaderProgram ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 655 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.
  • F Offline
    F Offline
    FR_Master
    wrote on last edited by
    #1

    Why are the attribute settings functions (e.g. setAttributBuffer(..) etc.) for an vertex array object (vao) part of the QOpenGLShaderProgram ? It would conclusive to me, if it were part of the QOpenGLVertexArrayObject.

    The point is actual, that i must have a defined shader program at the creation and initalization of the buffers, more precisely in the once called initalization method. Thats o.k. sofar. But when i want the functionality of an changable shaderprogram, maybe as an parameter to the draw method of an 3DModel, i have a problem. Because now i have to bind the buffer objects and make the attribute settings in the rendering loop. This makes the efforts of an vertex array object redundant.

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

      Hi,

      For such design decisions related questions you should rather ask on the interest mailing list. You'll find there Qt's developers/maintainers. This forum is more user oriented.

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

        Right but there is a issue behind that, what i tried to describe. How to handle on that base the functionality of an changeable shaderprogram ? I have an class which defines a 3DModel. It has an initalization and a draw method as membermethods. In the first one i create and setup the buffer objects (vbo, ibo). I want also use a vertex array object (vao), which i create and setup in the intialization function. There are the invocations that i only have to call ones in the sense of an opengl context. But for the setup and activation of the vertex attributs, that the vao is rememebering, i now need a that point a shaderprgram object. In view of an changeable shaderprogram i dont have that as a member of 3DModel class and thereby also not in the initalization function. I give a referenc to a shaderprogram as paramter to the draw method or better to the rendering loop. So as workaround i have to setup the attributs in the rendering loop, which makes the use of an vao redundant.

        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