COMPUTER GRAPHICS
INTRODUCTION
Overview of Graphics Systems
WHAT IS COMPUTER GRAPHICS?
Creation, Modeling, Storage, Manipulation, and Rendering of
geometric objects and their images
Display those images on screens or hardcopy devices
OUTLINE
Survey of Computer Graphics
Overview of Graphics Systems
Image Basics
Graphics Hardware
Input
Describing something to the computer
Computation
Computing what we want to draw
Output
Final representation
WHAT DRIVES COMPUTER GRAPHICS?
Movie Industry
Leaders in quality and artistry
Not slaves to conceptual purity
Big budgets and tight schedules
Defines our expectations
Slide information from Leonard
WHAT DRIVES COMPUTER GRAPHICS?
Game Industry
The newest driving force in CG
Why? Volume and Profit
This is why we have commodity GPUs
Focus on interactivity
Cost effective solutions
Avoiding computating and other tricks
Games drive the baseline
WHAT DRIVES COMPUTER GRAPHICS?
Medical Imaging and Scientific Visualization
Tools for teaching and diagnosis
New data representations and modalities
Drive issues of precision and correctness
Focus on presentation and interpretation of data
Construction of models from acquired data
WHAT DRIVES COMPUTER GRAPHICS?
Computer Aided Design
Mechanical, Electronic, Architecture,...
Drives the high end of the hardware market
Integration of computing and display resources
Reduced design cyles == faster systems, sooner
WHAT DRIVES COMPUTER GRAPHICS?
Graphic User Interfaces (GUI)
HARDWARE:
Fundamental architecture shift
Dual computing engines:
CPU and GPU
More in GPU than CPU
Fast, cheap GPUs
Cheap memory
Displays at low cost
WHAT IS GPU?
It is a processor optimized for 2D/3D graphics,
video, visual computing, and display.
It is highly parallel, highly multithreaded
multiprocessor optimized for visual
computing.
It provides real-time visual interaction with
computed objects via graphics images, and
video.
It serves as both a programmable graphics
processor and a scalable parallel computing
platform.
Heterogeneous Systems: combine a GPU with a
CPU
GPU EVOLUTION
1980’s – No GPU. PC used VGA controller
1990’s – Add more function into VGA controller
1997 – 3D acceleration functions:
Hardware for triangle setup and
rasterization,
Texture mapping, Shading
2000 – A single chip graphics processor
( beginning of GPU term)
2005 – Massively parallel programmable
processors
2007 – CUDA (Compute Unified Device
Architecture)
HISTORICAL PC
INTEL AND AMD CPU
HARDWARE
• Manufacturers of GPU
Nvidia
AMD
Intel
Assignment
(1) Laptop GPU
Leading Questions
About? Why? What? Whom?
Architecture?
Application/use?
HARDWARE
(2) Compare CPU & GPU (latest)
(3) Describe architecture of CUDA (Compute Unified Device
Architecture)
(4) Graphics Color support trend
BUSINESS OF GENERATING IMAGES
Images are made up of pixels
RGB
RGB Color cube (what we use in computer graphics)
THE “GOAL” OF COMPUTER GRAPHICS
Solve the function
Red @ a pixel is f(x,y)=…
Green @ a pixel is f(x,y)=…
Blue @ a pixel is f(x,y)=…
EARLY APPLICATIONS OF
COMPUTER
Data Visualization
GRAPHICS
Charts and Graphs
EARLY APPLICATIONS OF
COMPUTER GRAPHICS
Computer Aided Design
(CAD)
Q: Why wireframe?
Why these apps?
A: Better conceptualization,
interaction, transfer of ideas
COMPUTER GRAPHICS
APPLICATIONS
Virtual Reality
VR: User interacts and
views with a 3D world
using “more natural”
means
Data Visualization
Scientific, Engineering,
Medical data
Visualizing millions to
billions of data points
Different schemes
COMPUTER
GRAPHICS
APPLICATIONS
Education and
Training
Models of physical,
financial, social systems
Comprehension of
complex systems
Computer Art
Fine and commercial art
Performance Art
Aesthetic Computing
SIGGRAPH
Games/Movies
COMPUTER
GRAPHICS
APPLICATIONS
Image Processing
Start with a picture
Process picture information
Graphical User Interfaces (GUIs)
WIMP (windows, icons, menus, pointer)
interface
HCI
IMAGE FORMATION IN A FRAME
BUFFER
Input devices Output device
Image formed in frame buffer
2
8
OVERVIEW OF GRAPHICS SYSTEMS
Images
Hardware
Input Systems
Computation
Output Systems
Software
OpenGL
TWO DIMENSIONAL IMAGES
Images are two +Y
dimensional shapes.
The two axes we will label
as X (horizontal), and Y Y
(vertical).
Axis
(0,0) X Axis +X
HARDWARE PIPELINE
Input Computation Output
We want to draw a rectangle, how do we describe it to a computer?
Model (n) - object
description that a
computer
understands.
PARTITION THE SPACE
1. Define a set of
points (vertices) (7,9) (14,9)
in 2D space.
2. Given a set of
vertices, draw
lines between (7,3) (14,3)
consecutive
vertices.
Vertex (pl. Vertices) - a point in 2 or 3 dimensional space.
RECORD EVERY POSITION
Bitmap - a rectangular array of bits mapped one-to-one with
pixels.
POSITION RELATIVE
Vector display system - graphical output system that was
based on strokes (as opposed to pixels). Also known as:
random, calligraphic, or stroke displays.
REPRESENTING OBJECTS
Most common method is the VERTEX method. Define the object
as a set of points with connectivity information.
Why is connectivity important?
Connectivity - information that defines
which vertices are connected to which
other vertices via edges.
Edge - connects two vertices
MODEL FILE FOR RECTANGLE
v4e4
73
79
14 9
(7,9) (14,9)
14 3
12
23
34
41 (7,3) (14,3)
INPUT DEVICES
Locator Devices
Keyboard
Scanner
Images
Laser
Cameras
LOCATOR DEVICES
When queried, locator devices return a position and/or
orientation.
•Mouse (2D and 3D)
•Trackball
•Joystick (2D and 3D)
LOCATOR DEVICES
Tablet
Virtual Reality
Trackers
Data Gloves
Digitizers
KEYBOARD
Text input
List boxes, GUI
CAD/CAM
Modeling
Hard coded
Vertex locations are inserted into code
SCANNERS
Image Scanners -
Flatbed, etc.
What type of data is
returned? Bitmap
Laser Scanners -
Deltasphere
Emits a laser and does
time of flight. Returns 3D
point
MANY OTHERS
Light Pens
Voice Systems
Touch Panels
Camera/Vision
Based
COMPUTATION STAGE
Input Computation Output
Now that we have a model of what we want to draw, what goes
on inside the computer to generate the output?
Computation
Transformations Rasterization
COMPUTATION STAGE
Computation
Model Output
Transformations Rasterization
Transformed
Model
HOW DO WE STORE THIS?
We would like to allocate memory to hold the results of the
computation stage.
FRAMEBUFFER
Framebuffer - A block of memory, dedicated to graphics output,
that holds the contents of what will be displayed.
Pixel - one element of the framebuffer
FRAMEBUFFER
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Questions:
How is
What much
How
the
Howmemory
largest
bigmany
is the do
image we
pixels need
framebuffer?
you
arecantodisplay?
allocate
there?
for the framebuffer?
FRAMEBUFFER IN MEMORY
If we want a framebuffer of 640 pixels by 480 pixels, we should
allocate:
framebuffer = 640*480 bits
How many bit should we allocate?
Q: What do more bits get you?
A: More values to be stored at each pixel.
Why would you want to store something
other than a 1 or 0?
FRAMEBUFFER BIT DEPTH
How many colors does 1 bit get you?
How many colors do 8 bits get you?
Monochrome systems use this (green/gray scale)
What bit depth would you want for your framebuffer?
bit depth - number of bits allocated per pixel in a buffer
FRAMEBUFFER BIT DEPTHS
Remember, we are asking “how
much memory do we allocate
to store the color at each
pixel?”
Common answers:
16 and 32 bits
BIT DEPTHS
16 bits per pixel (high color)
5 bits for red, 5/6 bits for green, 5 bits for blue
potential of 32 reds, 32/64 green, 32 blues
total colors: 65,536
32 bits per pixel (true color)
8 bits for red, green, blue, and alpha
potential for 256 reds, greens, and blues
total colors: 16,777,216 (more than the eye can distinguish)
DATA TYPE REFRESHER
bit - a 0 or 1. Can represent 2 unique values
byte - 8 bits. 256 values
word - 32 bits. 4,294,967,296 values
int - 32 bits.
float - 32 bits
double - 64 bits
unsigned byte - 8 bits
MEMORY
unsigned byte framebuffer[640*480*3];
framebuffer =
[255 255 255 0 0 255 0 0 255 0 255 0 255 0 0
0 255 0 0 255 0 …]
GRAPHIC CARD MEMORY
How much memory is on graphics card?
640 * 480 * 32 bits = 1,228,800 bytes
1024 * 768 * 32 bits = 3,145,728 bytes
1600 * 1200 * 32 bits = 7,680,000 bytes
IMAGE FORMATION IN A FRAME
BUFFER
Input devices Output device
Image formed in frame buffer
5
6
COMPUTATION STAGE
Computation
Model Output
Transformations Rasterization
Transformed
Model
OUTPUT
Input Computation Output
We have an image (framebuffer or model), now we want to show
it.
Hardcopy
Display
Vector
Raster Scan
a phosphor coating
luminescent properties
short-wave ultraviolet light causes it to
glow
• Neon 19 inch LCD
• Neon element
• Neon glows when a
high electrical
voltage is passed
through it
HARDCOPY
Printers (Resolution, color depth)
Dot Matrix - uses a head with 7 to 24
pins to strike a ribbon (single or
multiple color)
Ink Jet Printers (fires small balls of
colored ink)
HARDCOPY
Printers (Resolution, color
depth)
Laser Printers (powder adheres
to positive charged paper)
Pen Plotters (similar to vector
displays). “infinite” resolution.
FRAMEBUFFER -> MONITOR
The values in the framebuffer are converted from a digital (1s and 0s
representation, the bits) to an analog signal that goes out to the monitor.
A video card’s RAMDAC performs this operation, once per frame. This is
done automatically (not controlled by your code), and the conversion can
be done while writing to the framebuffer.
IMAGE QUALITY ISSUES
Screen resolution Brightness
Color Contrast
Blank space Refresh rate
between the
pixels Sensitivity of
display to
Intentional image
degradation
viewing angle
PIXELS
Pixel - The most basic addressable image element in a screen
CRT - Color triad (RGB phosphor dots)
LCD - Single color element
Screen Resolution - measure of number of pixels on a screen
(m by n)
m - Horizontal screen resolution
n - Vertical screen resolution
RASTER DISPLAYS
Cathode Ray Tubes (CRTs), most “tube” monitors you see. was
very common, but big and bulky.
Liquid Crystal Displays (LCDs), there are two types
transmissive (laptops, those snazzy new flat panel monitors)
and reflective (wrist watches).
CATHODE RAY TUBES (CRTS)
Strong electrical fields and high voltage
Very good resolution
Heavy, not flat
CATHODE RAY TUBES (CRTS)
Heating element on the yolk.
Phosphor coated screen
Electrons are boiled off the
filament and drawn to the
focusing system.
The electrons are focused into
a beam and “shot” down the
cylinder.
The deflection plates “aim”
the electrons to a specific
position on the screen.
CRTS
CRT
Can be used either as a line-drawing device
(calligraphic) or to display contents of frame
buffer (raster mode)
7
3
CRT PHOSPHOR
SCREEN
The screen is coated with
phosphor, 3 colors for a
color monitor, 1 for
monochrome.
For a color monitor, three
guns light up red, green,
or blue phosphors.
Intensity is controlled by
the amount of time at a
specific phosphor
location.
BEAM MOVEMENT
Beam Movement
scan line - one row on the screen
interlace vs. non-interlace - Each frame is either drawn entirely, or as
two consecutively drawn fields that alternate horizontal scan lines.
vertical sync (vertical retrace) - the motion of the beam moving from
the bottom of the image to the top, after it has drawn a frame.
refresh rate - how many frames are drawn per second. Eye can see 24
frames per second. TV is 30 Hz, monitors are at least 60 Hz.
VECTOR DISPLAYS
Unlike CRTs, vector displays have a single
gun that is controlled to draw lines.
Think of having a VERY FAST drawing
pen.
Pros: Diagrams/only draw what you need
Cons: No fill objects/Slows with complexity
LIQUID CRYSTAL DISPLAYS (LCDS)
Also divided into pixels, but without an electron gun firing at a
screen, LCDs have cells that either allow light to flow
through, or block it.
LIQUID CRYSTAL DISPLAYS
Liquid crystal displays use small flat chips which change their
transparency properties when a voltage is applied.
LCD elements are arranged in an n x m array call the LCD
matrix
Level of voltage controls gray levels.
LCDs elements do not emit light, use backlights behind the LCD
matrix
LCDS (CONT.)
Color is obtained by placing filters in front of each LCD element
Usually black space between pixels to separate the filters.
Because of the physical nature of the LCD matrix, it is difficult to make
the individual LCD pixels very small.
Image quality dependent on viewing angle.
ADVANTAGES OF LCDS
Flat
Lightweight
Low power consumption
READ! READ! READ!!!
Aliasing & Anti-aliasing
Ivan Sutherland’s from MIT
Direct View Storage Tube (DVST)
How Realism in CG
Photorealism
Standards: GKS , ISO 2D standard (ISO
7942)
Industry-based standards: PHIGS,
RenderMan