Sign in to follow this  

Stuttering Framerate

Recommended Posts


Using XNA 4.0.

For my purposes, I need exactly one Update call for every Draw call. I also want the game to run at a maximum speed of 60Hz. I also want it to decrease as necessary. Currently, my attempt at doing most of this is:
this.IsFixedTimeStep = false;
this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, (int)Math.Round(1000.0f/60.0f));
In practice, I've found this works well enough. Usually.

When in a shader-heavy section of the game, the framerate appears fairly brisk, but then it stalls for a fraction of a second, throwing carefully timed events into a tizzy. This recurs, making the game unplayable. I don't understand this behavior. As far as I can tell, I'm not causing much garbage collection; the problem only seems to occur when running fragment-shader heavy code.

Help? Thanks,

Share this post

Link to post
Share on other sites

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