2. CAPABILITIES FOR MODELING IN A TYPICAL GRAPHICS
WORKSTATION ENVIRONMENT
a. 2D and 3D modeling and drafting facilities
b. Display of text
c. Animation
d. Color selection (usually a palette of 256 colors)
e. 3D viewing
f. Z-buffering
g. Gouraud shading
h. Depth cueing
i. Lighting models
j. Anti-aliasing
k. Texture mapping
3. ARCHITECTURE OF A TYPICAL GRAPHICS WORKSTATION
A color (RGB) monitors with
19" screen size and resolution
of 1280 x1024 pixels is the
standard. Some workstations
will have monitors with
resolution of 1920 x 1200
pixels
CPU board with a RISC (Reduced
Instruction Set Computing)
Microprocessor with Cache Memory
and 4/8 GB RAM.
HDD 1 TB
communication facilities
display generation and
manipulation.
4. Workstations consist of three basic
components
A primary processor
Associated memory
Graphics display system and software
Leading workstations like SUN, IBM, Silicon
Graphics, Hewlett-Packard etc., use special
architecture based on RISC (Reduced
Instruction Set Computing) chips and
specialized graphic boards.
5. The graphic features like display manipulation are realized in
hardware for fast response. Workstations typically place emphasis
on graphics display and manipulation.
The features of a display system are directly related to Functions such
as color fill; entity generation and transformation of displays are
controlled by the display processor and associated hardware.
6. CAD systems are no more than computer programs. The software comprises a
number of different elements or functions that process the data stored in the
database in different ways.
Main Functions of CAD Systems
1. Model definition: for example to add geometric elements to a model
2. Model manipulation: to move, copy, delete, edit or otherwise modify elements in
the design model.
3. Picture generation: to generate images of the design model on a computer screen
or on some hard-copy device.
4. User interaction: to handle commands input by the user and to present output to
the user about the operation of the system.
5. Database management: for the management of the files that make up the DB.
6. Applications: these elements of the software do not modify the design model, but
use it to generate information for evaluation, analysis or manufacture.
7. Utilities: a “catch-all” term for parts of the software that do not directly affect the
design model, but modify the operation of the system in some way (for example, to
select the color to be used for display, or the units to be used for construction of a
drawing).
These features may be provided by multiple programs operating on a common
database, or by a single program encompassing all of the elements.
7. What is GPU Computing?
GPU computing is the use of a GPU (graphics processing unit) as a co-processor to
accelerate CPUs for general-purpose scientific and engineering computing.
The GPU accelerates applications running on the CPU by offloading some of the
compute-intensive and time consuming portions of the code.
The rest of the application still runs on the CPU.
From a user’s perspective, the application runs faster because it’s using the massively
parallel processing power of the GPU to boost performance. This is known as
“heterogeneous” or “hybrid” computing.
A CPU consists of four to eight CPU cores, while the GPU consists of hundreds of smaller
cores. Together, they operate to crunch through the data in the application. This
massively parallel architecture is what gives the GPU its high compute performance.
There are a number of GPU-accelerated applications that provide an easy way to access
high-performance computing (HPC).
8. Application developers harness the performance of the parallel GPU architecture
using a parallel programming model invented by NVIDIA called “CUDA.” All NVIDIA
GPUs—GeForce®, Quadro®, and Tesla®--support the NVIDIA® CUDA® parallel-
programming model.
WHAT IS CUDA?
CUDA™ is a parallel computing platform and programming model invented by NVIDIA.
It enables dramatic increases in computing performance by harnessing the power of
the graphics processing unit (GPU).
Identify hidden plaque in arteries: Heart attacks are the leading cause of death worldwide.
Harvard Engineering, Harvard Medical School and Brigham & Women's Hospital have teamed up
to use GPUs to simulate blood flow and identify hidden arterial plaque without invasive imaging
techniques or exploratory surgery.
The latest Tesla 20-series GPUs are based on the latest implementation of the CUDA platform
called the “Fermi architecture ”. Fermi has key computing features such as 500+ gigaflops of IEEE
standard double-precision floating-point hardware support, L1 and L2 caches, ECC memory error
protection, local user-managed data caches in the form of shared memory dispersed throughout
the GPU, coalesced memory accesses, and more.
9. What are the difference between Cloud, Cluster and Grid Computing?
All three systems are distributed and share similar characteristics.
The similarities relate to resource pooling and broad network access – two criteria that are
fulfilled by all systems.
Network access to cluster and grid computing systems usually takes place within a corporate
network, while the services of a cloud computing system can also be accessed through public
network, i.e. the Internet.
Resources in grid and cluster environments are generally pre-reserved, while cloud computing
systems are demand driven, i.e. operation of these systems is geared to consumers’ actual needs.
Another difference concerns the “rapid elasticity” criterion, which forms an integral part of cloud
computing systems but is not normally supported by cluster or grid systems.
Compared to other distributed systems such as grids or clusters, cloud computing solutions give
enterprises significantly more flexibility. They can dispense with IT infrastructures of their own
and only have to pay for the resources and services they actually use (“pay-per-use”/ “pay as you
go)
10. Two interactive operations that carried out in CAD:
* Redrawing of the display to “clean-up” unwanted clutter on the screen
or to restore parts of the image that have been corrupted.
*Selection of entities from the screen.
In each of these cases, work is not just done with the base entity data, but with a
display file that stores the displayable vectors for an entity.
For example, in the selection of a surface without use of a display file it would be
necessary to recompute the surface display in order to identify which path is nearest
to the cursor. With a display file it is only necessary to find the nearest displayed
vector and to cross-reference back to the entity.
Display files also lend themselves to fast image manipulation or zoom facilities.
Instead of recomputing the entire image for a zoom within existing window boundary,
the display file vectors are used- leading to some loss in display resolution for curves,
but generally faster display control.
The display file is related to the rest of the data by cross-referencing between the
display file and the entity table.
12. RASTER SCAN TECHNIQUE
• The screen of a monitor can be considered to consist of a large
number of minute subdivisions called picture elements (pixels, in
short).
• For example, in a typical SVGA monitor, the screen is divided
horizontally into 1024 units and vertically into 768 units.
• The resolution of this monitor is then 1024 x 768.
• A raster CRT graphics device can be considered a matrix of discrete
cells each of which can be made bright.
• Thus it is basically a point plotting device. If a line is to be drawn, it
can be approximated by a series of dots close to the path of the
line.
13. • A frame buffer is a common method of implementing a raster CRT graphics
device.
• It can be considered to be a large contiguous piece of computer memory. In the
simplest can, there can be one memory bit for each pixel in the raster. This
amount of memory is called a bit plane.
• A 320 X 200 raster requires 64 K memory bits in a single plane. The picture is
built in the frame buffer one bit at a time. The memory bits can be either in 0
or 1 state.
• If a particular pixel is to be addressed, the corresponding bit in the frame buffer
is changed from 0 to 1.
• Since the raster CRT is an analog device, it requires an electrical voltage and
the digital data of the frame buffer has to be converted to an analog voltage
through a digital to analog converter (DAC).
14. • Additional bit planes can be used for each of the three
color guns. In a 24 bit plane buffer 8 bit planes are used
for each color.
• Each group drives a 8 bit Digital to Analog
Converter (DAC) and can generate 28 = 256 intensities of
red, green and blue.
This when combined together can result in (28)3 = 16,
777, 216 or 16.7 million possible colors.
15. A drawing is created by an assembly of basic entities
Points
Lines
Arcs
Circles
The fundamental principles of generation of some of these entities are discussed in
this lecture
-Point plotting
-Line/Circle plotting
16. POINT PLOTTING
-The frame buffer display is an example of a point plotting device.
- The smallest unit accepted by such displays is a single pixel.
- To construct a useful picture on a point plotting device, a picture must
be built out of several hundreds of pixels.
A Framebuffer is a video output device that drives a video display from
a memory buffer containing a complete frame of data.
The information in the memory buffer typically consists of color values
for every pixel (point that can be displayed) on the screen.
Electron beam (if the display technology uses one) is commanded to
trace a left-to-right, top-to-bottom path across the entire screen, the
way a television renders a broadcast signal.
At the same time, the color information for each point on the screen is
pulled from the framebuffer, creating a set of discrete picture elements
17. DRAWING OF LINES
Straight line segments are used a great deal in computer generated
pictures. The following criteria have been stipulated for line drawing
displays :
• i. Lines should appear straight
• ii. Lines should terminate accurately
• iii. Lines should have constant density
• iv. Line density should be independent of length and angle
• v. Line should be drawn rapidly
There are several schemes for selecting the pixels between the end
pixels.
One method of generating a line segment is a
Symmetrical Digital differential analyzer (DDA) and other is
Breshanhams algorithm
18. Line Drawing Algorithms
• Line drawn as pixels
• Graphics system
– Projects the endpoints to their pixel locations in the
frame buffer (screen coordinates as integers)
– Finds a path of pixels between the two
– Loads the color
– Plots the line on the monitor from frame buffer (video
controller)
– Rounding causes all lines except horizontal or vertical
to be displayed as jigsaw appearance (low resolution)
– Improvement: high resolution, or adjust pixel
intensities on the line path.
10/10/2006 TCSS458A Isabelle Bichindaritz 18
19. Line Drawing Algorithms
• Line equation
– Slope-intercept form
y = m . X + c
slope m and Y-intercept c
– Slope
– Y-intercept
19
0
0 mx
-
y
=
c
x
y
0
end
0
end
=
x
-
x
y
-
y
=
m
20. Line Drawing Algorithms
• DDA (Digital Differential Analyzer)
– Scan conversion line algorithm
– Line sampled at regular intervals of x, then
corresponding y is calculated
– From left to right
– The calculation has to be simplified as below
20
)
1
=
(
m
1
+
x
=
x
1.0,
m
if
)
1
=
(
m
+
y
=
y
1,
>
m
if
y
k
1
+
k
x
k
1
+
k
22. Line Drawing Algorithms
• Advantage
– Does not calculate coordinates based on the
complete equation (uses offset method)
• Disadvantage
– Round-off errors are accumulated, thus line
diverges more and more from straight line
– Round-off operations take time
• Perform integer arithmetic by storing float as
integers in numerator and denominator and
performing integer artithmetic.
22
23. DDA ALGORITHM
The digital differential analyzer generates lines from their differential
equations.
The DDA works on the principle that X and Y are simultaneously
incremented by small steps proportional to the first derivatives of X and
Y.
begin
length : = abs (X2– X1) ;
if abs (Y2–Y1) < length then length: = abs (Y2–Y1);
X - incr : = (X2 – X1) /length ;
Y - incr : = (Y2 – Y1) /length ;
X : = X1 + 0.5 ; Y = Y1 + 0.5 ;
for i : = 1 to length do
begin
plot (trunc (X) ; trunc(Y) ;
X : = X + X - incr ;
Y : = Y + Y - incr ;
end;
end.
24. Merits + Demerits
• Faster than the direct use of line Eqn.
• It eliminates the multiplication in line Eqn.
• For long line segments, the true line Path may
be mislead due to round off.
• Rounding operations and floating-point
arithmetic are still time consuming.
• The algorithm can still be improved.
• Other algorithms, with better performance also
exist.
25. Line Drawing Algorithms
• Bresenham’s line drawing
– Efficient line drawing algorithm using only incremental
integer calculations
– Can be adapted to draw circles and other curves
• Principle
– Vertical axes show scan line positions
– Horizontal axes show pixel columns
– At each step, determine the best next pixel based on
the sign of an integer parameter whose value is
proportional to the difference between the vertical
separations of the two pixel positions from the actual
line.
25
26. The Bresenham Line Algorithm
• The Bresenham algorithm is
another incremental scan
conversion algorithm
• The big advantage of this
algorithm is that it uses only
integer calculations
Jack Bresenham worked
for 27 years at IBM
b e f o r e e n t e r i n g
academia. Bresenham
developed his famous
algorithms at IBM in the
e a r l y 1 9 6 0 s
27. The Big Idea
• Move across the x axis in unit intervals and at
each step choose between two different y
coordinates
2 3 4 5
2
4
3
5
For example, from
position (2, 3) we have
to choose between (3,
3) and (3, 4)
We would like the
point that is closer to
the original line
(xk, yk)
(xk+1, yk)
(xk+1, yk+1)
28. The y coordinate on the mathematical line at xk+1
is:
Deriving The Bresenham Line Algorithm
• At sample position xk+1 the
vertical separations from the
mathematical line are labelled
dupper and dlower
b
x
m
y k
)
1
(
y
yk
yk+1
xk+1
dlower
dupper
29. • So, dupper and dlower are given as follows:
• and:
• We can use these to make a simple decision
about which pixel is closer to the mathematical
line
Deriving The Bresenham Line Algorithm (cont…)
k
lower y
y
d
k
k y
b
x
m
)
1
(
y
y
d k
upper
)
1
(
b
x
m
y k
k
)
1
(
1
30. BRESENHAM’S LINE DRAWING ALGORITHM
(for |m| < 1.0)
1. Input the two line end-points, storing the left end-point in
(x0, y0)
2. Plot the point (x0, y0)
3. Calculate the constants Δx, Δy, 2Δy, and (2Δy - 2Δx) and
get the first value for the decision parameter as:
4. At each xk along the line, starting at k = 0, perform the
following test. If pk < 0, the next point to plot is
(xk+1, yk) and:
x
y
p
2
0
y
p
p k
k
2
1
31. The Bresenham Line Algorithm (cont…)
The algorithm and derivation above assumes
slopes are less than 1. for other slopes we
need to adjust the algorithm slightly
Otherwise, the next point to plot is (xk+1, yk+1) and:
5. Repeat step 4 (Δx – 1) times
x
y
p
p k
k
2
2
1
32. Bresenham Example
• Let’s have a go at this
• Let’s plot the line from (20, 10) to (30, 18)
• First off calculate all of the constants:
– Δx: 10
– Δy: 8
– 2Δy: 16
– 2Δy - 2Δx: -4
• Calculate the initial decision parameter p0:
– p0 = 2Δy – Δx = 6
33. Bresenham Example
• We plot the initial point (x0 , y0)=(20,10) and determine
successive pixel positions along the line path from the decision
parameter as
K pk (xk +1, yk +1) K pk (xk +1, yk +1)
0 6 (21,11) 5 6 (26,15)
1 2 (22,12) 6 2 (27,16)
2 -2 (23,12) 7 -2 (28,16)
3 14 (24,13) 8 14 (29,17)
4 10 (25,14) 9 10 (30,18)
35. Digital Differential Analyzer
Line Drawing Algorithm
Bresenhams Line Drawing Algorithm
Arithmetic DDA algorithm uses floating points i.e. Real Arithmetic.
Bresenhams algorithm uses fixed points
i.e. Integer Arithmetic.
Operations
DDA algorithm uses multiplication and division in its
operations.
Bresenhams algorithm uses only
subtraction and addition in its operations.
Speed
DDA algorithm is rather slowly than Bresenhams algorithm in
line drawing because it uses real arithmetic (floating-point
operations).
Bresenhams algorithm is faster than DDA
algorithm in line drawing because it
performs only addition and subtraction in its
calculation and uses only integer arithmetic
so it runs significantly faster.
Accuracy & Efficiency
DDA algorithm is not as accurate and efficient as Bresenham
algorithm.
Bresenhams algorithm is more efficient and
much accurate than DDA algorithm.
Drawing
DDA algorithm can draw circles and curves but that are not as
accurate as Bresenhams algorithm.
Bresenhams algorithm can draw circles and
curves with much more accuracy than DDA
algorithm.
Round Off
DDA algorithm round off the coordinates to integer that is
nearest to the line.
Bresenhams algorithm does not round off
but takes the incremental value in its
operation.
Expensive
DDA algorithm uses an enormous number of floating-point
multiplications so it is expensive.
Bresenhams algorithm is less expensive
than DDA algorithm as it uses only addition
and subtraction.
Difference Between DDA Line Drawing Algorithm and Bresenhams Line Drawing Algorithm.
36. ANTI ALIASING Algorithm
Aliasing in computer graphics manifests in several ways.
The computer generated image will have jagged edges and incorrectly rendered fine detail or
texture.
Ant aliasing is the technique adopted to solve these problems.
One technique is to increase the sampling rate by increasing the resolution of the raster.
Another method is to calculate the raster at higher resolution and display it at lower resolution
by averaging the pixel and attribute at the lower resolution.
37. Graphics system consists of four subsystems:
a. Geometry engine subsystem
b. Scan conversion subsystem
c. Raster subsystem
d. Display subsystem
GEOMETRY ENGINE
• The geometry engine accepts 3-D world co-ordinate data
and converts them into X, Y screen co-ordinates.
• Depth information is manipulated using Z-buffer.
• Colors are also processed.
• The geometry pipeline facilitates among other functions
lighting, clipping,and 3D to 2D projection, viewing
transformations, rotation, scaling and translation.
38. SCAN CONVERSION
The scan conversion subsystem carries out
polygon decomposition
edge slope calculations
span slope calculations and span interpolation
.
The output of the scan
conversion is the
pixel information to the raster
subsystem
39. RASTER SUBSYSTEM
• The raster subsystem will have usually 24 bit planes.
This will provide eight bit planes for each primary
color (RGB)
• In a typical raster engine five 256K X 4D RAM provide
4 bits of Z-depth.
• The raster information is stored in the frame buffer.
• Twenty 64 K X 4 video RAM provide 4 bits for each
pixel of 1280 X 1024 resolution.
• Entry level systems will have 12 bit planes and high
end systems will have 32 bit planes for the frame
buffer.
40. DISPLAY SUBSYSTEM
The display subsystem has multi-mode graphics
processors which manage the display, send the Red,
Green, Blue color (RGB) data to the respective
digital to analog converters as well as provide a
video output.
41. The display devices are classified into two groups:
i. Display devices based on CRT principle
ii. Flat screens
In a color CRT, there are three electron guns, one each for red, green
and blue.
The phosphor dots for red, green and blue are arranged in a triangular
pattern. The individual beams intersect at a shadow mask which directs
a red beam to a red phosphor dot and so on.
42. Raster Scan technique
• A frame buffer is a common method of implementing a raster CRT
graphics device.
• It can be considered to be a large contiguous piece of computer
memory. In the simplest , there can be one memory bit for each
pixel in the raster. This amount of memory is called a bit plane.
• The picture is built in the frame buffer one bit at a time. The
memory bits can be either in 0 or 1 state.
• If a particular pixel is to be addressed, the corresponding bit in the
frame buffer is changed from 0 to 1.
• Since the raster CRT is an analog device, it requires an electrical
voltage and the digital data of the frame buffer has to be converted
to an analog voltage through a digital to analog converter (DAC).
A Single bit frame buffer
A four bit plane frame buffer
43. FLAT SCREENS
• CRT has the disadvantage that it is extremely
bulky. Moreover, CRT consumes considerable
power with increased heat dissipation
requirements.
• Portability is reduced because of the size and the
material of CRT.
• These disadvantages have prompted the
manufacturers try different types of flat screens
as output devices for computers.
• Flat screens are necessary for laptop, notebook
and palm top computers. Flat screens operate on
the principle of liquid crystal display/LED
44. We can separate flat-panel displays into two categories: emissive
displays and nonemissive displays.
The emissive displays (or emitters) are devices that displays, and light-
emitting diodes are examples of emissive displays.
Nonemissive displays( or nonemitters) use optical effects to convert
sunlight or light from some other source into graphics patterns. The
most important example of a nonemissive flat-panel display is a
liquid- crystal device.
emissive device is the light-emitting diode (LED). A matrix of diodes is
arranged to form the pixel positions in the display, and picture
defination is stored in refresh buffer. As in scan- line refreshing of a
CRT, information is read from the refresh buffer and converted to
voltage levels that are applied to the diodes to produce the light
patterns in the display.
Liquid- crystal displays (LCDs) are commonly used in systems, such
as calculators (fig.below) and portable, laptop computers (fig.below).
These nonemissive devices produce a picture by passing polarized
light from the surrounding or from an internal light source through a
liquid- crystal material that can be aligned to either block or transmit
the light.