Hello, I’ve been trying to find out some things about vsync. I was researching some issues about the Unity camera jitter as well as some tearing. I somehow came to find out about vsync, but I don’t really know how to apply it and there is not much information in the docs (I know you can do project settings but what does that do exactly) So can anyone point me towards some information about vsync and will it fix my jittering camera problem?
Vsync just limits the framerate to whatever your monitor can handle. If you don’t use it, the graphics card will just render frames as fast as possible, even if it’s faster than the monitor can display. With vsync on, it will render a frame and update it during the vertical blanking period, which (when CRTs were the standard) was when the beam was transitioning from the bottom right corner of the screen to the top right. If you didn’t use vysnc the video buffer could be updated in the middle of a screen draw and result in tearing (because the top half of the monitor would be displaying one frame while the bottom half would be displaying another). I’m not sure if tearing is still an issue with LCD monitors or not.
No idea if it will fix your jittering camera problem, try turning it on and see.
you do edit it in the project settings right? is there anyway to set the specified framerate?
It’s still an issue; LCD monitors can’t update all the pixels at once. In any case there’s no point rendering more frames than the monitor can display, especially on mobile devices since it wastes battery and generates heat.
No, because it depends on the monitor.
–Eric
Ok, thank you for your answers. the tearing seems to have gone away, but the camera must have something to do with movement. Thanks again.
Hey TehWut, just to let you know, you can in fact specify a target framerate for your game. Note the key operating word: target.
Application.targetFrameRate = 60;
Will set the targeted rendering rate of the frames per second to 60, but this is just a ‘target’ rate. For your game to reach this target you will need to understand which elements of your game effect performance and if running on devices, how much video memory they have.
QualitySettings.vSyncCount = 1;
In combination with the above command will force the game to only update frames in sync with the refresh rate of the monitor/screen. So, having a target framerate of 60FPS on an older monitor that only supports 30FPS can be a huge waste of resources, and impact performance.
Enabling vSync is thus, normally, a good idea (leave it at 1, not 0) as even if you specify a high frame rate, the the game will only render frames at the maximum rate supported by the monitor. This also allows for ‘dynamic frame rate rendering’ (a game with the above settings will run at 60FPS on devices/monitors that support it but only 30FPS on older devices/monitors that do not).
Hey may have found his answer after 3 years