pouët.net

scrollpic stutters

category: general [glöplog]
hey,

i'm wondering if someone else has come accross the same problem. assume you have a (almost) static background scene with like 100 batches and lots of triangles. your demo runs with > 100 FPS on your system. now you add a slowly moving scrollpic (semi-transparent) in the foreground. instead of scrolling smooth, it is "stuttering" somehow. means moving smooth, then it looks like severe jumping for some pixels, then it moves normally again, etc.

i use a QueryPerformanceCounter to measure my times between frames and use this time to update the scrollpicture (as with all other effects) but it seems to stutter. i also tried to use a fixed step value, same stuttering as well. so it's not the timer. (at least my observation).

any ideas? hints? suggestions? thanks
added on the 2009-11-05 10:29:05 by prost prost
vsync.
added on the 2009-11-05 10:35:18 by xeron xeron
obvious, i tried that. same result.
added on the 2009-11-05 10:41:56 by prost prost
Use query performance counter only once, then always use the cached delta + vsync, then.
added on the 2009-11-05 10:43:20 by xeron xeron
yeah, but the delta may differ over time?
added on the 2009-11-05 10:47:08 by prost prost
does it work better in fullscreen mode?
added on the 2009-11-05 10:48:20 by smash smash
i tried vsynch again, and a fixed timestep, it still stutters. but it's less + it looks like my fps is always dropping to 56.xFPS (from 59.x FPS) when it stutters
added on the 2009-11-05 10:48:25 by prost prost
smash: no, same result :(
added on the 2009-11-05 10:48:43 by prost prost
got any crap running in the background?
added on the 2009-11-05 10:49:47 by havoc havoc
like, windows?

(sorry, coudn't resist)
added on the 2009-11-05 10:51:07 by v3nom v3nom
no, i tried that. (my gfs computer has the same prob)

ok, it looks better now. what i did:

- vsynch (by app)
- fixed timestep
- perform an occlusion query over the whole scene (to make sure buffers are finished. my demo is gpu bound as hell)

i still get stuttering here and then but only once in 10 seconds or so.

i'm just not sure if this is really the way to go, or if i am just hiding the problem.

other issue: i have a fixed timestep now, but what should i do when i get below 60 FPS?
added on the 2009-11-05 11:07:07 by prost prost
can you change the pre-render limit in your graphics card settings?
maybe it's some buffering issue.
added on the 2009-11-05 11:18:26 by gopher gopher
decade old kludge once more:

float smoothtime() {
static float A, B;
float tmp = shittytime();
A += (tmp-A)*0.1;
B += (tmp-B)*0.05;
return A*2-B;
}

tune magic constants to your taste.
added on the 2009-11-05 11:28:55 by 216 216
That is some really weird lookin' filter you got there 216!
added on the 2009-11-05 12:08:09 by trc_wm trc_wm
yeah looks almost perfect now, thanks a lot
added on the 2009-11-05 12:10:21 by prost prost
i had this same problem on blunderbuss and had to heavily smooth the frame delta to get it looking decent. very annoying.
added on the 2009-11-05 12:20:53 by smash smash
Ah yes, the good old fullscreen-scroll-issue. Something the Amiga could pull off with three lines of AMOS, but still a massive challenge to even the best TASM hacker on the PC. :)
added on the 2009-11-05 12:34:18 by gloom gloom
There is actually a lot to be said for fixed refresh rates.
added on the 2009-11-05 12:35:49 by xeron xeron
BTW, isn't QueryPerformanceCounter borked on multi-core systems?
added on the 2009-11-05 12:42:49 by trc_wm trc_wm
gloom: ability to scroll is inversely proportional to machine power...
added on the 2009-11-05 13:25:20 by psonice psonice
Yeah, the ZX81 is shit hot at it ;-)
added on the 2009-11-05 14:27:02 by xeron xeron
Humbug. You can do perfectly smooth scroll with 3 (relatively long) lines of gwbasic.
...as long as you keep scrolling the whole damn screen by integral number of pixels per frame and don't run anything stupid on the background, like emm386 or windows :)
added on the 2009-11-05 14:43:53 by 216 216
What I do is I call QueryPerformanceFrequency each time inside the loop. Reason: Modern CPUs tend to tune their speed according to their work load. Querying the frequency each time will ensure you accurate timing values.
added on the 2009-11-05 20:33:29 by xTr1m xTr1m
I have similar problems here. I will try the smoothing trick
added on the 2009-11-05 20:46:49 by mop mop
trc_wm, if you use queryPerformanceCounter wisely it works perfect on multicore systems aswell. You need to know why it's working strange on multicores to be able to prevent it.

I usually interpolate all my values with time so i get smooth data for most effects.
added on the 2009-11-06 07:57:35 by pantaloon pantaloon

login