Jumpy movement with fixed timesteps

Started by
24 comments, last by krippy2k8 11 years, 9 months ago
Yes, I'm using Win7.

I'm still only seeing it jump rarely - maybe once every 10-20 seconds, but when I do it always seems to correspond to a timing issue. i.e. on my system with a 60hz refresh rate, I'm seeing a typical frame time of ~0.0167 seconds. Whenever a jump occurs I'm seeing a frame time of something like 0.04 followed by a couple of short frames like 0.006 or 0.004.

So if what I'm seeing is the same as what you're seeing, then the issue is probably not your code. It's probably SwapBuffers blocking for more than one refresh and then compensating, which would explain why it's not happening when you turn off vsync.

Update: checking the timer before and after the call to RenderWindow.SwapBuffers indicates that this is indeed where the lag is occurring.
Advertisement

Yes, I'm using Win7.

I'm still only seeing it jump rarely - maybe once every 10-20 seconds, but when I do it always seems to correspond to a timing issue. i.e. on my system with a 60hz refresh rate, I'm seeing a typical frame time of ~0.0167 seconds. Whenever a jump occurs I'm seeing a frame time of something like 0.04 followed by a couple of short frames like 0.006 or 0.004.

So if what I'm seeing is the same as what you're seeing, then the issue is probably not your code. It's probably SwapBuffers blocking for more than one refresh and then compensating, which would explain why it's not happening when you turn off vsync.

Update: checking the timer before and after the call to RenderWindow.SwapBuffers indicates that this is indeed where the lag is occurring.


Well i see a terrible amount of jump, not what you describe. Oddly enough it disappears when i disable desktop composition i get something perhaps similar to what you say, smooth with perhaps a small skip every now and then, but i would say that is to be expected? So the question almost points to some driver/OpenGL issue i think, i might take this into the OpenGL forum if that is the case.

I tried it on another PC, something not to fast with an ATI card and it seems fine. Sadly this seems related to an issue i had even when using SlimDX, something about Win7, vsync, and dual monitors is causing funky issues.


Update: checking the timer before and after the call to RenderWindow.SwapBuffers indicates that this is indeed where the lag is occurring.
[/quote]

Swapbuffers is supposed to block with vsync, spo unless it is an inordinate amount of time i would say this is expected.

Swapbuffers is supposed to block with vsync, spo unless it is an inordinate amount of time i would say this is expected.


Of course, but it's not supposed to block for longer than 1 refresh and then not block for the next 2 calls. Possibly normal since MS doesn't give WGL much attention, though. I don't see it happen with DX.

Your probably is likely a driver issue as you suggest. The code is fine.
Sounds like the driver might be doing triple buffering in the background
Iv been able to eliminate this issue in another way, rendering more boxes...i render 1000 of teh same box in the same place and the stutter vanishes, its as if the GPU is getting ahead of itself or something.
Throwing a Sleep call in there would probably do the same thing.

This topic is closed to new replies.

Advertisement