Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Modern OpenGL pipeline implementation in Qt

    Game Development
    3
    8
    3405
    Loading More Posts
    • 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
      sasmaster last edited by

      Hi all.I am new to -QT- Qt and I need to develop a desktop app with GUI which utilizes OpenGL 3x (modern not fixed pipeline ). I read the docs and the OpenGL examples seem to be fixed pipeline. Does -QT- Qt at all supports OpenGL 3.1/4.1 version ? Are there any examples on how to load vert/frag shaders, create buffers and programs "-QT- Qt way" ?

      Thanks .

      1 Reply Last reply Reply Quote 0
      • T
        task_struct last edited by

        Hi,

        take a look at "Qt 3D":http://doc.qt.nokia.com/qt3d-snapshot/index.html and "QGLShaderProgram":http://doc.trolltech.com/4.7-snapshot/qglshaderprogram.html
        I think this will help you.

        "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

        • Linu...
        1 Reply Last reply Reply Quote 0
        • M
          minimoog77 last edited by

          Well I did give you example of which uses programmable pipeline. :)

          1 Reply Last reply Reply Quote 0
          • S
            sasmaster last edited by

            Yes ,man ,thanks .Now I think I forgot using VBO...

            1 Reply Last reply Reply Quote 0
            • M
              minimoog77 last edited by

              My recommendation for VBO, use 'packed' vertices with stride parameter.

              1 Reply Last reply Reply Quote 0
              • S
                sasmaster last edited by

                Sorry ,but what do you mean by "stride parameter. " ?

                1 Reply Last reply Reply Quote 0
                • M
                  minimoog77 last edited by

                  You have packed vertices in one array of this struct:

                  @Struct Vertex {
                  float x, y, z;
                  float nx, ny, nz;
                  float some_vertex_attribute;
                  }@

                  Which has size, 28 bytes, if I am not wrong.

                  Stride parameter is byte offset between consecutive vertices, then for example, x, y, z (vertex pos) stride would be, you guess, 28 bytes: the driver would take three floats, and then will jump 28 bytes, take three floats, then jump, etc...

                  I hope you understand.

                  1 Reply Last reply Reply Quote 0
                  • S
                    sasmaster last edited by

                    I think I got you.You mean packing different data for the vertex buffer in a single vertex array.Like vertices positions,color, like :
                    @
                    GLfloat vertAndColors[]={
                    23.0f,12.0f,23.43f,/vertex 1 /0.23f,0.75f,1.0f.1.0f / RGBA color for that vertex/ ,
                    ....
                    ......
                    ........
                    }
                    @
                    ?

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post