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 doesn't QT accept the Shading and the Lightning Features of OpenGL?
Forum Updated to NodeBB v4.3 + New Features

Why doesn't QT accept the Shading and the Lightning Features of OpenGL?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5.5openglvisual studioc++
4 Posts 2 Posters 2.3k 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.
  • T Offline
    T Offline
    taulant01
    wrote on last edited by taulant01
    #1

    Hi guys,

    I am trying to create an Object in QT with OpenGL. I found a code that's in OpenGL and it works fine, it has Lighting sources, Shading and the object.

    The Interesting thing is that, in the C++ code that I downloaded, the program works perfectly, the Object appears with a shiny material, the shading works perfect and the light source also.

    I took and copy the code into a QT project, it is the same except I didn't add the Keyboard handling, because I don't need them. And in the QT project, the object is WHITE. No shading, no light nothing!

    Here are the pictures of the QT project and the original OpenGL project:

    Original Project - Image

    QT Project - Image

    I am new in QT and I really don't understand why the code isn't working ?

    Does anybody have any idea why it isn't working?

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

      Hi , Im no expert on opengl but I think the old code used stuff from fixed pipeline times
      and qt expects shaders as its modern opengl.

      If you look at
      http://doc.qt.io/qt-5/qtgui-openglwindow-example.html

      they use
      glVertexAttribPointer and other moden constructs.

      But its just a guess.

      T 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi , Im no expert on opengl but I think the old code used stuff from fixed pipeline times
        and qt expects shaders as its modern opengl.

        If you look at
        http://doc.qt.io/qt-5/qtgui-openglwindow-example.html

        they use
        glVertexAttribPointer and other moden constructs.

        But its just a guess.

        T Offline
        T Offline
        taulant01
        wrote on last edited by
        #3

        @mrjj , can you please explain to me which are these "fixed pipeline times"... because I really can't understand what should I do with the link that you sent me :(

        I checked these glVertexAttribPointer, but what should I do with them?

        I am new in QT and in OpenGL, sorry for not understanding you

        mrjjM 1 Reply Last reply
        0
        • T taulant01

          @mrjj , can you please explain to me which are these "fixed pipeline times"... because I really can't understand what should I do with the link that you sent me :(

          I checked these glVertexAttribPointer, but what should I do with them?

          I am new in QT and in OpenGL, sorry for not understanding you

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @taulant01
          Sorry for not being clear.
          I think the sample uses old opengl calls for lighting and textures.

          The old way is called fixed pipeline. And new is called modern/programmable pipeline.

          Most (older) samples use the fixed style and it just don't work nowadays.

          please read
          http://www.gamedev.net/topic/466751-fixed-pipeline-vs-programmable-pipeline/

          For good info to learn opengl (modern)
          http://www.opengl-tutorial.org/

          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