Now Playing:
Giant Steps
From Giant Steps
Recorded May 4-5, 1959
John Coltrane - Tenor Sax
Tommy Flanagan - Piano
Paul Chambers - Bass
Art Taylor - Drums
Rasterization and
Real-time Graphics
COMP 575
August 21, 2007
• Change in office hours:
• Wednesday office hours moved to
3:30-5:00pm
• Schedule is linked from the course
home page:
• http://www.cs.unc.edu/~skarbez/comp575
• Slides and web notes will be posted
online over the weekend
Announcements
• Definition 1: The process of converting
a vector image (shapes) to a raster
image (dots)
• Why?
• Dots are the only things modern
displays can understand!
What is
“rasterization”?
Karl Ferdinand Braun, 1897
Image courtesy of Wikipedia
Cathode Ray Tube
Text
HP Oscilloscope
Vector Displays
Vector Displays
Asteroids, 1979
Tempest, 1981
Star Wars, 1983
• They just draw line segments
• User/computer:
• Define start and end points
• Display:
• Move electron gun to start point
• Turn electron gun on
• Move electron gun to end point
• Turn electron gun off
How Vector Displays
Work
• Require very little memory
• Important on a 64K system
• Conceptually very simple
• No aliasing of lines/curves
• We’ll come back to this later
• No fixed timing
• Refresh rate can be very high
Advantages of Vector
Displays
• Really just one: Can only draw line
segments
• Time needed to draw a screen
increases with number of lines drawn
• If most of the image isn’t black, you
won’t be able to finish drawing it in
time!
Disadvantages of
Vector Displays
Image courtesy of Wikipedia
Cathode Ray Tube
Text
1. Electron guns
2. Electron beams
3. Focusing coils
4. Deflection coils
5. Anode connection
6. Mask for separating
beams for red, green, and
blue part of displayed
image
7. Phosphor layer with red,
green, and blue zones
8. Close-up of the
phosphor-coated inner
side of the screen
Raster Displays
Vertical
Resolution
Scan
Line
Pixels
• Need a fairly large amount of memory
• Draws the whole screen “at once”
• Need a frame buffer that can hold the
information for a whole image
• Aliasing!
Disadvantages of
Raster Displays
• This is what causes “jaggies”
• A signal processing problem:
• The incoming signal (the desired
image) can only be sampled at pixel
centers on the display
• Demonstrations
Aliasing
• Refresh rate is not dependent on the
amount of pixels drawn
• Very important for drawing any
images that are not 90% black
Advantages of Raster
Displays
• Liquid Crystal Displays (LCD)
Other raster displays
Close-up of pixels
on an LCD display
A single subpixel of an LCD display
• Virtually all displays used today are
raster displays
• So, technically, anything that produces
an image on a screen “rasterizes”
• Definition 2: The rendering method
used by current graphics cards
What is
“rasterization”? (Part
2)
• Start with geometry
• We have some 3D model and/or
environment in the system, and we
want to draw it on the screen
• Problem: The display is, virtually
always, only 2D
• Need to transform the 3D model into
2D
How do we draw an
image?
• Problem: The display is, virtually
always, only 2D
• Need to transform the 3D model into
2D
• We do this with a virtual camera
• Represented mathematically by a 3x4
projection (or P) matrix
3D to 2D (Projection)
3D to 2D (Projection)
• Problem: How do we determine the
color of a piece of geometry?
• In the real world, color depends on the
object’s surface color and the color of
the light
• It is the same way in computer
graphics
• “Shading” is the process by which color
is assigned to geometry
Shading
• Problem: The camera doesn’t see the
whole scene
• In particular, the camera might only
see parts of objects
• Solution: Find objects that cross the
edge of the viewing volume, and “clip”
them
• Clip: Cut a polygon into multiple parts,
such that each is entirely inside or
outside the display area
Clipping
• Problem: How to convert these
polygons on a plane to pixels on a
screen?
• Have to figure out which pixels a
polygon covers
• A part of a polygon that covers one
pixel is called a “fragment
• Why? There can be multiple
fragments per pixel
Rasterization
Rasterizing a triangle
• Problem: How do we know which
fragment to use to color a given pixel?
• Need to know which fragment is in front
(not counting transparency)
Fragment Processing
• Start: Geometric model
• Compute color of geometry (Shading)
• Based on lighting and surface color
• Project geometry (Projection)
• Clip geometry (Clipping)
• Generate fragments from geometry
(Rasterization)
• Compute pixel colors from fragments
(Fragment processng)
• End: Display pixels
Rendering process
• Shading, projection, and clipping all
operate on the original geometry
• Combined into one unit, or “shader”
• “Vertex shader” or “geometry
shader”
• So this is a basic graphics pipeline:
Rendering pipeline
Geometry
Vertex
Shader
Rasterizer
Fragment
Shader
Pixels
• Next Tuesday
• Course Overview II: Real Cameras,
Vision, and Ray Tracing
• Next Thursday
• Math Basics: Matrices and Vectors
• Week 3
• Transforms (2D & 3D)
Class Schedule
• Week 4
• OpenGL
• Week 5
• Geometry & Modeling
• Lighting & Shading
• Week 6
• Lighting & Shading
• Clipping
Class Schedule
• Week 7
• Clipping
• Line Drawing
• Week 8
• Polygon Drawing
• Hidden Surface Removal
• Week 9
• Texture Mapping
Class Schedule

august23.ppt

  • 1.
    Now Playing: Giant Steps FromGiant Steps Recorded May 4-5, 1959 John Coltrane - Tenor Sax Tommy Flanagan - Piano Paul Chambers - Bass Art Taylor - Drums
  • 2.
  • 3.
    • Change inoffice hours: • Wednesday office hours moved to 3:30-5:00pm • Schedule is linked from the course home page: • http://www.cs.unc.edu/~skarbez/comp575 • Slides and web notes will be posted online over the weekend Announcements
  • 4.
    • Definition 1:The process of converting a vector image (shapes) to a raster image (dots) • Why? • Dots are the only things modern displays can understand! What is “rasterization”?
  • 5.
    Karl Ferdinand Braun,1897 Image courtesy of Wikipedia Cathode Ray Tube Text
  • 6.
  • 7.
  • 8.
    • They justdraw line segments • User/computer: • Define start and end points • Display: • Move electron gun to start point • Turn electron gun on • Move electron gun to end point • Turn electron gun off How Vector Displays Work
  • 9.
    • Require verylittle memory • Important on a 64K system • Conceptually very simple • No aliasing of lines/curves • We’ll come back to this later • No fixed timing • Refresh rate can be very high Advantages of Vector Displays
  • 10.
    • Really justone: Can only draw line segments • Time needed to draw a screen increases with number of lines drawn • If most of the image isn’t black, you won’t be able to finish drawing it in time! Disadvantages of Vector Displays
  • 11.
    Image courtesy ofWikipedia Cathode Ray Tube Text 1. Electron guns 2. Electron beams 3. Focusing coils 4. Deflection coils 5. Anode connection 6. Mask for separating beams for red, green, and blue part of displayed image 7. Phosphor layer with red, green, and blue zones 8. Close-up of the phosphor-coated inner side of the screen
  • 12.
  • 13.
    • Need afairly large amount of memory • Draws the whole screen “at once” • Need a frame buffer that can hold the information for a whole image • Aliasing! Disadvantages of Raster Displays
  • 14.
    • This iswhat causes “jaggies” • A signal processing problem: • The incoming signal (the desired image) can only be sampled at pixel centers on the display • Demonstrations Aliasing
  • 15.
    • Refresh rateis not dependent on the amount of pixels drawn • Very important for drawing any images that are not 90% black Advantages of Raster Displays
  • 16.
    • Liquid CrystalDisplays (LCD) Other raster displays Close-up of pixels on an LCD display A single subpixel of an LCD display
  • 17.
    • Virtually alldisplays used today are raster displays • So, technically, anything that produces an image on a screen “rasterizes” • Definition 2: The rendering method used by current graphics cards What is “rasterization”? (Part 2)
  • 18.
    • Start withgeometry • We have some 3D model and/or environment in the system, and we want to draw it on the screen • Problem: The display is, virtually always, only 2D • Need to transform the 3D model into 2D How do we draw an image?
  • 19.
    • Problem: Thedisplay is, virtually always, only 2D • Need to transform the 3D model into 2D • We do this with a virtual camera • Represented mathematically by a 3x4 projection (or P) matrix 3D to 2D (Projection)
  • 20.
    3D to 2D(Projection)
  • 21.
    • Problem: Howdo we determine the color of a piece of geometry? • In the real world, color depends on the object’s surface color and the color of the light • It is the same way in computer graphics • “Shading” is the process by which color is assigned to geometry Shading
  • 22.
    • Problem: Thecamera doesn’t see the whole scene • In particular, the camera might only see parts of objects • Solution: Find objects that cross the edge of the viewing volume, and “clip” them • Clip: Cut a polygon into multiple parts, such that each is entirely inside or outside the display area Clipping
  • 23.
    • Problem: Howto convert these polygons on a plane to pixels on a screen? • Have to figure out which pixels a polygon covers • A part of a polygon that covers one pixel is called a “fragment • Why? There can be multiple fragments per pixel Rasterization Rasterizing a triangle
  • 24.
    • Problem: Howdo we know which fragment to use to color a given pixel? • Need to know which fragment is in front (not counting transparency) Fragment Processing
  • 25.
    • Start: Geometricmodel • Compute color of geometry (Shading) • Based on lighting and surface color • Project geometry (Projection) • Clip geometry (Clipping) • Generate fragments from geometry (Rasterization) • Compute pixel colors from fragments (Fragment processng) • End: Display pixels Rendering process
  • 26.
    • Shading, projection,and clipping all operate on the original geometry • Combined into one unit, or “shader” • “Vertex shader” or “geometry shader” • So this is a basic graphics pipeline: Rendering pipeline Geometry Vertex Shader Rasterizer Fragment Shader Pixels
  • 27.
    • Next Tuesday •Course Overview II: Real Cameras, Vision, and Ray Tracing • Next Thursday • Math Basics: Matrices and Vectors • Week 3 • Transforms (2D & 3D) Class Schedule
  • 28.
    • Week 4 •OpenGL • Week 5 • Geometry & Modeling • Lighting & Shading • Week 6 • Lighting & Shading • Clipping Class Schedule
  • 29.
    • Week 7 •Clipping • Line Drawing • Week 8 • Polygon Drawing • Hidden Surface Removal • Week 9 • Texture Mapping Class Schedule

Editor's Notes

  • #6 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • #7 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • #8 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • #10 Show Tempest video from SIGGRAPH http://en.wikipedia.org/wiki/Vector_graphics http://www.cca.org/vector/
  • #11 Show Tempest video from SIGGRAPH http://en.wikipedia.org/wiki/Vector_graphics http://www.cca.org/vector/
  • #12 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • #13 http://en.wikipedia.org/wiki/Cathode_ray_tube
  • #14 Show Tempest video from SIGGRAPH http://en.wikipedia.org/wiki/Vector_graphics http://www.cca.org/vector/
  • #15 http://burtonmackenzie.blogspot.com/2006/07/i-cant-drive-55.html http://www.dsptutor.freeuk.com/aliasing/AD102.html
  • #16 http://burtonmackenzie.blogspot.com/2006/07/i-cant-drive-55.html http://www.dsptutor.freeuk.com/aliasing/AD102.html