My project is still in its early stages. The game really isnt doing any heavy lifting yet.
Almost all of my game logic is run via coroutines (and not in the update method)
In the editor, my game plays great with +100fps
In a build the game stutters and almost every other frame. (FPS drops to ~30)
In my investigation, I disabled vsync and made a build. This build ran at +100FPS
So I returned to vsync to see the effect it’s having on my game.
vsync off
FPS = +100FPS
vsynch every v blank
FPS = ~30FPS
vsync every second v blank
FPS = ~15FPS
I understand that vsync is there to delay the draw to prevent screen tearing, but this seems heavy price with game breaking stutter.
Is it a bug? is vsync broken?
Or is there something I’m missing?
This sounds correct to me. Looks like Vsync is locking your frame rate to the monitor refresh rate / requested frame rate.
Trying setting your Application.targetFrameRate to 60 or higher.
FYI, Gfx.WaitForPresent() is the GPU idling while the CPU waits to show the frame buffer.
I agree that vsync should wait for target framerate, but if thats the case its doing so a little heavy handed as im seeing stuttering in my gameplay logic. (which are in coroutines not the update)