Computer Graphics
CSC 565
What is Computer Graphics?
• Creation, Manipulation, and Storage of
geometric objects (modeling) and their
images (rendering)
• Display those images on screens or
hardcopy devices
• Image processing
• Others: GUI, Haptics, Displays (VR)...
What drives computer graphics?
• Movie Industry
– Leaders in quality and artistry
– Not slaves to conceptual purity
– Big budgets and tight schedules
– Reminder that there is more to
CG than technology
– Hey, How'd they do that?
– 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
Slide information from Leonard
What drives computer graphics?
• Medical Imaging and Scientific Visualization
– Tools for teaching and diagnosis
• No cheating or tricks allowed
– New data representations and modalities
– Drive issues of precision and correctness
– Focus on presentation and interpretation of
data
– Construction of models from acquired data
Nanomanipulator, UNC
Joe Kniss, Utah
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
ProEngineer, www.ptc.com
What drives computer graphics?
• Graphic User Interfaces (GUI)
– www.webpagesthatsuck.com
Slide information from Leonard
What is Computer Graphics?
• Look at 5 areas
– Hardware
– Rendering
– Interaction
– Modeling
– Scientific Visualization
Hardware: Amazing Changes
• Fundamental architecture shift
– Dual computing engines:
• CPU and GPU
• More in GPU than CPU
Hardware: Amazing Changes
• Fast, cheap GPUs
– ~$300
• Cheap memory
• Displays at low cost
– How many monitors do you have/use?
Hardware: Amazing Changes
• Wired -> Unwired
• World of Access
Hardware... some not so good
• Devices
• 3D displays
• Etc
Rendering
• Many think/thought graphics synonymous
with rendering
• Well researched
– Working on second and third order effects
– Fundamentals largely in place
Rendering
• Ray Tracing has become practical
– Extremely high quality images
– Photorealism, animation, special effects
• Accurate rendering, not just pretty
Rendering Realism
Rendering Realism
Is this real?
Terrain Modeling:
Snow and Trees Added
Growth Models
Rendering/Modeling Hair
Humans
Is Photorealism Everything?
Tone Shading
NonPhotorealistic Rendering
Image Based Rendering
• Model light field
• Do not have to model geometry
• Good for complex 3D scenes
• Can leave holes where no data is available
3D Scene Capture
3D Scene Recreation
360o Scan
Interaction
• Way behind rest of graphic's spectacular
advances
• Still doing WIMP:
– Windows, icons, menus, pull-downs/pointing
• Once viewed as “soft” research
– Turns out to be one of hardest problems
Interaction still needs...
• Better input devices
• Better output devices
• Better interaction paradigms
• Better understanding of HCI
– Bring in psychologists
Modeling
• Many model reps
– Bezier, B-spline, box splines, simplex splines,
polyhedral splines, quadrics, super-quadrics,
implicit, parametric, subdivision, fractal, level
sets, etc (not to mention polygonal)
Modeling
• Physically based
– Newton
– Behavior as well as geometry
• Materials
– Metal, cloth, organic forms, fluids, etc
• Procedural (growth) models
Modeling... is hard
• Complexity
• Shape
• Specifying
• Realistic constraints
• Detail vs concept
• Tedious, slow
Modeling is hard
• Mathematical challenge
• Computational challenge
• Interaction challenge
• Display challenge (want 3D)
• Domain knowledge, constraints
Model Capture
Models
D Johnson and
J D St Germain, Utah
Russ Fish et al., Utah
Scientific Visualization
National Library of
Medicine
In This Class
• Review rasterization, modeling, viewing,
lighting, texture mapping and raytracing
• GUI and Interaction in three-dimensions
First Lecture
• The graphics processes
– What we will cover on this course
• Some definitions
– Fundamental units we use in these processes
• First Practical
12/02/22 Lecture 1 39
Overview of the Course
• Graphics Pipeline (Today)
• Modelling
– Surface / Curve modelling
• (Local lighting effects) Illumination, lighting, shading,
mirroring, shadowing
• Rasterization (creating the image using the 3D scene)
• Ray tracing
• Global illumination
• Curves and Surfaces
12/02/22 Lecture 1 40
Graphics/Rendering Pipeline
• Graphics processes generally execute
sequentially
• Pipelining the process means dividing it
into stages
• Especially when rendering in real-time,
different hardware resources are assigned
for each stage
12/02/22 Lecture 1 41
Graphics / Rendering Pipeline
• There are three stages
– Application Stage
– Geometry Stage
– Rasterization Stage
12/02/22 Lecture 1 42
Application stage
• Entirely done in software by the CPU
• Read Data
– the world geometry database,
– User’s input by mice, trackballs, trackers, or sensing
gloves
• In response to the user’s input, the application
stage change the view or scene
12/02/22 Lecture 1 43
Geometry Stage
Modeling: shapes
Model Transformation
Transformation: viewing
Hidden Surface Elimination
Rasterization
Stage
Shading: reflection and lighting
12/02/22 Lecture 1 44
Rasterization Stage
Geometry Stage
Rasterization and Sampling
Texture Mapping
Image Composition
Intensity and Colour Quantization
Framebuffer/Display
12/02/22 Lecture 1 45
An example thro’ the pipeline…
The scene we are trying to represent:
Images courtesy of Picture Inc.
12/02/22 Lecture 1 46
Geometry Pipeline
Loaded 3D Models
Model Transformation
Transformation: viewing
Hidden Surface Elimination
Imaging
Shading: reflection and lighting Pipeline
12/02/22 Lecture 1 47
Preparing Shape Models
Designed by polygons, parametric curves/surfaces,
implicit surfaces and etc.
Defined in its own coordinate system
12/02/22 Lecture 1 48
Model Transformation
Objects put into the scene by applying translation, scaling and
rotation
Linear transformation called homogeneous transformation is used
The location of all the vertices are updated by this transformation
12/02/22 Lecture 1 49
Perspective Projection
We want to create a picture of the scene viewed from the camera
We apply a perspective transformation to convert the 3D
coordinates to 2D coordinates of the screen
Objects far away appear smaller, closer objects appear bigger
12/02/22 Lecture 1 50
Hidden Surface Removal
Objects occluded by other objects must not be drawn
12/02/22 Lecture 1 51
Shading
Now we need to decide the colour of each pixels taking into account
the object’s colour, lighting condition and the camera position
point light source
Object
12/02/22 Lecture 1 52
Shading : Constant Shading - Ambient
Objects colours by its own colour
12/02/22 Lecture 1 53
Shading – Flat Shading
Objects coloured based on its own colour and the lighting condition
One colour for one face
12/02/22 Lecture 1 54
Gouraud shading, no specular highlights
Lighting calculation per vertex
12/02/22 Lecture 1 55
Specular highlights added
Light perfectly reflected in a mirror-like way
12/02/22 Lecture 1 56
Phong shading
It interpolates surface normals across rasterized polygons and
computes pixel colors based on the interpolated normals and a
reflection model.
12/02/22 Lecture 1 57
Next, the Imaging Pipeline
Geometry
Pipeline
Rasterization and Sampling
Texture Mapping
Image Composition
Intensity and Colour Quantization
Framebuffer/Display
12/02/22 Lecture 1 58
Rasterization
• Converts the vertex information output by
the geometry pipeline into pixel
information needed by the video display
• Aliasing: distortion artifacts produced
when representing a high-resolution signal
at a lower resolution.
• Anti-aliasing : technique to remove aliasing
12/02/22 Lecture 1 59
Anti-aliasing
Aliased polygons
Anti-aliased polygons
(jagged edges)
12/02/22 Lecture 1 60
How is anti-aliasing done? Each pixel is subdivided
(sub-sampled) in n regions, and each sub-pixel has a color;
Compute the average color value
12/02/22 Lecture 1 61
Texture mapping
12/02/22 Lecture 1 62
Other covered topics:
Reflections, shadows & Bump mapping
12/02/22 Lecture 1 63
Other covered topics:
Global Illumination
12/02/22 Lecture 1 64
Polynomial Curves, Surfaces
Graphics Definitions
• Point
– a location in space, 2D or 3D
– sometimes denotes one pixel
• Line
– straight path connecting two points
– infinitesimal width, consistent density
– beginning and end on points
12/02/22 Lecture 1 66
• Vertex
Graphics Definitions
– point in 3D
• Edge
– line in 3D connecting two vertices
• Polygon/Face/Facet
– arbitrary shape formed by connected vertices
– fundamental unit of 3D computer graphics
• Mesh
– set of connected polygons forming a surface (or object)
–:
12/02/22 Lecture 1 67
Graphics Definitions
• Rendering : process of generating an image
from the model
• Framebuffer : a video output device that
drives a video display from a memory
containing the color for every pixel
12/02/22 Lecture 1 68
First Practical
• Our first assignment will be setting-up and making
sure OpenGL is running properly on your machine.
• First Project:
• Building a platform to simulate data.
12/02/22 Lecture 1 69
Summary
• The course is about algorithms and applied
graphics applications
• Lots of mathematics
• Graphics execution is a pipelined approach
• Basic definitions presented
• Some support resources indicated
12/02/22 Lecture 1 70