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. OpengGL Shader Program fails
Forum Updated to NodeBB v4.3 + New Features

OpengGL Shader Program fails

Scheduled Pinned Locked Moved Game Development
28 Posts 7 Posters 15.6k 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
    minimoog77
    wrote on last edited by
    #16

    [quote author="sasmaster" date="1316083047"]
    I am getting no shader program errors either .Everything compiles and runs OK .But the display is empty.[/quote]

    Sorry for lateness, I am looking at your code, first question, why did you enable GL_LIGHTING/GL_LIGHT? That's fixed pipeline stuff.

    Second look, GL_MODELVIEW and GL_PROJECTION matrices, you don't have that also in programmable pipeline. You have to do it yourself in vertex shader. Yes, there is option to set the matrices and access them in shader, but all of the multiplying you have to do it yourself.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sasmaster
      wrote on last edited by
      #17

      Those are remnants from my previous trials.I don't think those influence the modern pipeline as I am using a compatibility mode .So those should be discarded by the OpenGL. Regarding the matrices ,you can see that I load a orthogonal projection matrix into the vertex shader on each render loop. Still nothing works.If anybody could put a full example on how to write a OpenGL 3x in Qt it could be really helpful to many people I believe :)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        minimoog77
        wrote on last edited by
        #18

        Hey, I have example, http://minimoog.wordpress.com/2010/05/10/transfverteksi/ Oh, I am sorry it's in my native language (if it is for somebody interesting I would translate/write in english) but code is simple for understanding http://dl.dropbox.com/u/6108964/QtGL2.zip

        BR.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sasmaster
          wrote on last edited by
          #19

          He He ,very resembles Russian which I know :) .Is it wrapped with Qt? Thanks a lot .I will check it out!

          1 Reply Last reply
          0
          • M Offline
            M Offline
            minimoog77
            wrote on last edited by
            #20

            Also you can use it for learning basic usage of VBO. :)

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sasmaster
              wrote on last edited by
              #21

              I can see you didn't define the format and it actually works ?Another question ,are those inclosed GLEW headers and sources used in your program?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                minimoog77
                wrote on last edited by
                #22

                [quote author="sasmaster" date="1316340394"]I can see you didn't define the format and it actually works ?Another question ,are those inclosed GLEW headers and sources used in your program? [/quote]

                By format you mean 'window framebuffer pixel format'?

                Yes, it's using GLEW, since there are glGenBuffers, glBindBuffers, glBufferData, glVertexAttribPointer etc.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  sasmaster
                  wrote on last edited by
                  #23

                  But why haven't you used the Qt version of those methods?
                  By Format I mean the QGLFormat.

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    minimoog77
                    wrote on last edited by
                    #24

                    [quote author="sasmaster" date="1316343899"]But why haven't you used the Qt version of those methods?[/quote]

                    You mean QGLBuffer. Well at that time there was no QGLBuffer.

                    [quote]By Format I mean the QGLFormat.[/quote]

                    It uses default format. I don't see why would I need a fancy format for that code. :)

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      matti-
                      wrote on last edited by
                      #25

                      What's the motivation to use QGLShaderProgram anyway instead of standard OpenGL for portability?

                      Author of <a href="http://mmark.777-team.org/">MMark13</a>

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        tomato
                        wrote on last edited by
                        #26

                        An idea (maybe wrong...) : Implementation of openGL is platform (hardware) dependent. So I guess it could permit an universal call through various platforms or OpenGL revision (and avoid use of OGL extension which I used to add on mac OS platform for exemple).
                        Nervertheless I prefer use pure OpenGL functions call as long as OGL 4.0 (and so OGL ES 2.0) will not be supported anywhere...

                        お前はもう死んでいる

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          sasmaster
                          wrote on last edited by
                          #27

                          minimoog77 .Getting can't open the shader files errors when running your demo.Do you know what can be the problem?

                          @
                          QGLShader: Unable to open file "/vert1.vert"
                          ""
                          QGLShader: Unable to open file "simple.frag"

                          @

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            sasmaster
                            wrote on last edited by
                            #28

                            Well ,currently can get it working with inline string typed shaders.shader files somehow don't get loaded.Also I see that the best thing is to use native (non Gt wrappers) OpenGL libs

                            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