Sign in to follow this  

Frame timing problem

This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having a problem with time-based animation in Managed DirectX. If i use SwapEffect.Copy everything works fine and I get smooth animation, but when I use SwapEffect.Discard the game gets really jerky(especailly when other programs are running in the background). I didn't think this could make a difference as far as timing goes, but it is the only thing I change and my animation goes from smooth to extremely choppy. Does anyone know what causes this and how to fix it?

Share this post


Link to post
Share on other sites
I have found that discard is faster than copy, which can make your framerate faster (perhaps?) and possibly more irregular, such as some annoying multiple of your refresh rate. In other words, perhaps copy is slower to the point where it dominates the framerate (but in a consistent way). Maybe not.

Have you tried some sort of frame-time filtering or averaging to smooth out hiccups in frame times? Even something simple like 'current frametime = newtime * 0.5 + oldtime * 0.5' might help.

Share this post


Link to post
Share on other sites
I thought about making a time averaging function. But its gonna be kinda complicated since I'm using a thread with fixed time-step animation then my drawing thread interpolates between the fixed-time steps based to create smooth time-based animation. But I'll have to try that next.

Share this post


Link to post
Share on other sites

This topic is 4686 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this