Computer Graphics (CSE 4103)
Computer Graphics (CSE 4103)
Computer Graphics (CSE 4103)
University of Dhaka
Computer Graphics (CSE 4103)
3.0 Credits, 45 Hours lectures
Class Time:
Sunday
10:00 AM- 11:30 AM
Tuesday
10:00 AM- 11:30 AM
Sessional/ Lab classes:
Sunday: 2:00 PM- 5:00 PM
(Gr-1)
Tuesday: 2:00 PM- 5:00 PM
(Gr-2)
“Perhaps the best way to define computer graphics is to find out what it is not. It is not a machine. It is not
a computer, nor a group of computer programs. It is not the know-how of a graphic designer, a
programmer, a writer, a motion picture specialist, or a reproduction specialist.
Computer graphics is all these – a consciously managed and documented technology directed toward
communicating information accurately and descriptively.”
Computer Graphics, by William A. Fetter, 1966
Scope of Computer Graphics
Broad sense: Any computer-driven display of visual information
For example:
Text
Line drawings
Graphs, Charts, Schematics
Realistic Pictures
Any designs
Hardcopy devices:
vector technologies: Pen plotters
raster technologies: CRT camera, dot matrix, ink jet, etc
Electronic displays:
vector technologies: swept, direct view storage
raster technologies: CRT, LCD, plasma, etc.
Graphics Display Hardware
Vector (calligraphic, stroke, random- Raster (TV, bitmap, pixmap) used in
scan) displays and laser printers
• Driven by display commands • Driven by array of pixels (no semantics,
– (move (x, y), char(“A”) , line(x, y)…)
lowest form of representation)
• Note “jaggies” (aliasing errors) due to
• Survives as “scalable vector discrete sampling of continuous
graphics” primitives
Ideal Vector
Drawing Drawing Outline Filled
Vector Display
60s through mid 80s Practically obsolete now.
Disadvantages
Need for scan conversion, e.g., lines to pixels.
Slower real-time dynamics
Problems with aliasing (the jaggies)
Enabling Modern Computer Graphics (1/5)
• Hardware revolution
– Moore’s Law: every 12-18 months, computer power improves by
factor of 2 in price / performance as feature size shrinks
– Significant advances in commodity graphics chips every 6 months
vs. several years for general purpose CPUs
• NVIDIA GTX Titan Z… 8122 gigaflops
– Newest CPUs are 64-bit, 2, 4, 6, 8, or 10 core
• Intel Core i7 – consumer, up to 6 cores hyperthreaded to provide 12
threads
• Intel Haswell – industrial, 8 cores HT, 16 threads
Enabling Modern Computer Graphics (2/5)
• Graphic subsystems
– Offloads graphics processing from CPU to chip designed for doing
graphics operations quickly
– nVidia GeForce™, AMD Radeon™
– GPUs originally designed to handle special-purpose graphics
computations
– Increasingly, GPUs used to parallelize other types of computation
(known as GPGPU, or General-Purpose Computing on the Graphics
Processing Unit)
• Hardware show and tell: Dept’s NVIDIA GeForce GTX 460s
– 1.35 GHz clock, 1GB memory, 37.8 billion pixels/second fill rate
– Old cards: GeForce 7300 GT: 350 MHz clock, 256 MB memory, 2.8
billion
fill rate
9/4/2014 20
Enabling Modern Computer Graphics (3/4)
• Input Devices
– Mouse, tablet & stylus, multi-touch, force feedback, and
other game controllers (e.g., Wii), scanner, digital camera
(images, computer vision), etc.
– Body as interaction device
• Software Improvements
– Algorithms and data structures
• Modeling of materials
• Rendering of natural phenomena
• “Acceleration data structures” for ray tracing and other
renderers
– Parallelization
• Most operations are embarrassingly parallel: changing value
of one pixel is often independent of other pixels
– Distributed and Cloud computing
• Send operations into ‘cloud’, get back results, don’t care how
• Rendering even available as internet service!
What is Interactive Computer
Graphics? (1/2)
• User controls content, structure, and appearance of
objects and their displayed images via rapid visual
feedback
• Basic components of an interactive graphics system
– input (e.g., mouse, tablet and stylus, multi-touch…)
– processing (and storage)
– display/output (e.g., screen, paper-based printer,
video recorder…)
• First truly interactive graphics system, Sketchpad,
pioneered at MIT by Ivan Sutherland for his 1963 Ph.D.
thesis
• Used TX-2 transistorized “mainframe” at Lincoln Lab
What is Interactive Computer
Graphics? (1/2)
Software Hardware
Graphics
System/
GPU
Application Application Graphics
Model / database program Library
9/4/2014 27
Graphics Library
• Examples: OpenGL™, DirectX™, Windows Presentation
Foundation™ (WPF), RenderMan™, HTML5 + WebGL™
• Primitives (characters, lines, polygons, meshes,…)
• Attributes
– Color, line style, material properties for 3D
• Lights
• Transformations
• Immediate mode vs. retained mode
– immediate mode: no stored representation, package holds
only attribute state, and application must completely draw
each frame
– retained mode: library compiles and displays from
scenegraph that it maintains, a complex DAG. It is a
display-centered extract of the Application Model
Sample-based Graphics (1/2)
• Sample-based graphics: Discrete
samples are used to describe visual
information
– pixels can be created by digitizing images,
using a sample-based “painting” program,
etc.
– often some aspect of the physical world is
sampled for visualization, e.g.,
temperature across the US
– example programs: Adobe Photoshop™,
GIMP™ , Adobe AfterEffects™
Sample-based Graphics (2/2)
• Once an image is defined as pixel-array, it can be manipulated
– Image editing: changes made by user, such as cutting and pasting sections,
brush-type tools, and processing selected areas
– Image processing: algorithmic operations that are performed on image (or pre-
selected portion of image) without user intervention. Blurring, sharpening,
edge-detection, color balancing, rotating, warping. These are front-end
processes to Computer Vision.
What’s the Advantage?
• Once image is defined in terms of colors at
(x, y) locations on grid, can change image
easily by altering location or color values
• E.g., if we reverse our mapping above and
make 10 = white and 0 = black, the image
would look like this:
• Pixel information from one image can be
copied and pasted into another, replacing
or combining with previously stored pixels
What’s the Disadvantage?
• WYSIAYG (What You See Is All You Get): No additional
information
– no depth information
– can’t examine scene from different point of view
– at most can play with the individual pixels or groups of pixels to change
colors, enhance contrast, find edges, etc.
– But increasingly great success in image-based rendering to fake 3D
scenes and arbitrary camera positions. New images constructed by
interpolation, composition, warping and other operations.
Geometry-Based Graphics (1/2)
• Geometry-based graphics (also called
scalable vector graphics or object-oriented
graphics): geometrical model is created,
along with various appearance attributes,
and is then sampled for visualization
(rendering, a.k.a image synthesis)
– often some aspect of physical world is visually
simulated, or “synthesized”
– examples of 2D apps: Adobe Illustrator™, Adobe
Freehand™, Corel CorelDRAW™
– examples of 3D apps: Autodesk’s AutoCAD™,
Autodesk’s (formerly Alias|Wavefront’s) Maya™,
Autodesk’s 3D Studio Max™
Geometry-Based Graphics (2/2)
• Geometry-based graphics applications
– Store mathematical descriptions, or “models,” of geometric
elements (lines, polygons, polyhedrons, polygonal meshes…) and
associated attributes (e.g., color, material properties).
– Geometric elements are primitive shapes, primitives for short.
– Images are created via sampling of geometry for viewing, but not
stored as part of model.
– Users cannot usually work directly with individual pixels in
geometry-based programs; as user manipulates geometric elements,
program resamples and redisplays elements
• Increasingly rendering combines geometry- and sample-based
graphics, both as performance hack and to increase quality of final
product
– geometric characters on painted or scanned scene images
What is Geometric Modeling?
• What is a model?
• Captures salient features (data, behavior) of thing/phenomenon
being modeled
– data includes geometry, appearance, attributes…
– note similarity to OOP ideas
• Modeling allows us to cope with complexity
• Our focus: modeling and viewing simple everyday objects
• Consider this:
– Through 3D computer graphics, first time in human history we have
abstract, easily changeable 3D forms.
• Has revolutionized working process of many fields – science, engineering,
industrial design, architecture, commerce, entertainment, etc. Profound
implications for visual thinking and visual literacy
• “Visual truth” is gone in the Photoshop and FX-saturated world (but
consider painting and photography…) – seeing no longer is believing…(or
shouldn’t be!)
Modeling vs. Rendering
Modeling
– Create models Both can be done with commercial
– Apply materials to models software:
– Place models around scene Autodesk MayaTM ,3D Studio MaxTM,
– Place lights in scene BlenderTM, etc.
– Place the camera
Rendering
Take “picture” with camera
Point Light
Spot
Light
Directional Light
Ambient
Light
Thank you