Stuttering Framerate

Started by
-1 comments, last by Geometrian 13 years, 4 months ago
Hi,

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,
-G

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

This topic is closed to new replies.

Advertisement