Computer Graphics Chapter 2 Graphics Systems Andreas Savva
Development of Hardware • Hardware evolution had a greater influence in the development of Computer Graphics than software. • In the early years interactive graphics was beyond the recourses of most organizations because of: • the high cost of computer graphics hardware – a car cost a few thousand pounds whereas a computer cost several million pounds, • the need for expensive computing recourses to support massive design databases, interactive picture manipulation, • the difficulty of writing large, interactive programs at a time when both graphics and interaction where new to predominantly batch-oriented FORTRAN programmers, • non-portable software – written for a particular display device without software-engineering principles and structured systems. Moving to new display devices necessitates expensive and time-consuming rewriting of working programs. • After the development of graphics-based personal computers (Apple Macintosh, IBM PC) hardware and software cost was driven down, and millions of graphics computers where sold for office and home use.
Video Display Devices • The primary output device in a graphical system is the video monitor.
Focusing System Y deflect Base Phosphor x deflect Connector Pins Control grid voltage Electron Gun Cathode-ray tubes (CRT)
Basic operations of a CRT Steps • The electron gun emits a beam of electrons (cathode rays). • The electron beam passes through focusing and deflection systems that direct it towards specified positions on the phosphor-coated screen. • When the beam hits the screen, the phosphor emits a small spot of light at each position contacted by the electron beam. Because the light emitted by the phosphor fades very quickly some method is needed for maintaining the screen picture. • Redraw the picture by quickly directing the electron beam back over the same screen points.
Phosphor Persistence • Definition:The time from the initial light output to the moment when has decayed to its 10%. • There are different kind of phosphors for use in a CRT. Besides color, a major difference is their persistence – how long they continue to emit light after the CRT beam is removed. • A phosphor with low-persistence is useful in animation. • A high-persistence phosphor is useful for displaying highly complex, static pictures. • Graphics monitors are usually constructed with a persistence in the range from 10 to 60 microseconds.
The intensity is greater at the center of the spot, and it decreases with Gaussian distribution out to the edges of the spot. Two illuminated phosphor spots are distinguishable when their separation is greater than the diameter at which a spot intensity has fallen to 60% of maximum (at the center of the spot). Brightness (Intensity) distributionof a phosphor spot on the screen
Raster Scan Displays • Developed in the early seventies. • It is today's dominant hardware technology. Almost all graphics systems are raster-based. • A picture is produced as an array – the raster – of picture elements. • This elements are called PixelsorPels (Picture Elements). A pixel corresponds to a location, or small area, in the image. • Collectively, the pixels are stored in a part of memory called the refresh buffer or frame buffer.
Resolution • The maximum number of points (pixels) that can be displayed without overlap on a screen is referred to as the resolution, and determines the detail that can be seen in an image. • A more precise definition is the number of points per centimeter that can be plotted horizontally and vertically, although it is often simply stated as the total number of points in each direction (i.e. 1280 1024). • The physical size of a graphics monitor, on the other hand, is given as the length (in inches) of the screen diagonal.
The aspect ratio gives the ratio of vertical points to horizontal points necessary to produce equal-length lines in both directions on the screen. So 4:3 (most common) means that a vertical line plotted with 4 points has the same length as a horizontal line plotted with 3 points.
0 800 0 x 600 y The Frame Buffer spot at (x,y) pixel at address (x,y) Frame buffer Display surface at (800,600)
Refresh Rate • Definition:The number of times per second the image is redrawn. • The entire contents of the frame buffer are displayed on the CRT at a rate high enough to avoid flicker. This rate is called the refresh rate. • For a human to see a steady image on most CRT displays, the same path must be retraced, or refreshed, by the beam at least 60 times per second. • Current raster-scan displays perform refreshing at the rate of 60 to 80 frames per second, although some systems now have refresh rates of up to 120 frames per second. • Refresh rates are described in units of cycles per second, or Hertz (Hz), where a cycle corresponds to one frame (i.e. a refresh rate of 60 frames per second = 60 Hz).
Refresh-rate for films and TV • The display technology on a monitor is different from that of film. • A film projector can maintain the continues display of a film frame until the next frame is brought into view. • On a video monitor a phosphor spot begins to decay as soon as it is illuminated. • On films, below 24 frames per second, we can perceive a gap between successive screen images. • Old silent films show flicker because they where photographed at a rate of 16 frames per second. • When sound systems were developed in the 1920s, motion picture film rates increased to 24 frames per second removing flickering. • Today TV refresh rate is 25 frames per second in Europe and 30 frames per second in the USA.
The depth (or intensity) of the frame buffer, defined as the number of bits that are used for each pixel, determines properties such as how many colors can be represented on a given system. 1-bit-deep frame buffer allows 21 colors (black and white) 8-bit-deep frame buffer allows 28 (=256) colors In full color systems (also called RGB-color systems), there are 24 (or more) bits per pixel in order to display sufficient colors to represent most images realistically.
0 800 0 x 600 y Scanning Approaches
Scan line Horizontal retrace Vertical retrace Raster Scan Displays • Electron beam “paints” the picture on screen one line at a time. 000000000000000000000 000000000111000000000 000000111111111000000 000111111111111111000 000111110000011111000 000111111111111111000 000111111000111111000 000111111000111111000 000111111000111111000 000111111000111111000 000111111111111111000 000000000000000000000
Raster Scan Displays • They are based on TV technology • Refresh rate = 60 to 80 frames per second. Note: Below 24 frames/second, eye detects flicker. • Each screen point is visited every refresh cycle. • Their capability to store intensity information for each screen point makes them well suited for the realistic display of scenes containing shading and color patterns. • The frame-buffer with 1-bit intensity is called a bitmap. • The frame-buffer with multiple-bits intensity is called a pixmap.
0 1 2 3 4 5 6 Interlaced Raster Scan Displays • Odd/even scan lines covered in successive refresh cycles. • Hence 30 frames/sec refresh rate appears like 60 frames/sec.
MoveTo (300,800) LineTo (700,800) LineTo (500,300) LineTo (300,800) Random-Scan (Vector) displays • Vector stands for line. • Developed in the mid-sixties and in common use until the mid-eighties. • The electron beam is directed only to parts of the screen where the picture is to be drawn.
Random Scan Displays • Picture is stored as a set of point- and line-drawing commands with (x,y) or (x,y,z) endpoint coordinates, as well as character-plotting commands. • Refresh rate depends on the number of lines to be displayed. To avoid flicker it must be at least 30 times per second (30 Hz). • They are designed to draw all the component lines of a picture 30 to 60 times per second – more than 60 could burn the phosphor. • High quality vector systems are capable of handling approximately 100,000 lines at this refresh rate. • They are designed for line drawing applications and cannot display realistic shaded images.
Ideal line drawing Random scan Raster scan Raster Scan Vs Random Scan
The Bit-map1-bit-deep frame-buffer Frame buffer Pixels
00 01 10 11 Color image 8-bit per pixel 256 gray level 1-bit per pixel 2 gray levels Black & White Gray Level images • n-bits per pixel produce 2n gray levels. • Many images use 8-bits per pixel, i.e. 256 gray levels since it gives acceptable quality. 2-bit per pixel 4 gray level
Color Images • Produce realistic images. • Cost of high-quality color displays has decreased. • Cost of scanners that digitize color photos has decreased. • Each pixel in a color image has a “color value” which is a combination of amounts of red, green and blue. • Each pixel value is an ordered triple, such as (23,14,51), that prescribes the densities of the red, green and blue. • Each value in the triple (RGB) has a certain number of bits, and color depth is the sum of these values.
x pixel value y The Color Depth • Many images have a color depth of eight (one byte), 3 bits for the red and the green and 2 bits for the blue. Each pixel has one of 256 colors. • In highest quality (true-color) images, have a color depth of 24, one byte for each component. • This achieves the best color production the eye can perceive: More bits do not improve an image. • However, such images require a lot of memory. A true-color image of 1,080 1,024 pixels requires over 3 million bytes. Color depth = 6 bits 26 (= 64) colors
Common Colors Color depth of three One bit for each component
2 3 1 4 Red – Green - Blue • Color CRTs have three different colored phosphors (red, green, blue) usually arranged in triangular (delta) groups called triads. • A metal screen with small holes – the shadow mask – allows electrons from each gun to hit only corresponding phosphors dots (of the proper color).
Flat Panel Displays • All flat panel displays are raster refresh displays. • Divided into two categories: • Active – light emitting discharge (e.g. Flat CRTs, Plasma-gas) • Passive – light modulating (e.g. Liquid crystal)
Flat CRT • Initially projecting the electron beam parallel to the screen and then reflecting it through 90º. • It has all the performance advantages of the conventional CRT. • Available only in small sizes.
Liquid-Crystal Display (LCD) • It is a flat panel display. • It is a thin, lightweight display device. • It has no moving parts. • It consists of an electrically-controlled light-polarising liquid trapped in cells between two transparent polarising sheets. • An electric current passed through the liquid causes the crystals to align or not so that light can/cannot pass through them. Each crystal, therefore, is like a shutter, either allowing light to pass through or blocking the light.
Liquid-Crystal Display (LCD) • Made up of six layers: • Vertical filter film to polarize the light as it enters. • Glass substrate with ITO electrodes which lines up with the vertical filter. The shapes of these electrodes will determine the shapes on the LCD. • Twisted liquid crystals. • Glass substrate with common electrode film (ITO) which lines up with the horizontal filter. • Horizontal filter film to block/allow through light. • Reflective surface to send light back to viewer.
CRT vs LCD • Physical Size,Weight – An LCD has one third the size of a CRT, and it is much lighter. • Display Size – LCDs are sized by their actual viewable diagonal measurement, but CRTs are not. E.g. the viewable area on a 17" LCD monitor will measure 17" diagonally, but the viewable area on a CRT monitor will only measure 16" diagonally. • Colours – Most CRT monitors are capable of displaying unlimited colours. Some LCD monitors are only capable of hundreds or thousands of colours, but many of the newer LCD's are capable of unlimited colours. • Resolution – CRT monitors are usually capable of displaying multiple video resolutions, each with the same quality. LCD monitors, however, usually have what is called a Native resolution, or the resolution that it displays best. The native resolution is generally the highest resolution that the LCD can display.
CRT vs LCD • Viewing Angle –A CRT screen can be looked at from a very wide angle, practically from the side, but an LCD monitor typically has a smaller viewing angle. From the side, the image on an LCD screen can seem to disappear, or invert colours. Newer displays that are coming out have wider viewing angles. • Brightness is not a concern with CRT monitors. LCD monitors have different levels of brightness. The brightness rating for an LCD monitor is commonly referred to as 'nits', and commonly range from 70 to 300 nits. The higher the nits, the brighter the display. • Power Consumption and Radiation Emission – LCD monitors consume much less energy than CRT monitors. Secondly, CRT monitors are known to emit harmful radiation, whereas LCD monitors do not. • Price – CRT monitors are more affordable than LCD monitors. However the LCD’s cost have come down quite a lot in the last 1-2 years. An LCD monitor will cost more but will conserve energy in the long run. The energy savings may not be much for an individual user, but with a corporation the energy savings might be more of an issue.
Plasma or Gas Discharge Display • Consists of a matrix of cells (the raster) in a class envelope. Each cell is filled with a gas (usually neon, or a neon/argon mixture) at low pressure (below atmospheric). • When a sufficiently high voltage is applied the gas dissociates, i.e. electrons are stripped from the atoms. The dissociated gas is called a plasma, hence the name plasma display. • When the electrons recombine, energy is released in the form of photons; and the gas glows. • Plasma displays have large size and are high resolution displays (100 pixels/inch).
Thin Film Transistor (TFT) • A type of LCD flat-panel display screen, in which each pixel is controlled by from one to four transistors. • The TFT technology provides the best resolution of all the flat-panel techniques. • It is the most expensive display. • TFT screens are active-matrixLCDs.
Projected 3D Image Timing and Control System Vibrating Flexible Mirror CRT Viewer Three-DimensionalViewing Devices • Operation of a 3D display system using a vibrating mirror that changes focal length to match the depths of points in a scene.
Stereoscopic and Virtual-Reality Systems • A 3D object is displayed in a stereoscopic view. It presents a different view to each eye of an observer so that scenes appear to have depth. • The two views of a scenes are generated with viewing directions along the lines from the position of each eye (left and right) to the scene. • The two views merge into a single image and we perceive a scene with depth. • The scene is viewed through glasses , with each lens designed to act as rapidly alternating shutter that is synchronized to block out one of the views.
A Graphical System • The frame buffer is implemented with special types of memory chips that enable fast redisplay of its contents: • Video Random-Access Memory (VRAM) or • Dynamic Random-Access Memory (DRAM). • In simpler systems, the frame buffer is part of standard memory.
Animation • Animation is the process of creating images that appear to move. • The illusion of movement is created by displaying a sequence of still images faster than a certain rate, which is around 24 images per second. This happens because when a single image is flashed at the eye, it is retained by the brain longer than it is actually registered on the retina. • Thus, if the second image is flashed within a certain minimum time, the brain still retains the last image, and the two images are combined. When a series of images is flashed in rapid succession, the brain blends the images together and, if these images are slightly changed from one to the next, it results in the effect of continuous motion. • The process of animation is very complex. In order to produce an animated film, 24 frames per second are required. This is equivalent to 1,440 frames in one minute. A typical two hour animation film would then need 172,800 individual frames.
Hand Animation • Before computers were put to work as animation machines, each of these frames had to be drawn by hand, painted and photographed. Since animation is such a laborious task, it can be appreciated how computers have opened the door to a world of animation possibilities. • In hand animation, characters are drawn on transparent "cells" that are laid on top of each painted background. It requires a different cell for each frame. The backgrounds, on the other hand, remain constant over many frames and need be drawn only once. This separation of character and background is fundamental to the economic production of animated cartoons. The characters are redrawn for every frame. If the background had to be redrawn as well, the cost would be astronomical. • For this reason camera motion is limited to following the characters in the plane of the background or, occasionally, zooming into the background. A skilful zoom, combined with the correct reduction of scale for the character, can create the impression that the character is being followed into the background. A little more flexibility can be obtained by having several background layers laid on parallel glass plates. Thus, a layer of trees can move relative to a layer of sky and mountains to give the effect of motion as the camera pans.
Computer Animation • All the techniques of hand animation can, of course, be simulated in a computer-assisted animation system. Many "paint" systems do exactly that. But if this is done, the system also inherits many of the limitations of the traditional method. • More advanced systems use three-dimensional "models" within the computer and in this case backgrounds are not needed. The whole scene, including background objects such as trees and hills, is viewed by a "virtual camera" that can be moved anywhere and even rotated as it moves. • Once the models have been created, every aspect of every scene can be redrawn, automatically, for every frame. This is still expensive, but the cost is one of machine time rather than human labor. As computers get faster and cheaper, the benefits of this approach will remain but the cost will disappear. The costs, therefore, are transferred from the creation of the image to the creation of the model and it is important that improved tools continue to be provided to support this part of the process.
0 1 2 3 4 5 6 American Standard Video • Uses a total of 525 horizontal lines with a viewing aspect ratio of 4:3. However only 483 lines are visible. • The picture repetition, frame rate, is 30 frames/second. • Each frame is divided into two fields, each containing-half of a the picture. The two fields are interlaced and they are presented alternatively every other 1/60 second. • Thus the picture is presented as 30 frames/second or as 60 fields per second. Europe • 625 lines • 25 frames/second
Light Radio Heat Wavelength (nm) Blue Green Red 350 780 Light • Light is a form of electromagnetic radiation. Electromagnetic energy travels as waves that can be characterized by either their wavelengths or their frequencies. frequency wavelength = speed of light • Light is the electromagnetic spectrum, which has wavelengths in the range of 350 to 780 nanometers (nm). Infrared Microwaves Radio waves Gamma rays X-rays Ultraviolet
Light in Computer Graphics • We do not deal with the wave nature of light. • Light sources have a fixed rate of intensity. • Light travels in straight lines. • A point source emits energy from a single location at one or more frequencies equally in all directions. • More complex sources, such as a light bulb, can be characterized as emitting light over an area.
The Human Visual System • Light enters the eye through the lens and cornea, a transparent structure that protects the eye. The iris opens and closes to adjust the amount of light entering the eye. • The lens forms an image on a 2D structure called the retina. The rods and cones are light sensors and are located in the retina. They are excited by electromagnetic energy in the range of 350 to 780 nm. • The rods are for low-level-light (night vision) – “monochrome” • The cones are for high-level light (day vision). Not too useful in the dark – 3 types (RGB)
Our Eyes • Fovea is the high-resolution area in the retina. Cones are mostly at the fovea. Rods are all over the retina. • The optic nerve is the signal processor that sends the image to the visual cortex (brain), where high-level functions, such as object recognition, are carried out. • The resolution of our visual system is the size of objects we can see. More technically, it is a measure of how close we can place two points and still recognize that there are two distinct points. • Our eyes do not react the uniformly at different wavelength. It does not have the same response to a monochromatic (single-frequency) red light as to a monochromatic green light. If these two lights were to emit energy with the same intensity, they would appear to us to have different brightness – we are most sensitive to green light, and least to red and blue.
Objects • An object is a self-contained “thing” that has a structure (properties) and behavior (methods and/or functions). • Object primitives • Points, lines, polygons, free-form surfaces, etc. that define the shape of the components of the object. • Object attributes • Line style, color or surface texture. • Connectivity relationships and positioning data that describe how the components fit together.
Virtual Environments • A set of independent objects following laws and behaviors define a “world” or a “virtual environment” (VE). • Virtual environments have: • content – the objects that make up the environment • geometry – dimension, metric and the extent or boundaries of the environment • dynamics – consist of the rules of interaction between the objects