Chapter2 Graphics Hardware StudyGuide
Chapter2 Graphics Hardware StudyGuide
Chapter 2
Graphics Hardware
Computer Graphics — Study Guide
Component Role
CPU Executes application logic; passes graphics commands to the display
processor
System Bus Communication highway connecting CPU, memory, and peripheral
devices
System Memory Stores program data; may also hold the frame buffer in simpler
systems
Display Processor Dedicated hardware that executes graphics routines and writes pixel
(GPU) data into the frame buffer
Frame Buffer 2-D memory array storing pixel color values for the current image
Video Controller Reads the frame buffer continuously and drives the CRT or other
display hardware
Monitor / Display The physical output device that shows the final image to the user
Video-Display Devices
Display devices are the output face of any graphics system. At the most basic level, every display device
does one thing: illuminate a small dot (a pixel) at a specific (x, y) position with a specific color. The entire
visible image is built from millions of such dots.
The main categories of display device you will encounter in this course are:
• Cathode Ray Tubes (CRT) — the dominant technology for decades and the focus of this
chapter
• LCD (Liquid Crystal Display) — increasingly common; uses a backlight and liquid crystals to
control pixel brightness
• LED displays — variants of LCD using LED backlighting or direct-emission LEDs
• Projectors — project an image onto a surface
Page 1
Computer Graphics — Chapter 2: Graphics Hardware
Colour CRTs
A monochrome CRT uses a single electron gun and a uniform phosphor coating. Colour CRTs are
considerably more complex:
• Three separate electron guns are used — one each for red (R), green (G), and blue (B).
• The screen phosphor is arranged in clusters of three tiny dots: one red, one green, one blue,
grouped together so closely that human eyes blend their light into a single perceived colour.
• A shadow mask — a thin metal plate with one tiny hole per pixel position — sits just behind the
screen. Because the three guns are positioned at slightly different angles, all three beams
converge through the same hole but land on their respective coloured phosphor dots.
• The perceived colour at any pixel is determined by the relative intensities of the R, G, and B
beams at that moment.
Page 2
Computer Graphics — Chapter 2: Graphics Hardware
What It Is
In a random-scan (vector) display, the electron beam is directed only to the areas of the screen that need
to be illuminated. The beam traces out each line or curve in the image directly, in much the same way a
human would draw with a pen — going from point to point. Blank areas are never touched by the beam.
Analogy
Think of drawing on paper by lifting your pen and placing it only where ink is needed.
If you are drawing a triangle, the pen moves along three straight edges and stops.
Empty white space inside the triangle is never touched.
Because the image is stored as a list of geometric commands (draw a line from A to B, draw a circle at
C with radius r), random-scan displays are also called vector graphics displays.
Page 3
Computer Graphics — Chapter 2: Graphics Hardware
Raster-Scan Displays
The Core Idea
In a raster-scan display, the entire screen is treated as a uniform grid of pixels. The electron beam sweeps
across every row (scan line) from left to right, top to bottom, visiting every pixel position — whether it is
'on' or 'off'. The beam is switched on (high intensity) or off (low intensity) at each position based on data
stored in a frame buffer.
Analogy
Think of a printer laying down ink row by row across the full width of a page,
whether or not there is content at each spot. Every row is visited; the ink head
simply delivers no ink where the image is blank.
Term Definition
Raster The complete rectangular grid of phosphor dots (pixels) on the
display screen
Pixel (Picture Cell) A single addressable dot in the raster — the smallest unit of display
Scan Line A single horizontal row of pixels across the raster
X-Resolution The number of pixels per scan line (horizontal pixel count)
Y-Resolution The number of scan lines (vertical pixel count)
Resolution Expressed as X-Resolution × Y-Resolution, e.g. 640×480,
1280×1024
Aspect Ratio The ratio of horizontal to vertical dimensions; affects how images
appear (square vs. stretched)
Frame Buffer 2-D memory array storing the brightness/colour value of every pixel
Bit-Planes / Depth Number of bits used to store each pixel's value; determines the
number of displayable colours
Bitmap / Pixmap An image represented as a 2-D array of pixel values
Page 4
Computer Graphics — Chapter 2: Graphics Hardware
Example: A 640x480 display with 8 bits per pixel requires 640 x 480 x 8 = 2,457,600 bits = approximately
300 KB of frame buffer memory.
For colour displays, each pixel stores values for its red, green, and blue channels. A common
configuration is 8 bits per channel x 3 channels = 24-bit colour (16.7 million possible colours). This is
called true colour.
The number of times the full screen is redrawn per second is the refresh rate, measured in Hz (cycles
per second). Key thresholds:
• Below ~24 Hz: obvious flicker; the image appears to pulse and is uncomfortable to view
• 24–30 Hz: acceptable for some applications; still perceptible flicker under bright lighting
• 60 Hz: the standard for modern displays; virtually flicker-free for most viewers
• Modern high-performance displays: 120 Hz, 144 Hz, or 240 Hz
Why interlaced scanning reduces flicker: because odd lines are refreshed in the first pass and even lines
in the second, every part of the screen is updated twice as often as a naive count would suggest —
tricking the eye into perceiving a smoother image.
Page 5
Computer Graphics — Chapter 2: Graphics Hardware
The CPU computes pixel values and writes them into the frame buffer.
The video controller independently reads the frame buffer at the refresh rate.
Page 6
Computer Graphics — Chapter 2: Graphics Hardware
The CPU sends drawing commands; the GPU handles all pixel computation.
Hardware rendering is significantly faster than software rendering.
The GPU contains dedicated circuitry for common graphics operations: line drawing, polygon filling,
texture mapping, lighting calculations, and geometric transformations. This hardware is optimised for
these tasks and runs them far faster than a general-purpose CPU.
Page 7
Computer Graphics — Chapter 2: Graphics Hardware
• Bit depth (professional monitors may support 10 or 12 bits per channel for smoother gradients)
• Refresh rate and response time (critical for animation and video work)
• Resolution — higher resolutions reveal finer detail in complex models
The video card (GPU) inside a workstation connects to the motherboard via a high-speed bus. Bus
technology has evolved significantly:
• PCI (1993): 32-bit, 33 MHz — the first standardised plug-and-play graphics bus
• AGP (1997): Dedicated 32-bit, 66 MHz bus exclusively for the graphics card — doubled
bandwidth over PCI
• PCI Express (PCIe, 2004): Point-to-point serial interface; PCIe x16 provides far greater
bandwidth than AGP and is the current standard
Input Devices
Graphics systems receive user input through a variety of devices. Input devices fall into two broad
categories based on how they communicate positional data:
Page 8
Computer Graphics — Chapter 2: Graphics Hardware
Stereo method Separate small screens for each Polarised filters, colour filters, or
eye directly in front of the eyes active shutter glasses
Immersion High — fully surrounds the field Moderate — user still sees the
of view real world peripherally
Application Virtual reality (VR), surgical Scientific visualisation, 3-D
simulation, flight training cinema, design review
Tracking Head tracker updates image as Head position tracked so correct
user turns head perspective is shown
KEY TAKEAWAYS
• A CRT fires electron beams at a phosphor-coated screen; brightness is proportional to
beam intensity.
• Colour CRTs use three guns (R, G, B) and a shadow mask to ensure beams hit the correct
phosphor dots.
• Random-scan (vector) displays draw only the geometric primitives; raster-scan displays
visit every pixel.
• The frame buffer stores pixel values for the entire screen; its size = resolution x colour
depth.
• Refresh rate must exceed ~24 Hz to avoid visible flicker; interlaced scanning doubles
perceived refresh for low-rate systems.
• Hardware rendering (GPU) is far faster than software rendering (CPU).
• VGA: 640x480, 60 Hz, progressive. NTSC: ~525x480, 30 Hz, interlaced. PAL: ~625x480,
25 Hz, interlaced.
Page 9
Computer Graphics — Chapter 2: Graphics Hardware
The pipeline is implemented partly in software (on the CPU) and largely in dedicated hardware (on the
GPU). Like a factory production line, each stage processes the data handed to it by the previous stage,
and all stages run in parallel for maximum throughput. This is precisely why the analogy of a pipeline is
used.
Each arrow represents data passing from one stage to the next.
The pipeline runs continuously — while Stage 3 rasterizes triangle N,
Stage 2 is already processing triangle N+1, and Stage 1 is updating N+2.
Graphics APIs such as OpenGL and Direct3D exist to give programmers a consistent interface to the
GPU pipeline regardless of which manufacturer's hardware is installed. The API translates high-level
commands into hardware-specific operations.
Stage 1: Application
The application stage runs entirely on the CPU. Its job is to manage the scene and prepare data for the
geometry stage.
Responsibilities
• Reading user input (keyboard, mouse, game controller) and updating the scene accordingly
• Running game logic, physics simulation, and animation calculations
• Performing collision detection — determining whether objects intersect
• Managing spatial data structures (Quadtrees for 2-D, Octrees for 3-D) to efficiently determine
which objects are potentially visible
• Sending the list of visible geometry primitives (typically triangles) to the geometry stage
Page 10
Computer Graphics — Chapter 2: Graphics Hardware
Stage 2: Geometry
The geometry stage is where the 3-D mathematics happens. It transforms every vertex of every visible
primitive through a sequence of coordinate spaces, computes lighting at vertices, and clips geometry to
the visible volume. This stage operates primarily on the GPU's vertex processors.
This transformation is accomplished by multiplying each vertex position by a matrix. The matrix encodes:
• Translation: moving the object to its world position
• Rotation: orienting the object in world space
• Scaling: resizing the object to its intended size
A powerful consequence: one original model can be reused many times with different transformation
matrices. Drawing an entire forest from a single tree model (each with its own position/rotation/scale) is
called instancing.
The resulting space is called camera space or view space. Every subsequent step works in this space,
making the mathematics simpler and more uniform.
2c. Projection
3-D scenes must be flattened to 2-D for display. Projection accomplishes this. Two types of projection
are used:
Page 11
Computer Graphics — Chapter 2: Graphics Hardware
Appearance Objects farther from camera Objects appear the same size
appear smaller — realistic depth regardless of distance from
camera
Visual volume shape Frustum (truncated pyramid) — Rectangular box (cuboid)
wide at the far end, narrow at the
near end
Used for 3-D games, visualisations, films Technical drawings, CAD, maps,
— any realistic rendering architectural plans
Preserves parallel No — parallel lines converge at Yes — parallel lines remain
lines? vanishing points parallel in the projection
After projection, all vertices are mapped into a normalised volume — a cube with corners at (-1,-1,0) and
(1,1,1) in OpenGL convention. The Z values from this step are not discarded; they are preserved for
hidden surface removal (Z-buffering) in the rasterisation stage.
2d. Lighting
Lighting calculations determine how bright each vertex appears based on the scene's light sources and
the surface's material properties. This produces a colour (or colour modifier) at each vertex. Three types
of light contribution are typically computed:
• Ambient: uniform background illumination applied to all surfaces equally — prevents
completely unlit areas from being pure black
• Diffuse: directional light scattered equally in all directions from a surface; brightness depends
on the angle between the light direction and the surface normal (dot product). The sun is a
classic diffuse light source.
• Specular: highlights — the shiny spot on a surface where the light reflects directly toward the
viewer. Depends on both the view direction and the reflection direction.
During rasterisation (Stage 3), the colour values computed at each vertex are interpolated smoothly
across the interior of each triangle — a technique called Gouraud shading.
2e. Clipping
Only geometry inside the view volume (the frustum) is visible on screen. The clipping stage removes
geometry that falls outside this volume:
• Frustum culling: primitives entirely outside the view volume are discarded immediately.
• Partial clipping: primitives that straddle the boundary of the view volume are cut — new
vertices are generated at the intersection of the primitive with the frustum boundary.
• Backface culling: polygons facing away from the camera (their outward normal points away
from the camera) are discarded, since they would be hidden behind the front faces of solid
objects. This typically eliminates about 50% of triangles.
Clipping is computationally cheaper than rasterising invisible geometry. Only the surviving primitives
proceed to the next stage.
Page 12
Computer Graphics — Chapter 2: Graphics Hardware
After projection and clipping, vertices are in normalised device coordinates. The window-viewport
transformation maps these coordinates to the actual pixel coordinates of the target area (viewport) on
the screen. This is a simple scale and translation.
Stage 3: Rasterisation
Rasterisation is the final major stage. It converts the mathematical descriptions of clipped, projected, lit
primitives into discrete fragments — one per pixel that the primitive covers on screen. Each fragment will
ultimately become a pixel in the output image.
Double Buffering
A subtle but important problem: the rasteriser writes pixels to the frame buffer continuously, while the
video controller reads from the same frame buffer continuously to drive the display. If the user sees the
frame buffer while it is being partially written, they see a half-rendered, torn image — a visual artifact
called screen tearing.
Page 13
Computer Graphics — Chapter 2: Graphics Hardware
The solution is double buffering: two frame buffers are maintained. The rasteriser writes into the back
buffer (invisible to the display), while the video controller reads from the front buffer (what the user
currently sees). Once the back buffer is fully rendered, the two buffers are swapped atomically — the
completed back buffer becomes the new front buffer, and the empty front buffer becomes the new back
buffer.
Buffer Role
Front buffer Currently displayed; read continuously by the video controller
Back buffer Currently being rendered into; invisible to the user until swap
KEY TAKEAWAYS
• The graphics pipeline has three main stages: Application (CPU), Geometry (GPU vertex
processing), Rasterisation (GPU fragment processing).
• The geometry stage transforms vertices through: world space → camera space → clip
space → screen space.
• Two projection types: perspective (realistic depth, frustum view volume) and orthographic
(size-independent, box view volume).
• Lighting at vertices uses ambient + diffuse + specular contributions; colours are
interpolated across triangles during rasterisation.
• Clipping removes geometry outside the frustum; backface culling removes rear-facing
polygons — both reduce unnecessary computation.
• Double buffering prevents screen tearing by rendering into a hidden back buffer and
swapping when complete.
• The Z-buffer (from Stage 3) determines which surfaces are visible at each pixel — covered
in Section 2.3.
Page 14
Computer Graphics — Chapter 2: Graphics Hardware
Consider a simple example: three coloured planes arranged so that from the camera's perspective they
overlap. At any pixel where all three planes project, only the frontmost plane — the one with the smallest
depth value relative to the camera — should be visible.
Intuition
Imagine looking at a stack of cardboard sheets placed at different distances from you.
The sheet closest to your eyes hides any parts of further sheets behind it.
Hidden-surface algorithms give computers the equivalent of this common-sense depth
judgement.
Page 15
Computer Graphics — Chapter 2: Graphics Hardware
Depth buffer (Z- z-buffer(i, j) Stores the smallest (closest) Z-value seen so
buffer) far at pixel (i, j). Initialised to maximum depth
(infinity or far-plane depth).
Refresh buffer COLOR(i, j) Stores the colour (intensity) of the surface
(Colour buffer) currently considered visible at pixel (i, j).
Initialised to the background colour.
RESULT: COLOR array contains the correct visible colour at every pixel.
Worked Example
Suppose three surfaces S1, S2, and S3 all project onto pixel (x, y), with Z-values:
Page 16
Computer Graphics — Chapter 2: Graphics Hardware
Notice that the order in which surfaces are processed does not matter. Whether S1 is processed first or
last, the result is always correct because the algorithm continuously keeps track of the minimum depth
seen so far.
• Scanline Algorithm: Processes the scene one scan line at a time, determining visibility
intervals along each row. Historically important in offline rendering.
• Ray Casting / Ray Tracing: For each pixel, casts a ray into the scene and finds the first
surface it hits — inherently solves hidden-surface removal. Used for high-quality offline
rendering.
KEY TAKEAWAYS
• Hidden-surface removal ensures only the closest surface at each pixel is visible —
mimicking real-world depth occlusion.
• The Z-buffer algorithm maintains a depth buffer alongside the colour buffer; at each pixel it
keeps the smallest Z value seen.
• Algorithm is order-independent: surfaces can be processed in any order and the result is
always correct.
• Two buffers required: z-buffer(i,j) for depth, COLOR(i,j) for colour; both initialised at the
start of each frame.
• Z-buffer is implemented in GPU hardware and runs at full rendering speed; it is the
standard for real-time graphics.
• Z-fighting occurs when two surfaces have nearly equal depth — precision artifacts cause
flickering at their boundary.
• Backface culling is a fast pre-pass; BSP trees, painter's algorithm, and ray tracing are
alternative approaches.
Page 18
Computer Graphics — Chapter 2: Graphics Hardware
Review Questions
Test your understanding by attempting these before consulting your notes:
Page 19
Computer Graphics — Chapter 2: Graphics Hardware
Page 20