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. OpenGLWindow vertical refresh rate of LCD
Forum Updated to NodeBB v4.3 + New Features

OpenGLWindow vertical refresh rate of LCD

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 617 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.
  • PsnarfP Offline
    PsnarfP Offline
    Psnarf
    wrote on last edited by
    #1

    https://doc.qt.io/qt-5/qopenglwindow.html contains this snippet:
    "...in the modern OpenGL world it is a much better choice to rely on synchronization to the vertical refresh rate of the display." I cannot seem to find the "vertical refresh rate" of my LCD display. Is that the same as the 5ms response time?

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

      Response time is the lag i.e. the time it takes for a signal that reaches the monitor to be physically visible. Refresh rate is how many frames can your monitor display per second (known as FPS in games). Those are not the same thing.

      The vast majority of usual consumer grade LCDs have a refresh rate of 60Hz, with some high end models, usually marketed for gaming, going up to 120, 144 or in rare cases over 200. Depending on your operating system you can usually find your current value in the display settings panel. Standalone displays also usually have an info section in their built in menu that shows current resolution and refresh rate.

      PsnarfP 1 Reply Last reply
      1
      • Chris KawaC Chris Kawa

        Response time is the lag i.e. the time it takes for a signal that reaches the monitor to be physically visible. Refresh rate is how many frames can your monitor display per second (known as FPS in games). Those are not the same thing.

        The vast majority of usual consumer grade LCDs have a refresh rate of 60Hz, with some high end models, usually marketed for gaming, going up to 120, 144 or in rare cases over 200. Depending on your operating system you can usually find your current value in the display settings panel. Standalone displays also usually have an info section in their built in menu that shows current resolution and refresh rate.

        PsnarfP Offline
        PsnarfP Offline
        Psnarf
        wrote on last edited by
        #3

        @Chris-Kawa Thank you for your courteous reply. The monitor is 1920x1080@60Hz, but do I need to synchronize to some signal? I only ran across QOpenGLWindow because the QVulkanWindow doc suggests it is like OpenGL. I suspect "vertical sync" is a vestige of cathode ray monitors. If I just send frames to the display at, say, 30fps, will it take care of synchronization? Do I need to wait for some signal to fire before tossing a frame at the monitor?

        PsnarfP 1 Reply Last reply
        0
        • PsnarfP Psnarf

          @Chris-Kawa Thank you for your courteous reply. The monitor is 1920x1080@60Hz, but do I need to synchronize to some signal? I only ran across QOpenGLWindow because the QVulkanWindow doc suggests it is like OpenGL. I suspect "vertical sync" is a vestige of cathode ray monitors. If I just send frames to the display at, say, 30fps, will it take care of synchronization? Do I need to wait for some signal to fire before tossing a frame at the monitor?

          PsnarfP Offline
          PsnarfP Offline
          Psnarf
          wrote on last edited by
          #4

          I think I found the answer to my question. The kernel driver takes care of buffer flips, the vertical scanout, vblank and all. I just have to worry about queueing frames faster than the eye can detect and let the kernel module do the busy work. Thank you for your help!

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

            Do I need to wait for some signal to fire before tossing a frame at the monitor?

            I talked about how it works some time ago here. It was about QPainter, but it's similar with OpenGL or Vulkan. As for synchronization, depending on your OS, graphics card and driver this can be controlled or set up at many different points. There's bunch of knobs and switches in the OS, driver and in your app through Qt or directly in OpenGL that you can play with. In the simplest case you just draw to the back buffer and OS takes care of a synced flip of the back buffer at your monitor's rate.

            With QOpenGLWindow this behavior is the default. See the documentation for setSwapInterval() and the paragraph about swapping buffers in QOpenGLWindow Detailed Description.

            I just have to worry about queueing frames faster than the eye can detect and let the kernel module do the busy work.

            Well no, that's not entirely true. For smoothest experience you should try to produce frames at the rate of your monitor. Not slower but also not faster. It's not immediately obvious but producing more frames than the display can actually display is not just wastful but, more importantly, produces jaggy result. I touched on this a bit with example here. That post is a bit dated and there are some pretty cool new techniques to get the smoothest results, but I think it gives a bit of a baseline on what to do or not do.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved