lecture 3
lecture 3
Interactive raster graphics systems typically employ several processing units. In addition
to the CPU, a special purpose processor, called the video controller or display
controller is used to control the operation of the display device.
Organization of a simple raster system is shown in following figure. Here the frame
buffer can be anywhere in the system memory, and the video controller accesses the
frame buffer to refresh the screen.
In addition to the video controller more sophisticated raster systems employ other
processors as coprocessors and accelerators to implement various graphics operations.
Video Controller
Following figure shows a commonly used organization for raster systems. A fixed area of
the system memory is reserved for the frame buffer, and the video controller is given
direct access to the frame-buffer memory.
34
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
In the following figure the basic refresh operations of the video controller are
diagrammed. Two registers are used to store the coordinates of the screen pixels. Initially,
the x register is set to 0 and the y register is set to ymax. The value stored in the frame
buffer for this pixel position is then retrieved and used to set the intensity of the CRT
beam. Then the x register is incremented by 1, and the process repeated for the next pixel
on the top scan line. This procedure is repeated for each pixel along the next line by
resetting x register to 0 and decrementing the y register by 1. Pixels along this scan line
are then processed in turn, and the procedure is repeated for each successive scan line.
After cycling through all pixels along the bottom scan line y=0, the video controller resets
to the first pixel position on the top scan line and the refresh process starts over.
Register X Register Y
Frame Buffer
Basic Video Controller Refresh Operations
Since the screen must be refreshed at the rate of 60 frames per second, the simple
procedure illustrated in above figure cannot be accommodated by typical RAM chips.
The cycle time is too large making the process very slow. To speed up pixel processing,
video controllers can retrieve multiple pixel values from the refresh buffer on each pass.
35
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
The multiple pixel intensities are then stored in a separate register and used to control the
CRT beam intensity for a group of adjacent pixels. When that group of pixels has been
processed, the next block of pixel values is retrieved from the frame buffer.
System Bus
I/O Devices
Raster-Scan Characters
Graphics commands specifying straight lines and other geometric objects are scan
converted into a set of discrete intensity points. Scan converting a straight-line segment,
for example, means that we have to locate the pixel positions closest to the line path and
store the intensity for each position in the frame buffer. Similar methods are used for scan
converting curved lines and polygon outlines.
Characters can be defined with rectangular grids, as shown in following figure, or they
can be defined with curved outlines shown in the right hand side figure given below. The
array size for character grids can vary from about 5 by 7 to 9 by 12 or more for higher-
quality displays. A character grid is displayed by superimposing the rectangular grid
pattern into the frame buffer at a specified coordinate position. With characters that are
defined as curve outlines, character shapes are scan converted into the frame buffer.
36
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
Monitor
CPU System Display
Memory Processor
System Bus
I/O Devices
A video display adapter which is the special printed circuit board that plugs into one of
the several expansion slots present on the mother board of the computer. A video display
adapter is simply referred as a video card.
37
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
The video card can also be an integral part of the system board; this is the case in certain
brands of PCs and is always the case in laptops and clear preference for the replaceable
video card in some PCs.
A number of display adapters are available with varying capabilities especially Intel
systems support following adapters:
Monochrome Adapter
The simplest and the first available adapter is MA. This adapter can display only text in
single color and has no graphics displaying capability. Originally this drawback only
prevented the users from playing video games, but today, even the most serious business
software uses graphics and color to great advantage. Hence, MA is no longer suitable,
though it offers clarity and high resolution.
Hercules Adapter
The Hercules card emulates the monochrome adapter but also operates in a graphics
mode. Having graphics capabilities the Hercules card became somewhat of a standard for
monochrome systems.
Medium resolution graphics mode 320 * 200 with 4 colors available from palette
of 16 colors
and 640 * 200 with 2 colors
One drawback of CGA card is that it produces flicker and snow. Flicker is the annoying
tendency of the text to flash as it moves up or down. Snow is the flurry of bright dots that
can appear anywhere on the screen.
The EGA card has several internal registers. A serious limitation of the EGA card is that
it supports write operations to most of its internal registers, but no read operation. The
result is it is not possible for software to detect and preserve the state of the adapter,
38
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
which makes EGA unsuited for memory resident application or for multitasking like
windows and OS/2.
39
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
How much RAM? That is significant for color depth at the highest resolutions.
Which type of RAM? This is significant for card speed.
Video card RAM is necessary to keep the entire screen image in memory. The CPU sends
its data to the video card. The video processor forms a picture of the screen image and
stores it in the frame buffer. This picture is a large bit map. It is used to continually
update the screen image.
3D - lots of RAM
Supporting the demand for high quality 3D performance many new cards come with a
frame buffer of 16 or 32 MB RAM and they use the AGP interface for better bandwidth
and access to the main memory.
VRAM
Briefly, in principle all common RAM types can be used on the video card. Most cards
use very fast editions of ordinary RAM (SDRAM or DDR).
Some high end cards (like Matrox Millennium II) earlier used special VRAM (Video
RAM) chips. This was a RAM type, which only was used on video cards. In principle, a
VRAM cell is made up of two ordinary RAM cells, which are "glued" together.
Therefore, you use twice as much RAM than otherwise.
VRAM also costs twice as much. The smart feature is that the double cell allows the
video processor to simultaneously read old and write new data on the same RAM address.
Thus, VRAM has two gates which can be active at the same time. Therefore, it works
significantly faster.
With VRAM you will not gain speed improvements increasing the amount of RAM on
the graphics controller. VRAM is already capable of reading and writing simultaneously
due to the dual port design.
UMA and DVMT
On some older motherboards the video controller was integrated. Using SMBA (Shared
Memory Buffer Architecture) or UMA (Unified Memory Architecture) in which parts of
40
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
the system RAM were allocated and used as frame buffer. But sharing the memory was
very slow and the standards never became very popular.
A newer version of this is found in Intel chip set 810 and the better 815, which also
integrates the graphics controller and use parts of the system RAM as frame buffer. Here
the system is called Dynamic Video Memory Technology (D.V.M.T.).
The RAMDAC
All traditional graphics cards have a RAMDAC chip converting the signals from digital
to analog form. CRT monitors work on analog signals. The PC works with digital data
which are sent to the graphics adapter. Before these signals are sent to the monitor they
have to be converted into analog
output and this is processed in the
RAMDAC:
As each screen image was a large bit map, the CPU had to move a lot of data from RAM
to the video card for each new screen image.
The graphic interfaces, like Windows, gained popularity in the early nineties. That
marked the end of the "flat" VGA cards. The PC became incredibly slow, when the CPU
had to use all its energy to produce screen images. You can try to calculate the required
amount of data.
A screen image in 1024 x 768 in 16 bit color is a 1.5 MB bit map. That is calculated as
1024 x 768 x 2 bytes. Each image change (with a refresh rate of 75 HZ there is 75 of
them each second) requires the movement of 1.5 MB data. That zaps the PC energy,
especially when we talk about games with continual image changes.
Furthermore, screen data have to be moved across the I/O bus. In the early nineties, we
did not have the PCI and AGP buses, which could move large volumes of data. The
transfer took place through the ISA bus, which has a very limited width. Additionally the
CPUs were 386’s and early 486’s, which also had limited power.
Accelerator Cards
In the early nineties the accelerator video cards appeared. Today all cards are accelerated
and they are connected to the CPU through high speed buses like PCI and AGP.
41
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
With accelerated video chips, Windows (and with that the CPU) need not calculate and
design the entire bit map from image to image. The video card is programmed to draw
lines, Windows and other image elements.
All video cards are connected to the PCI or the AGP bus, this way providing maximum
data transmission. The AGP bus is an expanded and improved version of the PCI bus -
used for video cards only.
Modern video cards made for 3D gaming use expensive high-end RAM to secure a
sufficient bandwidth. If you for example want to see a game in a resolution of 1280 x
1024 at 80 Hz, you may need to move 400 MB of data each second - that is quite a lot.
The calculation goes like this:
Graphics Libraries
Graphics developers some time use 2D or 3D libraries to create graphics rapidly and
efficiently. These developers include game developers, animators, designers etc.
FastGL
OpenGL
DirectX
Others
42
© Copyright Virtual University of Pakistan
3-Graphics Systems II VU
These libraries help developers to create fast and optimized animations and also help to
access features that are available in video hardware.
Graphics Software
There is a lot of 2D and 3D software available in the market. These software provide
visual interface for creation of 2D and 3D animation / models image creation. These tools
are under use of movie makers, professional animators and designers.
These tools are flash, Maya, 3D studio max, adobe photo shop, CorelDraw, image viewer,
paintbrush etc.
43
© Copyright Virtual University of Pakistan