setVsync() dosen't seem to work in game engine

While coding in the game engine I tried to set the Vsync to on via the bge.render.setVsync() function using the constants from the api documentation and also directly with integer values but it dosen’t seem to work. Checking the getVsync() variable in game reports that it is still set to off.

My nvidia card is set to vsync disabled at the moment but I tried with it enabled as well with no difference.

I want to have the setting exposed to the user with out having to leave the game and having to change their video card settings.

A bug mabye? or mabye I’m just doing it wrong.

Any help would be appreciated. Thanks

Your graphics card settings might be overriding Blender/BGE. Most graphics cards have options like:

  • Let Application Decide
  • Always On
  • Always Off

So, if you have “Always Off,” then Blender’s setting wont make a difference.

I have to admit, that I think that vsync sometimes doesn’t run very well? Or is it just me?
Even if I have a constant framerate of 60fps tearing occurs sometimes… Has someone else experienced this?

Pretty sure vsync can only be applied after restarting a program window or before running it, which is why after applying vsync in games it has to reload the window.

@@ndee Have you enabled triple buffering? It might also be that your monitor is syncing at over or just below 60Hz (75Hz or 59.9Hz).
EDIT: Something I have noticed – not sure if it is the same thing – is strange “warping” when vsync is on, almost like an underwater effect.

A restart should not be required for vsync in Blender/BGE. However, I have had issues with composting window managers such as Kwin. I was getting tearing even with vsync enabled in the application until I changed some settings in Kwin.

I have tried setting the videocard card to application controlled, off, on , and adaptive. None made a difference. Vsync is still reported as off no matter the setting for the videocard. I restarted the entire editor before each test with it still not working.

I am using Windows 8 64-bit, Nvidia 311.06 from Windows update. Blender 2.69

I’m pretty sure its in the Blender as I can turn vsync on/off without any problems in the games I have installed on the same pc.

Does anyone have any blends where the setVsync and getVsync functions work in them for their application on their pc?

BTW Triple buffering is set to off, I’ll give it a try with it on once and see what happens.

WTF, there is a Vsync setting in the panel?? I just upgraded to 2.69 last night to get it to work and there is now a setting in the render panel and it seems to work correctly. Sweet. Thanks for all your help guys.