136
Video Game Design Foundations
When the refresh rate is too low, the human eye will see flickering on
the screen.
Flickering
occurs because portions of the screen are not being
illuminated quickly enough and black from nonilluminated pixels shows.
This differs from tearing. Video
tearing
occurs when frames are out of sync
or are only partially refreshed. When the packets of video data are sent to
the monitor, some of them do not get to the monitor and the image is only
partially refreshed. The solution to tearing is using a multiple buffering
system, such as double buffering, to assure that the image displayed on the
screen is complete.
Double buffering
requires two buffers, called the front buffer and the
back buffer. The front buffer contains the composite image being displayed on
the screen. The back buffer feeds to the front buffer only the segments of the
composite image that have changed. Instead of having to rewrite the entire
front buffer data, only the changed pixels are uploaded to the front buffer. This
keeps the computer only reading front buffer data. The back buffer contains all
preloaded data that can be changed on the screen.
To understand this, think about a game like Pong. Most of the screen
remains the same throughout the game. CPU load will decrease if the back
buffer only sends information to change the front buffer, for example to add
white pixels where the ball moved, black pixels where the ball was before, new
pixels for the score, and new pixels for paddles.
Figure 4-15.
Goodheart-Willcox Publisher
As a video is downloaded for streaming in an Internet browser,
the data bar shows the current position of the video as well as the
downloaded amount in the buffer.