|
How v-syncing works The framebuffer contains the image that's shown on-screen; to change what's on-screen, the contents of the frame buffer are modified. The video card reads through the frame buffer sequentially to send the image to the monitor. These two processes—updating the frame buffer and reading the buffer—are normally independent. Modifications can be made to the framebuffer concurrently with reads from it. This can have unfortunate consequences if an update is made part-way through a read of the framebuffer; the frame buffer could start off containing one image, which is then partially sent to the screen, and could then switch to a different image, which will also be partially sent to the screen. This is visible as "tearing" during animations; the top half of the screen shows one frame of an animation, the bottom half another, because the framebuffer's contents were switched from one frame to the other in the middle of the read. This tearing is undesirable, as it makes animation look jerky and ugly. However, there is a way to avoid it, by taking advantage of moments during which the framebuffer isn't being read. The data from the framebuffer is not read continuously. Instead, there is a short delay between the reading of each screen's worth of data, which originates from the use of CRTs. The magnets in a CRT cannot move the electron beam instantaneously. When the beam has reached the bottom line of the screen as it finishes a frame, it takes a short time to move back up to the top of the screen where it can begin the next frame. During this brief interval—named the vertical blank interval—nothing is being displayed on-screen, and correspondingly, nothing is being read from the framebuffer. Updates can therefore be made to the framebuffer without any risk of causing any tearing artefacts by ensuring that the updates are made during the vertical blank interval. This process of synchronizing framebuffer updates with vertical blanking is called v-syncing.
|