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. increase FPS for QOpenGLWidget
Forum Updated to NodeBB v4.3 + New Features

increase FPS for QOpenGLWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 4.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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi,

    I need to have 75 FPS to update my Oculus. So I connect a timer to the slot update but my FPS still limited at 60 FPS.

    this->time_.start();
    connect(&impl_->loopAt90FPS, SIGNAL(timeout()), this, SLOT(update()));
    this->loopAt75FPS.start(1000/75);
    
    
    void Viewer::paintGL() {
    // Render on HMD at 75 FPS
    qint64 time = impl_->time_.elapsed();
    
    this->currentScene_->update(time, time - impl_->lastTime_);
    this->currentScene_->renderOnHMD();
    this->currentScene_->render();
    
    this->lastTime_ = time;
    }
    

    regards,
    Robin

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

      I'm not familiar with Oculus SDK but from what I understand you pass it a framebuffer with a context or something like that?
      If that's the case then the update rate will be capped at what can be handled by the display used to swap the buffers. Just a wild guess but you would need a separate (possibly shared) context in which you swap the buffers in a rate of the oculus device.

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Yes, I compute two render to FBO (one per eye) and I send them to the oculus.
        My question is : why when I do this connect (connect(&this->loopAt75FPS, SIGNAL(timeout()), this, SLOT(update()));), my function paintGL is call at 60 FPS.

        I don't know how create two openGl context. :s

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

          @Robinsondesbois said:

          why when I do this connect (connect(&this->loopAt75FPS, SIGNAL(timeout()), this, SLOT(update()));), my function paintGL is call at 60 FPS.

          update() does not do any painting. All it does is schedule a repaint. So it doesn't matter if you call it 75 or 10000 times a second. At some point your app gets back to the event loop and if an update event is pending it calls updateGL, which calls glDraw, which calls your paintGL. At the end of glDraw Qt waits for a v-sync and swaps buffers. This won't happen more often than a physical display refresh rate is, which is 60Hz for most consumer displays.

          As for context creation take a look at QOpenGLContext class and its swapBuffers method.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            UpdateGL dosen't existe in QOpenGLWidget :s

            I look at QOpenGLContext. I can draw at 75 FPS my scene using swapBuffer and format.setSwapInterval(0); :)

            Thank a lot !
            Robin

            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