deMarco
14th January 2009, 06:46
Hi,
I've been making a pong clone using a QGraphicsView, but i seem to have an issue with moving objects rapidly within the view e.g. the ball, which i have updating around 40Hz.
1/ it's blurry.. I expect abit of blur because of the movement, but it seems as if the ball is being painted in it's new position, before the old position has been repainted, ie for an instant it's in two places at once. It makes it kinda difficult to focus (literally) on the ball, though some of this may be subjective.
2/ there's tearing/artifacting. not all the time, but if you watch the ball for 10s or so you'll see it.
I've tried playing around with different caching modes, on both the ball graphicsItem and the graphicsScene itself, but with little success. I've also tried disabling the viewport updates and managing the updating myself, but the same problems occur.
I've included a sandbox example of a ball bouncing around so you can check it out (only compiles for windows, sorry), i must be doing something obvious wrong, as i know GV can handle thousands of items, surely it can handle one fast ball?!
I've been making a pong clone using a QGraphicsView, but i seem to have an issue with moving objects rapidly within the view e.g. the ball, which i have updating around 40Hz.
1/ it's blurry.. I expect abit of blur because of the movement, but it seems as if the ball is being painted in it's new position, before the old position has been repainted, ie for an instant it's in two places at once. It makes it kinda difficult to focus (literally) on the ball, though some of this may be subjective.
2/ there's tearing/artifacting. not all the time, but if you watch the ball for 10s or so you'll see it.
I've tried playing around with different caching modes, on both the ball graphicsItem and the graphicsScene itself, but with little success. I've also tried disabling the viewport updates and managing the updating myself, but the same problems occur.
I've included a sandbox example of a ball bouncing around so you can check it out (only compiles for windows, sorry), i must be doing something obvious wrong, as i know GV can handle thousands of items, surely it can handle one fast ball?!