1 Computer Graphics (CST307) - Lect 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 56

Computer Graphics (CST307)

Lect 1: Introduction
Dr. Satyendra Singh Chouhan
MNIT Jaipur
Overview of Today’s Lecture
 Why Computer Graphics?

 What is Computer Graphics?

 Syllabus?

 Evaluation Mechanism?

Class code: tadzd2p


What we do with Computer?
 Lot of things
 Example1: Document Processing
 Very Common - Creation/presentation of documents
Example Document Processing
 Primary
Components are
the alphanumeric
characters
 Entered through
keyboard
 There are some
other equally
important
components
 Menu option, editing
tools
Example:
 There is a mix of characters and images that constitutes
the interface of a typical document processing system

 Another example
Ø CAD Interface
Visualization
 DNA Visualization
 Scientific Visualization

 Information Visualization
 n-dimensional data
Computer Graphics
 Spectrum of such application is very wide
 Difficult to list all applications as everything we see
around us involving computers contains some application
of computer Graphics.
 Here, from CG point of view, computer refers to:
 Mobile phones
 Information kiosk at popular spots such as airports
 ATMs
 Large display at open air concerts
 Air traffic control panel
 Anything with having display mechanism
Computer Graphics
 What is the common in all these applications
 Instance of images displayed on the screen
 Note: text are also images (will see later)
 Images are constructed with objects,
 Basically geometric shapes (Characters or icons)
 When we create/edit/view a document, we are
dealing with letter, numbers, punctuations, and
symbols.
 Each is an object, rendered on the screen with difference
size and style
Computer Graphics
 How a computer do all these things?
 In other word, how we can create or represents,
synthesize, and render imagery on a computer display.
 This the fundamental question that is studied in
Computer Graphics.
Computer Graphics
 It is process of rendering static images or animation
(sequence of images) on computer screen in a efficient
way.
 In this course we will learn about the process
 Stages of CG pipeline
 Pipeline implementation (hardware and software)
Syllabus and Evaluation mechanism
Ø Syllabus is tentative: I will include some advance parts
Ø Such as GPUs

 Mid Term 30 %
 End Term 40%
 Internal 30% (Two Quizes)
See this

https://www.youtube.com/watch?v=D4NPQ8mfKU0
Prerequisites for Computer Graphics
 Linear Algebra
 Knowledge of data structures and algorithm
 C/C++ Programming
Overview of Lecture 2
 We will discuss basic graphics system (It will help in
upcoming lectures)
 We will briefly discuss the historical evolution
CG-Core idea
 What we do in CG-
 generate 2D images and display on the screen.
 How we do that?

15
Generic CG System Architecture
Display Controller
 Image generation task is performed by Display Controller
 Takes input from CPU (Host computer)
 As well as external input devices (mouse keyboard etc.)
 Image generation is multistage process, involving a lot of
computation
 Why we need Display Controller (Display Processor)?
 Why not CPU?
 To avoid such situation and increase efficiency , rendering
is usually carried out by a dedicated component of the
system (Graphic card)
 Has it own processing unit called GPU
CG –core idea
 CPU assign any graphic rendering task to this separate
graphic unit
 We are calling it display controller (generic name)
Video Memory
 Stores the representation of image received from Display
controller
 Display controller generates image in digital format ( 0 or
1)
 It is dedicated part of memory hierarchy
 Typically part of separate graphic unit (The VRAM in the
graphic card)
Video Controller
 Video Controller converts digital image to analog voltages
 It takes the storage image as input
 The analog voltage drive electro-mechanical arrangements,
which ultimately render image on the screen.
 Display screen contains picture elements or pixels
 Arranged in form of grid
Video Controller
 When these pixels are excited by electrical means, they
emit lights with specific intensities, which give us the
sensation of coloured images on the screen.
 The mechanism of exciting the pixel is done by Video
controller
 Input is digital image stored in the VRAM and activates suitable
electro-mechanical mechanism for pixel to emit light.
Type of graphic devices
 Broadly there are two types (Based on the method to
excite pixels)
 Vector Scan
 Raster Scan
 Vector Scan Device (aka random –scan, stroke writing, or
calligraphic devices)
 Image viewed as composition of continuous geometric
primitives (lines as curves)
 Image is rendered by rendering these primitives
Example: Vector Scan
Vector Scan: Pros and Cons
 In vector scan devices, need to excite only a subset of the
pixel grid
 It requires high precision and complex hardware
 Consequently vector devices are costly.
 Due to selective exciting, it is good for rendering
wireframe images
 For complex images, flicker is visible as rendering involves
lots of random movements
Raster Scan Devices
 Image viewed as representation by whole pixel grid (Not
only selected primitives)
 To render a raster image, all the pixels are considered
 For this, it consider the pixel in sequence

 Video controller starts with the top left pixel and check if the
pixel needs to excited or not
Raster Scan process
 It is a sequential consideration of pixel grid – scanning
 Each row is called scan line
Frame buffer
 The video memory of Raster scan system is generally
known as frame buffer.
 Contains one location corresponding to each pixel
 Size?
 Display processor works at the speed of the CPU
 Video controller is typically a electro mechanical
arrangement (Slower compare to CPU)
 Problem?
Frame buffer
 If display controller output fed directly to video controller,
resulting image can get distorted
 Why?
 To synchronization, frame buffer is used
 However, single buffer is not sufficient
 Double buffering
 Primary and secondary buffers
 So how they work?
 Video controller takes the input from primary buffer while
display controller fills up the other (Secondary)
 Then role reversal and the process repeats
Screen refreshing
 Lights emitted from pixel elements, after excitation, starts
decaying over time
 Lead to fading of the scene after sometime
 However, pixel in a scene may get excited at different
time
 Problem?
 May lead to image distortion
 To avoid we have to keep on exciting the pixel
periodically- Refreshing
 Refresh rate- (in Hz)
 Typically 60 Hz
Raster Scan device pros and cons

 Scanning based rendering requires simple hardware to


implement
 Good for complex images also as no flicker problem
 Due to low cost and ability to generate complex images
we mostly see raster scan device
Vector and Raster Graphics

 Not related to vector scan and raster scan system


 It is actually representation of images
 Vector graphics- refer to images represented in terms of
continuous geometric primitives as line as curve
 Raster Graphics: refers to images represented in terms of
a pixel grid
Note
 Indicate only image presentation, - not underlying
hardware rendering process
 We can always use a raster scan method to render a
vector graphics and vice versa
Color display basics
Black and white Image Generation
Ø Each pixel contain one type of element (e.g., a single
phosphor on CRT)
Ø We can excite it to generate different light intensities-
different shades of grey
Color image generation
 Each pixel contains more than one type of element
 E.g., 3 phosphor dots representing3 primary color ( R G
B)
 When excited, 3 colors combine to produce the desire
output
Color Image generation
 Each element capable of
generating different shades
of the color
 3 shades combined
together gives the
sensation of the desired
color
How to implement
 Direct Coding – individual color information for each R G
and B components of a pixel stored directly in the
corresponding frame buffer location
 Large frame buffer size to store all possible color values
 All possible combinations of RGB values
 Also called color gamut
Another way
Color Look Up Table
 Separate look up table
(Portion of memory)
 With each entry (row) of
table contains a specific
RGB combination
 Frame buffer location
contains pointer to entry in
the table
Color Image generation
CLT assumption
 Only require a small fraction of the whole color gamut.
 We know it a-priori
 If this assumption is not valid then this method is not
much of use
Poll Question 1
What do we do in CG?
 a. We generate 2D image and display on a screen.
 b. We generate 3D image and display on a screen.
 c. Both a, and b.
 d. None of these.
Poll Question 2
What does the video memory do?
 a. It stores the image in the form of string of 0 and 1,
which is generated by display controller.
 b. It stores the image in the form of string of 0 and 1,
which is generated by video controller.
 c. It stores the videos, which is generated by display
controller.
 d. All of the above.
Poll Question 3
Computer graphics are used in mobile phones, information
kiosks at popular spots such as airports, ATMS, large
displays at open air music concerts, air traffic control panels,
and so on.
 a. True
 b. False
Poll Question 4
Which among the following is correct?
 a. We can use a raster scan method to render a vector
graphics but cannot use a vector scan method to render a
raster graphics.
 b. We can use a vector scan method to render a raster
graphics but cannot use a raster scan method to render a
vector graphics.
 c. We can use a raster scan method to render a vector
graphics and vice versa.
 d. We can use only raster scan method to render a raster
graphics and only vector screen method to render vector
graphics.
Historical Evolution of Computer
Graphics
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

44
Computer Graphics: 1960-1970
 Wireframe graphics
 Draw only lines
 Sketchpad
 Display Processors
 Storage tube

wireframe representation
of sun object

45
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
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
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

48
Raster Graphics
 Image produced as an array (the raster) of picture
elements (pixels) in the frame buffer
Raster Graphics
 Allows us to go from lines and wire frame images to filled
polygons
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
Computer Graphics: 1980-1990
Realism comes to computer graphics

smooth shading environment bump mapping


mapping
52
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)

53
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

54
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

55
Computer Graphics: 2010-
 Mobile Computing
 iPhone
 Cloud Computing
 Amazon Web Services (AWS)
 Virtual Reality
 Oculus Rift
 Artificial Intelligence
 Big Data/Deep Learning
 Google Car

56

You might also like