Topic 1 Introduction to Computer
Graphics
Dr. Collins Oduor
Kenyatta University
2
Objectives
 In this lecture, we explore what computer graphics is
about and survey some application areas
 We start with a historical introduction
3
Computer Graphics
 Computer graphics deals with all aspects of creating
images with a computer
 Hardware
 Software
 Applications
4
Example
 Where did this image come from?
 What hardware/software did we need to produce it?
5
Preliminary Answer
 Application: The object is an artist’s rendition of
the sun for an animation to be shown in a domed
environment (planetarium)
 Software: Maya for modeling and rendering but
Maya is built on top of OpenGL
 Hardware: PC with graphics card for modeling and
rendering
6
Basic Graphics System
Input devices
Output device
Image formed in FB
7
CRT
Can be used either as a line-drawing device
(calligraphic) or to display contents of frame
buffer (raster mode)
8
Computer Graphics: 1950-1960
 Computer graphics goes back to the earliest days of
computing
 Strip charts
 Pen plotters
 Simple displays using A/D converters to go from computer
to calligraphic CRT
 Cost of refresh for CRT too high
 Computers slow, expensive, unreliable
9
Computer Graphics: 1960-1970
 Wireframe graphics
 Draw only lines
 Sketchpad
 Display Processors
 Storage tube
wireframe representation
of sun object
10
Sketchpad
 Ivan Sutherland’s PhD thesis at MIT
 Recognized the potential of man-machine interaction
 Loop
 Display something
 User moves light pen
 Computer generates new display
 Sutherland also created many of the now common
algorithms for computer graphics
11
Display Processor
 Rather than have the host computer try to refresh
display use a special purpose computer called a
display processor (DPU)
 Graphics stored in display list (display file) on
display processor
 Host compiles display list and sends to DPU
12
Direct View Storage Tube
 Created by Tektronix
 Did not require constant refresh
 Standard interface to computers
 Allowed for standard software
 Plot3D in Fortran
 Relatively inexpensive
 Opened door to use of computer graphics for CAD
community
13
Computer Graphics: 1970-1980
 Raster Graphics
 Beginning of graphics standards
 IFIPS
 GKS: European effort
 Becomes ISO 2D standard
 Core: North American effort
 3D but fails to become ISO standard
 Workstations and PCs
14
Raster Graphics
 Image produced as an array (the raster) of picture
elements (pixels) in the frame buffer
15
Raster Graphics
 Allows us to go from lines and wire frame images to
filled polygons
16
PCs and Workstations
 Although we no longer make the distinction between
workstations and PCs, historically they evolved from
different roots
 Early workstations characterized by
 Networked connection: client-server model
 High-level of interactivity
 Early PCs included frame buffer as part of user memory
 Easy to change contents and create images
17
Computer Graphics: 1980-1990
Realism comes to computer graphics
smooth shading environment
mapping
bump mapping
18
Computer Graphics: 1980-1990
 Special purpose hardware
 Silicon Graphics geometry engine
 VLSI implementation of graphics pipeline
 Industry-based standards
 PHIGS
 RenderMan
 Networked graphics: X Window System
 Human-Computer Interface (HCI)
19
Computer Graphics: 1990-2000
 OpenGL API
 Completely computer-generated feature-length movies
(Toy Story) are successful
 New hardware capabilities
 Texture mapping
 Blending
 Accumulation, stencil buffers
20
Computer Graphics: 2000-2010
 Photorealism
 Graphics cards (GPU) for PCs dominate market
 Nvidia, ATI
 Game boxes and game players determine direction of
market (Wii, Kinect, etc)
 Computer graphics routine in movie industry: Maya,
Lightwave
 Programmable pipelines
21
Computer Graphics: 2010-
 Mobile Computing
 iPhone
 Cloud Computing
 Amazon Web Services (AWS)
 Virtual Reality
 Oculus Rift
 Artificial Intelligence
 Big Data/Deep Learning
 Google Car
 Computer graphics generally means creation, storage
and manipulation of models and images
 Such models come from diverse and expanding set of
fields including physical, biological, mathematical,
artistic, and conceptual/abstract structures
22/39
What is Computer Graphics? (1/2)
© 9/6/2018
Frame from animation by William Latham,
shown at SIGGRAPH 1992. Latham creates his
artwork using rules that govern patterns of
natural forms.
Our newest visual computing faculty member,
Daniel Ritchie’s Ph.d. thesis:
Probabilistic Programming for Procedural Modeling and Desi
gn
 William Fetter coined term “computer graphics”
in 1960 to describe new design methods he was
pursuing at Boeing for cockpit ergonomics
 Created a series of widely reproduced images on
“pen plotter” exploring cockpit design, using 3D
model of human body.
What is Computer Graphics? (2/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
23/39
© 9/6/2018
 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, stylus, multi-touch, in-air fingers…)
 processing (and storage of the underlying representation/model)
 display/output (e.g., screen, paper-based printer,
video recorder…)
 First truly interactive graphics system,
Sketchpad, pioneered by Ivan Sutherland 1963 Ph.D. thesis
Sketchpad, A Man-Machine Graphical
Communication System
 Used TX-2 transistorized “mainframe”
at MIT Lincoln Lab
24/39
What is Interactive* Computer Graphics?
(1/2)
© 9/6/2018
Note CRT monitor, light
pen, and function-key
panels – the “organ
console” showing bi-
manual operation
* Sometimes called real-time computer graphics, and in certain
contexts, real-time rendering
 Almost all key elements of interactive graphics system are expressed
in first paragraph of Sutherland’s 1963 Ph.D. thesis
25/39
What is Interactive Computer Graphics? (2/2)
© 9/6/2018
The Sketchpad system uses drawing as a novel
communication medium for a computer. The system
contains input, output, and computation programs which
enable it to interpret information drawn directly on a
computer display. Sketchpad has shown the most usefulness
as an aid to the understanding of processes, such as the
motion of linkages, which can be described with pictures.
Sketchpad also makes it easy to draw highly repetitive or
highly accurate drawings and to change drawings
previously drawn with it…
 Today, we still use non-interactive batch mode (aka offline rendering) for final
production-quality video and film (special effects – FX). Rendering a single
frame of The Good Dinosaur (2015, a 24 fps movie) averaged 48 hours on a
30,000-core render farm!
26/39
What is Batch Computer Graphics?
© 9/6/2018
Pixar’s Render Farm
Still from The Good Dinosaur
Statistics from
https://www.fxguide.com/featured/making-the-world-of-pixars-the-go
od-dinosaur/
 Hardware revolution
 Moore’s Law: every 12-18 months, computer power
improves by factor of 2 in price / performance as size
shrinks
 Newest CPUs are 64-bit with 4, 8, 16, even up to 22 cores
 Intel Coffee Lake – consumer processor with 8 cores, 16
threads, and a fully featured graphics chip built in to the
processor
 Significant advances in commodity graphics chips every
6 months vs. several years for general purpose CPUs
 NVIDIA GeForce RTX 2080 Ti… 4352 cores, 11GB
memory, and 14+ teraflops of processing power in a
single chip
27/39
Enabling Modern Computer Graphics (1/5)
©9/6/2018 NVIDIA statistics from
https://www.nvidia.com/en-us/geforce/graphics-cards/rtx-2080-ti/
 Graphic subsystems
 Offloads graphics processing from CPU to chip designed for doing graphics
operations quickly
 NVIDIA GeForce™, AMD Vega™, and Intel HD and Iris Pro Graphics
 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: NVIDIA GeForce GTX 1080 Ti (2017)
 3584 cores, 1.58 GHz clock, 11GB memory, 139 billion pixels/second fill rate
 Department machines (row 6): NVIDIA GeForce GTX 970 (2014) – still VR
capable
 1664 cores, 1.05 GHz clock, 4GB memory, 75 billion pixels/second fill rate
 Department machines: NVIDIA GeForce GTX 460 (2010) – fine for 123
assgns.
 336 cores, 1.35 GHz clock, 1GB memory, 37.8 billion pixels/second fill rate
28/39
Enabling Modern Computer Graphics (2/5)
© 9/6/2018
 Input Devices
 Mouse, tablet & stylus, multi-touch, force feedback, and
other game controllers (e.g., JoyCon for Nintendo Switch),
scanner, digital camera (images, computer vision), etc.
 Body as interaction device
 http://youtu.be/zXghYjh6Gro
 Kinect is not as relevant anymore commercially b/c VR is
more immersive
29/39
Enabling Modern Computer Graphics (3/5)
© 9/6/2018
Xbox Kinect: Leap Motion:
 Many form factors
 Smartphones/laptops/desktops/tablets
 Smart watches
 Head-mounted displays (HMDs)
 HTC Vive
 Augmented Reality
 Virtual Reality
 AR vs VR: Different experiences!
30/39
Enabling Modern Computer Graphics (4/5)
© 9/6/2018
Brown’s old Cave
Microsoft’s first
Surface
Apple iPhone
Android Phones
Google Cardboard
Tablets
Microsoft Hololens
Android Wear
Apple Watch
Vive Oculus Rift
 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: calculating
value of one pixel is often independent of other pixels
 Distributed and Cloud computing
 Send operations to the cloud, get back results, don’t care how
 Rendering even available as internet service!
31/39
Enabling Modern Computer Graphics (5/5)
© 9/6/2018
Vector (calligraphic, stroke, random-scan)
Raster (TV, bitmap, pixmap) used in
displays and laser printers
 Driven by display commands
 (move (x, y), char(“A”) , line(x, y)…)
 Survives as “scalable vector
graphics”
 Driven by array of pixels (no semantics,
lowest form of representation)
 Note “jaggies” (aliasing errors) due to
discrete sampling of continuous
primitives
Graphics Display Hardware
Ideal
Drawing
Vector
Drawing Outline Filled
32/39
© 9/6/2018
 Graphics library/package is intermediary between application and display
hardware (Graphics System)
 Application program maps application objects to views (images) of those
objects by calling on graphics library. Application model may contain lots
of non-graphical data (e.g., non-geometric object properties)
 User interaction results in modification of image and/or model
 This hardware and software framework is 5 decades old but is still useful
33/39
Conceptual Framework for Interactive
Graphics
© 9/6/2018
Graphics
System/
GPU
Application
Model / database
Software Hardware
Application
program
Graphics
Library
 Examples: OpenGL™, DirectX™, Windows Presentation Foundation™
(WPF) accessed via XAML, 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
34/39
Graphics Library
© 9/6/2018
Sample-based graphics vs Geometry-based
graphics
35/39
Application Distinctions: Two Basic Paradigms
© 9/6/2018
 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™ (which came out of
CS123/CS224!)
36/39
Sample-based Graphics (1/3)
© 9/6/2018
 Pixels are point locations with associated sample values, usually of
light intensities/colors, transparency, and other control information
 When we sample an image, we sample the point location along the
continuous signal and we cannot treat the pixels as little circles or
squares, though they may be displayed as such
37/39
Sample-based Graphics (2/3)
© 9/6/2018
Visualization of a
mathematical pixel grid LCD display
CRT* beam illumination pattern
Can’t visually resolve
adjacent pixels on CRT
1 pixel
light intensity
* Cathode Ray Tube, like those really old TVs
 Samples created directly in Paint-type program, or by sampling of continuous (analog) visual
materials (light intensity/color measured at regular intervals) with many devices including:
 flatbed and drum scanners
(e.g., https://luminous-landscape.com/drum-scans/ )
 digital still and motion (video) cameras
 Sample values can also be input numerically (e.g., with numbers from computed dataset)
 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, Computational Photography
38/39
Sample-based Graphics (3/3)
© 9/6/2018
 Lets do some sampling of CIT building
 A color value is measured at every grid point and used to color
corresponding grid square
 Crude sampling and image reconstruction method creates blocky image
39/39
Sampling an Image
© 9/6/2018
3D scene
0 = white, 5 = gray, 10 = black
 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
40/39
What’s the Advantage?
© 9/6/2018
 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.
 For a computational and cognitive science perspective,
take James Tompkin’s Computer Vision (CSCI1430)
41/39
What’s the Disadvantage?
© 9/6/2018
“Scene Reconstruction from High Spatio-Angular
Resolution Light Fields” by Kim, Zimmer et al.,
2013
 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™
and Corel CorelDRAW™
 examples of 3D apps: Autodesk’s
AutoCAD™, Autodesk’s (formerly Alias|
Wavefront’s) Maya™, Autodesk’s 3D Studio
Max™
42/39
Geometry-Based Graphics (1/2)
© 9/6/2018
 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
 CG animated characters (geometry) on painted or filmed scene
images (samples)
43/39
Geometry-Based Graphics (2/2)
© 9/6/2018
 What is a model?
 Captures salient features (data, behavior) of object/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, we have abstract, easily changeable 3D
forms, for the first time in human history
 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!)
44/39
What is Geometric Modeling?
© 9/6/2018
 Modeling
 Create models
 Apply materials to models
 Place models around scene
 Place lights in scene
 Place the camera
45/39
Modeling vs. Rendering
© 9/6/2018
Directional Light
Ambient
Light
Point Light
Spot
Light
CS128 lighting assignment by Patrick Doran, Spring 2009
 Rendering
Take “picture” with camera
 Both can be done with commercial software:
Autodesk MayaTM
,3D Studio MaxTM
, BlenderTM
, e
 Divide and Conquer
 Hierarchy of geometrical components
 Reduction to primitives (e.g., spheres, cubes, etc.)
 Simple vs. not-so-simple elements (nail vs. screw)
46/39
Decomposition of a Geometric Model
© 9/6/2018
Head
Shaft
Point
composition decomposition
 Object to be modeled is (visually) analyzed, and then decomposed into collections of
primitive shapes.
 Tree diagram provides visual method of expressing “composed of” relationships of
model
 Such diagrams are part of 3D program interfaces (e.g., 3D Studio MAX, Maya)
 As a data structure to be rendered, it is called a scenegraph
47/39
Hierarchical (Tree) Diagram of Nail
© 9/6/2018
Nail
Head
(cylinder)
Body
root node
leaf nodes
Shaft
(cylinder)
Point
(cone)
tree diagram
 Primitives created in decomposition process must be
assembled to create final object. Done with affine
transformations, T, R, S (as in above example). Order
matters – these are not commutative!
48/39
Composition of a Geometric Model
© 9/6/2018
Primitives
in their own modeling
coordinate system
Composition
in world (root)
coordinate system
Translate
Scale and Translate
Rotate and Translate
 Computer graphics involves both real-time / interactive applications and batch /
offline applications
 Both equally important, but different use cases
 Photo-realism has really advanced
 But it still takes dozens of hours on fastest computers to mimic physics of photons
interacting with physical environments
 Hardware evolution from vector to raster graphics
 Vector graphics survives as Scalable Vector Graphics, which transforms without artifacts
 Geometry-based vs. image-based graphics
 Mathematical definition vs. pixel manipulation
 Pixels are discrete samples of continuous functions
 Causes artifacts (“jaggies”/ “aliases”) to appear (we will study fixes – “anti-aliasing” thru
filtering)
 Geometric models typically constructed hierarchically
 Scene graph data structure
49/39
In Summary
© 9/6/2018

Topic 1 Introduction to Computer Graphics.ppt

  • 1.
    Topic 1 Introductionto Computer Graphics Dr. Collins Oduor Kenyatta University
  • 2.
    2 Objectives  In thislecture, we explore what computer graphics is about and survey some application areas  We start with a historical introduction
  • 3.
    3 Computer Graphics  Computergraphics deals with all aspects of creating images with a computer  Hardware  Software  Applications
  • 4.
    4 Example  Where didthis image come from?  What hardware/software did we need to produce it?
  • 5.
    5 Preliminary Answer  Application:The object is an artist’s rendition of the sun for an animation to be shown in a domed environment (planetarium)  Software: Maya for modeling and rendering but Maya is built on top of OpenGL  Hardware: PC with graphics card for modeling and rendering
  • 6.
    6 Basic Graphics System Inputdevices Output device Image formed in FB
  • 7.
    7 CRT Can be usedeither as a line-drawing device (calligraphic) or to display contents of frame buffer (raster mode)
  • 8.
    8 Computer Graphics: 1950-1960 Computer graphics goes back to the earliest days of computing  Strip charts  Pen plotters  Simple displays using A/D converters to go from computer to calligraphic CRT  Cost of refresh for CRT too high  Computers slow, expensive, unreliable
  • 9.
    9 Computer Graphics: 1960-1970 Wireframe graphics  Draw only lines  Sketchpad  Display Processors  Storage tube wireframe representation of sun object
  • 10.
    10 Sketchpad  Ivan Sutherland’sPhD thesis at MIT  Recognized the potential of man-machine interaction  Loop  Display something  User moves light pen  Computer generates new display  Sutherland also created many of the now common algorithms for computer graphics
  • 11.
    11 Display Processor  Ratherthan have the host computer try to refresh display use a special purpose computer called a display processor (DPU)  Graphics stored in display list (display file) on display processor  Host compiles display list and sends to DPU
  • 12.
    12 Direct View StorageTube  Created by Tektronix  Did not require constant refresh  Standard interface to computers  Allowed for standard software  Plot3D in Fortran  Relatively inexpensive  Opened door to use of computer graphics for CAD community
  • 13.
    13 Computer Graphics: 1970-1980 Raster Graphics  Beginning of graphics standards  IFIPS  GKS: European effort  Becomes ISO 2D standard  Core: North American effort  3D but fails to become ISO standard  Workstations and PCs
  • 14.
    14 Raster Graphics  Imageproduced as an array (the raster) of picture elements (pixels) in the frame buffer
  • 15.
    15 Raster Graphics  Allowsus to go from lines and wire frame images to filled polygons
  • 16.
    16 PCs and Workstations Although we no longer make the distinction between workstations and PCs, historically they evolved from different roots  Early workstations characterized by  Networked connection: client-server model  High-level of interactivity  Early PCs included frame buffer as part of user memory  Easy to change contents and create images
  • 17.
    17 Computer Graphics: 1980-1990 Realismcomes to computer graphics smooth shading environment mapping bump mapping
  • 18.
    18 Computer Graphics: 1980-1990 Special purpose hardware  Silicon Graphics geometry engine  VLSI implementation of graphics pipeline  Industry-based standards  PHIGS  RenderMan  Networked graphics: X Window System  Human-Computer Interface (HCI)
  • 19.
    19 Computer Graphics: 1990-2000 OpenGL API  Completely computer-generated feature-length movies (Toy Story) are successful  New hardware capabilities  Texture mapping  Blending  Accumulation, stencil buffers
  • 20.
    20 Computer Graphics: 2000-2010 Photorealism  Graphics cards (GPU) for PCs dominate market  Nvidia, ATI  Game boxes and game players determine direction of market (Wii, Kinect, etc)  Computer graphics routine in movie industry: Maya, Lightwave  Programmable pipelines
  • 21.
    21 Computer Graphics: 2010- Mobile Computing  iPhone  Cloud Computing  Amazon Web Services (AWS)  Virtual Reality  Oculus Rift  Artificial Intelligence  Big Data/Deep Learning  Google Car
  • 22.
     Computer graphicsgenerally means creation, storage and manipulation of models and images  Such models come from diverse and expanding set of fields including physical, biological, mathematical, artistic, and conceptual/abstract structures 22/39 What is Computer Graphics? (1/2) © 9/6/2018 Frame from animation by William Latham, shown at SIGGRAPH 1992. Latham creates his artwork using rules that govern patterns of natural forms. Our newest visual computing faculty member, Daniel Ritchie’s Ph.d. thesis: Probabilistic Programming for Procedural Modeling and Desi gn
  • 23.
     William Fettercoined term “computer graphics” in 1960 to describe new design methods he was pursuing at Boeing for cockpit ergonomics  Created a series of widely reproduced images on “pen plotter” exploring cockpit design, using 3D model of human body. What is Computer Graphics? (2/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 23/39 © 9/6/2018
  • 24.
     User controlscontent, structure, and appearance of objects and their displayed images via rapid visual feedback  Basic components of an interactive graphics system  input (e.g., mouse, stylus, multi-touch, in-air fingers…)  processing (and storage of the underlying representation/model)  display/output (e.g., screen, paper-based printer, video recorder…)  First truly interactive graphics system, Sketchpad, pioneered by Ivan Sutherland 1963 Ph.D. thesis Sketchpad, A Man-Machine Graphical Communication System  Used TX-2 transistorized “mainframe” at MIT Lincoln Lab 24/39 What is Interactive* Computer Graphics? (1/2) © 9/6/2018 Note CRT monitor, light pen, and function-key panels – the “organ console” showing bi- manual operation * Sometimes called real-time computer graphics, and in certain contexts, real-time rendering
  • 25.
     Almost allkey elements of interactive graphics system are expressed in first paragraph of Sutherland’s 1963 Ph.D. thesis 25/39 What is Interactive Computer Graphics? (2/2) © 9/6/2018 The Sketchpad system uses drawing as a novel communication medium for a computer. The system contains input, output, and computation programs which enable it to interpret information drawn directly on a computer display. Sketchpad has shown the most usefulness as an aid to the understanding of processes, such as the motion of linkages, which can be described with pictures. Sketchpad also makes it easy to draw highly repetitive or highly accurate drawings and to change drawings previously drawn with it…
  • 26.
     Today, westill use non-interactive batch mode (aka offline rendering) for final production-quality video and film (special effects – FX). Rendering a single frame of The Good Dinosaur (2015, a 24 fps movie) averaged 48 hours on a 30,000-core render farm! 26/39 What is Batch Computer Graphics? © 9/6/2018 Pixar’s Render Farm Still from The Good Dinosaur Statistics from https://www.fxguide.com/featured/making-the-world-of-pixars-the-go od-dinosaur/
  • 27.
     Hardware revolution Moore’s Law: every 12-18 months, computer power improves by factor of 2 in price / performance as size shrinks  Newest CPUs are 64-bit with 4, 8, 16, even up to 22 cores  Intel Coffee Lake – consumer processor with 8 cores, 16 threads, and a fully featured graphics chip built in to the processor  Significant advances in commodity graphics chips every 6 months vs. several years for general purpose CPUs  NVIDIA GeForce RTX 2080 Ti… 4352 cores, 11GB memory, and 14+ teraflops of processing power in a single chip 27/39 Enabling Modern Computer Graphics (1/5) ©9/6/2018 NVIDIA statistics from https://www.nvidia.com/en-us/geforce/graphics-cards/rtx-2080-ti/
  • 28.
     Graphic subsystems Offloads graphics processing from CPU to chip designed for doing graphics operations quickly  NVIDIA GeForce™, AMD Vega™, and Intel HD and Iris Pro Graphics  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: NVIDIA GeForce GTX 1080 Ti (2017)  3584 cores, 1.58 GHz clock, 11GB memory, 139 billion pixels/second fill rate  Department machines (row 6): NVIDIA GeForce GTX 970 (2014) – still VR capable  1664 cores, 1.05 GHz clock, 4GB memory, 75 billion pixels/second fill rate  Department machines: NVIDIA GeForce GTX 460 (2010) – fine for 123 assgns.  336 cores, 1.35 GHz clock, 1GB memory, 37.8 billion pixels/second fill rate 28/39 Enabling Modern Computer Graphics (2/5) © 9/6/2018
  • 29.
     Input Devices Mouse, tablet & stylus, multi-touch, force feedback, and other game controllers (e.g., JoyCon for Nintendo Switch), scanner, digital camera (images, computer vision), etc.  Body as interaction device  http://youtu.be/zXghYjh6Gro  Kinect is not as relevant anymore commercially b/c VR is more immersive 29/39 Enabling Modern Computer Graphics (3/5) © 9/6/2018 Xbox Kinect: Leap Motion:
  • 30.
     Many formfactors  Smartphones/laptops/desktops/tablets  Smart watches  Head-mounted displays (HMDs)  HTC Vive  Augmented Reality  Virtual Reality  AR vs VR: Different experiences! 30/39 Enabling Modern Computer Graphics (4/5) © 9/6/2018 Brown’s old Cave Microsoft’s first Surface Apple iPhone Android Phones Google Cardboard Tablets Microsoft Hololens Android Wear Apple Watch Vive Oculus Rift
  • 31.
     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: calculating value of one pixel is often independent of other pixels  Distributed and Cloud computing  Send operations to the cloud, get back results, don’t care how  Rendering even available as internet service! 31/39 Enabling Modern Computer Graphics (5/5) © 9/6/2018
  • 32.
    Vector (calligraphic, stroke,random-scan) Raster (TV, bitmap, pixmap) used in displays and laser printers  Driven by display commands  (move (x, y), char(“A”) , line(x, y)…)  Survives as “scalable vector graphics”  Driven by array of pixels (no semantics, lowest form of representation)  Note “jaggies” (aliasing errors) due to discrete sampling of continuous primitives Graphics Display Hardware Ideal Drawing Vector Drawing Outline Filled 32/39 © 9/6/2018
  • 33.
     Graphics library/packageis intermediary between application and display hardware (Graphics System)  Application program maps application objects to views (images) of those objects by calling on graphics library. Application model may contain lots of non-graphical data (e.g., non-geometric object properties)  User interaction results in modification of image and/or model  This hardware and software framework is 5 decades old but is still useful 33/39 Conceptual Framework for Interactive Graphics © 9/6/2018 Graphics System/ GPU Application Model / database Software Hardware Application program Graphics Library
  • 34.
     Examples: OpenGL™,DirectX™, Windows Presentation Foundation™ (WPF) accessed via XAML, 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 34/39 Graphics Library © 9/6/2018
  • 35.
    Sample-based graphics vsGeometry-based graphics 35/39 Application Distinctions: Two Basic Paradigms © 9/6/2018
  • 36.
     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™ (which came out of CS123/CS224!) 36/39 Sample-based Graphics (1/3) © 9/6/2018
  • 37.
     Pixels arepoint locations with associated sample values, usually of light intensities/colors, transparency, and other control information  When we sample an image, we sample the point location along the continuous signal and we cannot treat the pixels as little circles or squares, though they may be displayed as such 37/39 Sample-based Graphics (2/3) © 9/6/2018 Visualization of a mathematical pixel grid LCD display CRT* beam illumination pattern Can’t visually resolve adjacent pixels on CRT 1 pixel light intensity * Cathode Ray Tube, like those really old TVs
  • 38.
     Samples createddirectly in Paint-type program, or by sampling of continuous (analog) visual materials (light intensity/color measured at regular intervals) with many devices including:  flatbed and drum scanners (e.g., https://luminous-landscape.com/drum-scans/ )  digital still and motion (video) cameras  Sample values can also be input numerically (e.g., with numbers from computed dataset)  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, Computational Photography 38/39 Sample-based Graphics (3/3) © 9/6/2018
  • 39.
     Lets dosome sampling of CIT building  A color value is measured at every grid point and used to color corresponding grid square  Crude sampling and image reconstruction method creates blocky image 39/39 Sampling an Image © 9/6/2018 3D scene 0 = white, 5 = gray, 10 = black
  • 40.
     Once imageis 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 40/39 What’s the Advantage? © 9/6/2018
  • 41.
     WYSIAYG (WhatYou 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.  For a computational and cognitive science perspective, take James Tompkin’s Computer Vision (CSCI1430) 41/39 What’s the Disadvantage? © 9/6/2018 “Scene Reconstruction from High Spatio-Angular Resolution Light Fields” by Kim, Zimmer et al., 2013
  • 42.
     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™ and Corel CorelDRAW™  examples of 3D apps: Autodesk’s AutoCAD™, Autodesk’s (formerly Alias| Wavefront’s) Maya™, Autodesk’s 3D Studio Max™ 42/39 Geometry-Based Graphics (1/2) © 9/6/2018
  • 43.
     Geometry-based graphicsapplications  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  CG animated characters (geometry) on painted or filmed scene images (samples) 43/39 Geometry-Based Graphics (2/2) © 9/6/2018
  • 44.
     What isa model?  Captures salient features (data, behavior) of object/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, we have abstract, easily changeable 3D forms, for the first time in human history  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!) 44/39 What is Geometric Modeling? © 9/6/2018
  • 45.
     Modeling  Createmodels  Apply materials to models  Place models around scene  Place lights in scene  Place the camera 45/39 Modeling vs. Rendering © 9/6/2018 Directional Light Ambient Light Point Light Spot Light CS128 lighting assignment by Patrick Doran, Spring 2009  Rendering Take “picture” with camera  Both can be done with commercial software: Autodesk MayaTM ,3D Studio MaxTM , BlenderTM , e
  • 46.
     Divide andConquer  Hierarchy of geometrical components  Reduction to primitives (e.g., spheres, cubes, etc.)  Simple vs. not-so-simple elements (nail vs. screw) 46/39 Decomposition of a Geometric Model © 9/6/2018 Head Shaft Point composition decomposition
  • 47.
     Object tobe modeled is (visually) analyzed, and then decomposed into collections of primitive shapes.  Tree diagram provides visual method of expressing “composed of” relationships of model  Such diagrams are part of 3D program interfaces (e.g., 3D Studio MAX, Maya)  As a data structure to be rendered, it is called a scenegraph 47/39 Hierarchical (Tree) Diagram of Nail © 9/6/2018 Nail Head (cylinder) Body root node leaf nodes Shaft (cylinder) Point (cone) tree diagram
  • 48.
     Primitives createdin decomposition process must be assembled to create final object. Done with affine transformations, T, R, S (as in above example). Order matters – these are not commutative! 48/39 Composition of a Geometric Model © 9/6/2018 Primitives in their own modeling coordinate system Composition in world (root) coordinate system Translate Scale and Translate Rotate and Translate
  • 49.
     Computer graphicsinvolves both real-time / interactive applications and batch / offline applications  Both equally important, but different use cases  Photo-realism has really advanced  But it still takes dozens of hours on fastest computers to mimic physics of photons interacting with physical environments  Hardware evolution from vector to raster graphics  Vector graphics survives as Scalable Vector Graphics, which transforms without artifacts  Geometry-based vs. image-based graphics  Mathematical definition vs. pixel manipulation  Pixels are discrete samples of continuous functions  Causes artifacts (“jaggies”/ “aliases”) to appear (we will study fixes – “anti-aliasing” thru filtering)  Geometric models typically constructed hierarchically  Scene graph data structure 49/39 In Summary © 9/6/2018