Computer Graphics

Download Report

Transcript Computer Graphics

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 thousand pounds whereas a computer cost several million pounds, of computer graphics hardware – a car cost a few the need for expensive computing recourses to support massive design databases, interactive picture manipulation, the difficulty of writing large, interactive programs when both graphics and interaction where new to predominantly batch-oriented FORTRAN programmers, at a time 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.

2

Video Display Devices

The primary output device in a graphical system is the video monitor.

3

Cathode-ray tubes (CRT)

Base Focusing System Y deflect Connector Pins x deflect Electron Gun Control grid voltage Phosphor 4

Basic operations of a CRT

Steps

1.

The electron gun emits a beam of electrons (cathode rays).

2.

3.

The electron beam passes through focusing deflection specified positions on the phosphor-coated screen.

systems that direct it towards and 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.

4.

Redraw the picture by quickly directing the electron beam back over the same screen points.

5

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.

6

Brightness ( Intensity ) distribution of a phosphor spot on the screen

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).

7

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

picture elements.

– of This elements are called

Pixels

or

Pels

(

P

icture

El

ement

s

). 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

.

8

9

Zooming Effects

10

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.

11

 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.

12

The Frame Buffer

0 0 pixel at address (x,y) Frame buffer spot at (x,y) 600 at (800,600)

y

Display surface 800

x

13

Refresh Rate

 Definition: redrawn.

The number of times per second the image is  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).

14

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.

15

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 2 1 colors (black and white) 8-bit-deep frame buffer allows 2 8 (=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.

16

Scanning Approaches

0 0 800

x

600

y

17

Raster Scan Displays Electron beam “paints” the picture on screen one line at a time.

Scan line Horizontal retrace Vertical retrace 000000000000000000000 000000000111000000000 000000111111111000000 000111111111111111000 000111110000011111000 000111111111111111000 000111111000111111000 000111111000111111000 000111111000111111000 000111111000111111000 000111111111111111000 000000000000000000000 18

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 .

19

Interlaced Raster Scan Displays

Odd/even scan lines covered in successive refresh cycles.

Hence 30 frames/sec refresh rate appears like 60 frames/sec.

0 1 2 3 4 5 6 20

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.

MoveTo (300,800) LineTo (700,800) LineTo (500,300) LineTo (300,800) 21

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.

22

Raster Scan Vs Random Scan

Ideal line drawing Raster scan Random scan 23

The Bit-map

1-bit-deep frame-buffer 1 0 1 0 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 1 1 1 1 1 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 Frame buffer Pixels 24

Gray Level images

n

-bits per pixel produce 2

n

gray levels.

Many images use 8-bits per pixel, i.e. 256 gray levels since it gives acceptable quality.

00 01 10 11 2-bit per pixel 4 gray level Color image 8-bit per pixel 256 gray level 1-bit per pixel 2 gray levels Black & White 25

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 (

R

G B ) has a certain number of bits, and

color depth

is the sum of these values.

26

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.

x

pixel value

y

Color depth = 6 bits  2 6 (= 64) colors 27

Common Colors Color depth of three

One bit for each component

Color Value (triple)

0,0,0 0,0,1 0,1,0 0,1,1 1,0,0 1,0,1 1,1,0 1,1,1

Value

Black Blue Green Cyan Red Magenta Yellow White 28

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).

– 29

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) 30

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.

31

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.

32

Liquid-Crystal Display (LCD)

Made up of six layers: 1.

2.

3.

4.

5.

6.

Vertical filter film to polarize

the light as it enters.

Glass substrate with

vertical filter. The shapes of these electrodes will determine the shapes on the LCD.

ITO

electrodes which lines up with the 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.

33

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.

34

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.

35

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).

36

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-matrix LCDs

.

37

Timing and Control System

Three-Dimensional Viewing Devices

Projected 3D Image Vibrating Flexible Mirror CRT Viewer Operation of a 3D display system using a vibrating mirror that changes focal length to match the depths of points in a scene.

38

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.

39

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.

40

Animation

Animation is the process of creating images that appear move.

to 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.

41

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.

42

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.

43

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 0 1 2 3 4 5 6 44

Light

Light Radio Heat Gamma rays X-rays Ultraviolet Blue Wavelength (nm) Green Red Infrared Microwaves Radio waves 350 780 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).

45

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.

46

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 ( R G B ) 47

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 .

48

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.

49

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 50

Content of VE At any moment of time any object has a description and a state .

Description : information about the object’s geometry, substance and potential behavior.

State : state of the object in relation to the rest of the environment.

51

Actors and Virtual Reality

An

actor

is a special set of objects that can initiate an interaction with another object or actor through information exchange.

A participant (human operator) has a visual representation within the environment and controls the behavior of one of the actors.

Virtual Reality

The participant “lives” in the virtual environment, sees with the “eyes” of the actor and “feels” as being the actor itself. The participant’s movements are captured by a tracking system.

52

Forming Synthetic Objects Synthetic objects

can be defined or approximated by specifying the position in space of various geometric primitives, such as points (vertices) lines polygons

Examples

 A line can be defined by two vertices.

 A polygon can be defined by an ordered list of vertices.

 A sphere can be specified by two vertices, the center and any point on its circumference.

53

The Viewer Image

Object

The viewer forms the image (in 2D) of the object .

In the human visual system, the image is formed on the back of the eye, on the retina.

In a camera, the image is formed on the film plane.

An object has a lot of images, depending on the position and the perspective of the viewer.

B-view C-view

54

Image Formation The object and the viewer are in a three dimensional world.

The image is two-dimensional.

55

Light Sources

Without light sources the objects would have been dark and there would be nothing visible to the image.

Light from the sources strikes various surfaces of the object, and a portion of the reflected light enters the camera through the lens.

56

Displaying Images

Wire-frame image Shaded image 57

Realism

It is extremely difficult to create “reality” on a computer display.

What do you see?

58

Explanations

In electrodynamics,

polarization

is a property of waves, such as light and other electromagnetic radiation. Unlike more familiar wave phenomena such as waves on water or sound waves, electromagnetic waves are three dimensional, and it is their vector nature that gives rise to the phenomenon of polarization.

Indium Tin Oxide

(

ITO

) is a mixture of indium(III) oxide (In2O3) and tin(IV) oxide (SnO2), typically 90% In2O3, 10% SnO2 by weight. ITO is mainly used to make transparent conductive coatings for electronic displays, and heat-reflecting coatings for architectural, automotive, and light bulb glasses.

59

Input Devices

Each device is more suitable for certain tasks than for others 

Keyboard

– Entering non-graphical data (i.e. text) 60

 Mouse • • Used to select a location to the screen.

The motion of the roller at the bottom of the mouse is converted into signals sent back to the computer.

 Optical Detector Mouse • Measure distance traveled by counting lines on a special pad.

61

Trackball

• Similar in use to the mouse.

• Popular with portable computers because they can be incorporated directly into the keyboard.

• There exist various pressure-sensitive devices in keyboards that perform similar functions to the mouse and trackball.

62

Data Tablet

– It has rows and columns of wires embedded under its surface. The position of the stylus is determined through electromagnetic interactions between signals traveling through the wires and sensors in the stylus.

Touch-Sensitive Screens

– Have many of the same properties as Data Tablet.

63

Light pen

– If it is positioned on the face of the CRT at a location, a signal is sent to the computer.

– Not very popular as other devices.

64

Joystick

– The motion of the screen in two orthogonal directions is encoded and integrated to identify a screen location.

– Variable sensitive device – well suited for flight simulators and games.

65

Spaceball

– 3D input device – Stick does not move but it has pressure sensors (rotations).

– 3 independent twists (translations).

66

Z-mouse

– 3D input device – It has three buttons, a thumbwheel on the sided, a trackball on the top, and a standard mouse ball underneath.

67

Data Glove

– Used to grasp a “virtual” object.

– Sensors detect hand and finger motions.

68

Digitizers

– 2D or 3D input devices.

– Interactive selection of coordinate positions on an object.

– Wireframe models – rectangular grid 69