• Runtimes
  • Monogame animation issue without vsync

Hi, i use last monogame 3.8. I started monogame cross-platform project (OpenGL), installed spine runtimes (csharp and xna) and copy code frome monogame example.
Everything looks ok. But if i disable fixed framerate by this code in void Initialize()

graphics.SynchronizeWithVerticalRetrace = false;
IsFixedTimeStep = false;

Animations are not working now, jittering and pausing. What can i do if i need maximum framerate?

Related Discussions
...
  • Изменено

Unfortunately we could not reproduce this issue, when enabling graphics.SynchronizeWithVerticalRetrace = false; it still runs smoothly for us.

What is the second line IsFixedTimeStep = false; doing? This is not part of our example files.

The IsFixedTimeStep property controls whether the game attempts to run at a fixed frame rate. I set it to false to disable fixed framrate. And also off vsync

Are you playing back the game in windowed mode, or in full screen mode? If you are starting it in windowed mode, could you try running the game as release build and full screen mode?

This is my code addded to example. IsFixedTimeStep set to false, graphics.SynchronizeWithVerticalRetrace set to false.

protected override void Initialize()
{
    IsMouseVisible = true;
    graphics.SynchronizeWithVerticalRetrace = false;
    IsFixedTimeStep = false;
    graphics.PreferredBackBufferWidth = 1920;
    graphics.PreferredBackBufferHeight = 1080;
    graphics.IsFullScreen = true;
    graphics.ApplyChanges();
    
base.Initialize(); }

I recorded video. It is release build in full screen mode. Also I added FPS counter to see that fps is not fixed. Animations don't work.
https://youtu.be/PqryR0tYop0
But in fixed framerate mode (default) all works fine

Thanks for recording the video and for posting the code!

I just found the problem, ElapsedGameTime.Milliseconds was and int:

currentScreen.Render(gameTime.ElapsedGameTime.Milliseconds / 1000.0f); // this was the incorrect line
currentScreen.Render((float)(gameTime.ElapsedGameTime.TotalMilliseconds / 1000.0)); // this is the correct replacement

A bugfix has just been committed to the 3.8 branch. It will be merged to the 4.0-beta branch as well in the next few days.
Thanks very much for reporting!

Issue ticket for reference:
https://github.com/EsotericSoftware/spine-runtimes/issues/1868

Thanks! 🙂

You're welcome, thanks for reporting!