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. Drawing circles very fast

Drawing circles very fast

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.3k Views
  • 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.
  • C Offline
    C Offline
    Carvajal
    wrote on last edited by
    #1

    I want to draw almost 50000 circles in a widget, but it must be done very bast. Because i am simulating sand falling in an empty recipient. and for to make it realistic the program must draw every frame in an interval of 1ms. It read the coordinates and the radius of the circles from a file.
    Does somebody now a fast way to do it. I already tried with Direct2D and i got the same bad performance. Where is the performance leak.

    1 Reply Last reply
    0
    • ? This user is from outside of this forum
      ? This user is from outside of this forum
      Guest
      wrote on last edited by
      #2

      I suggest using OpenGL, you should get a nice performance boost since you don't have state changes - you render a single object - a circle. There is a very good video on optimizing OpenGL rendering in Qt here:
      https://qt-project.org/videos/watch/graphics-performance-best-practices

      It doesn't get any faster than this. Also, since Qt 4.8.0 OpenGL is multithreaded.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        1ms rendering interval? Forget it. Not going to happen, and nonsense at that. No screen is able to display those kinds of frame rates anyway, and no video card will keep up.

        1 Reply Last reply
        0
        • ? This user is from outside of this forum
          ? This user is from outside of this forum
          Guest
          wrote on last edited by
          #4

          On my PC the good old quake 3 runs at 1200 FPS, which is less than 1ms per frame. However the display actually displaying that much is a whole different story, since it is limited at 120 FPS, so I only get one frame displayed for every 10 frames rendered.

          It is certainly doable in terms of rendering. Displaying all the rendered data - not so much, the majority of displays are stuck at 60 Hz or about 16.6 msec.

          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