Vector vs. Raster Displays

References:

  1. Andy Johnson's CS 488 Course Notes, Lecture 1
  2. Foley, Van Dam, Feiner, and Hughes, "Computer Graphics - Principles and Practice", Chapter ??

Hardware

In this class we are going to concern ourselves with producing images on video screens rather than onto printers, or plotters since that allows a much greater amount of interactivity.

Convenient to think of models in mathematical terms but hardware brings CG back to reality.

Evolution of Video Display Hardware:

1.0 |     *
    |      *
    |       *
    |       *
0.5 |      *
    |     *
    |    *
    |   *
0.0 +---*----------
    |  *
    |  *
    |   *

 

You need to keep redrawing the image on the screen to keep it from fading away. Vector displays redraw as quickly as possible given the number of objects on the screen; CRT based raster displays redraw the image (or refresh the screen) at a fixed rate (e.g. 60 times per second) no matter how complex the scene.

For those who spent their early youth in the arcades, vector games included:

Initially these games were monocrome (white, green, or some other single color), as in asteroids, then coloured filters were used to colour different parts of the screen using the same monocrome electron gun as in Battlezone, and finally when RGB electron guns were cheap enough, true multi-colour vector games were possible.


Buffers in Raster Displays

Pretty much all CG done using raster displays. The screen is represented by a 2D array of elements

Frame buffer - array of computer memory used to store an image to be displayed

The user manipulates the values in the frame buffer.
60 times a second (or at some other fixed rate) the frame buffer is copied onto the display device.

If video screen is 512 pixels wide by 512 pixels tall the frame buffer must be able to store 512 X 512 elements ... one element for each pixel on the screen

monocrome display:

8 bit greyscale display:

24 bit colour display:

8 bit colour display using a colour map:

depth of frame buffer (e.g. 8 bit) determines number of simultaneous colours possible
width of colour map (e.g. 24 bit) determines number of colours that can be chosen from

Size of various frame buffers:


Hardware affects on computer animation

A program may take several minutes, hours, or days to render a single image. These images can then be stored and played back or recorded to create animation

A more interesting situation is when the animation is live with the computer generated image changing while the user watches, or as the user interacts with the computer.

To do the more interactive kind of animation you really need a SECOND frame buffer ... this is similar to how a motion picture works.

Movie theatre projectors show a new image 24 times per second in the following sequence; so the patron sees only the moving images, not the movement of the film through the projector:

  1. A new frame is moved in front of the lens
  2. the shutter is opened to display the frame
  3. the shutter is closed

In fact, at the movies you actually spend more time looking at a black screen than you do looking at an image. Now that we are starting to see digital cinema, where there is no physical film to move, which will move film more towards the way computers display images.

Similar problem in computer graphics. In the case of a film, each of the frames has already been generated and its just a question of showing them; whereas in interactive computer graphics the frames are being drawn one at a time. The frame buffer is regularly sent to the display device (eg 60 times per second) whether the frame buffer has been completely updated or not. We don't want the user to see the screen being cleared and the new image being drawn on the screen each time the display refreshes. We only want the user to see a sucession of completely drawn images.

Solution is to have two frame buffers.
User draws into one buffer while the other is being displayed.
When drawing is complete the buffers are swapped.
In OpenGL / Glut this is called "double buffering". It is set up with the GLUT_DOUBLE flag when initializing the display, and then the buffers are swapped with "glutSwapBuffers( )".

We can only swap buffers in between screen refreshes - when electron gun of the CRT is off and moving from bottom of screen to the top. Note that different CRT monitors refresh at different rates. Also note that as we move more towards LCD displays and away from CRT displays that the hardware changes, but there are still timing constraints. In the case of LCDs the refresh rate is only important when the images are changing. For more info on the two types of displays the following link gives a nice description: http://www.ncdot.org/network/developers/guide/display_tech.html

If you can clear the frame buffer and the draw scene in less than 1/60th second you will get 60 frames per second.

If it takes longer than 1/60th of a second to draw the image (e.g. 1/59th of a second) then by the time you are ready to swap frame buffers the electron gun is already redrawing the current frame buffer again, so you must wait for it to finish before swapping buffers (e.g. 1/30th of a second after the last swap buffers if the frame takes 1/59th of a second.)

If the screen refreshes 60 times a second you can have a new image on the screen:

One of the most obvious implications of this is that a very small change in the time it takes to draw a scene into the frame buffer can have a major impact on the speed of the application.

Can your program run at 45 frames per second (fps)?
Yes. if 30 frames take 1/60th each and the next 15 frames take 1/30th each you will display 45 frames per second.

For smooth motion you want at least 10 frames per second, and preferably more than 15 frames per second. More is better.