Graphics Systems and Models

salamiblackElectronics - Devices

Nov 27, 2013 (3 years and 4 months ago)

51 views

Chapter 1:

Graphics Systems and Models

www.themegallery.com

Instructor: Shih
-
Shinh

Huang

1

Outlines


Introduction


Image Formation


Programmer Interface


Graphics Architecture

2

Introduction


What is Computer Graphics?


Concern with all aspects of producing pictures
or images using computer.

3

where did this image come from?

Introduction


Applications


Information Display :
Graphics for Scientific,
Engineering, and Medical Data

4

Medical Image

Nebula

Introduction


Applications


Design :

Graphics for Engineering and
Architectural System


5

AutoCAD 2002

Interior Design

Introduction


Applications


Simulation and Animation
:
Computer
-
Generated Models of Physical, Financial and
Economic Systems for Educational Aids



6

Flight Simulator

Mars Rover Simulator

Introduction


Applications


User Interfaces :
Graphics for Artist




7

Painter

Introduction


Applications


Entertainment:

Graphics for Movie, Game, VR


8

Final Fantasy

Online Game

Introduction


Graphics System

9

Input devices

Output device

Image formed in FB

Introduction


Graphics System


Input Devices


The system is usually equipped with
pointing
devices (location +

buttons).


The common devices are mouse, joystick, and
data tablet.


Data gloves
or
computer vision
system can provide
higher
-
dimensional data.

10

Introduction


Graphics System


Input Devices

11

Introduction


Graphics System


Input Devices


12

Introduction


Graphics System


Processors


In a simple system, there are only one processor
for
normal processing
and
graphical processing.


Today, all graphics system are characterized by
special
-
purpose
graphical processing unit (GPU)


It takes charge of a conversion of geometric
entities to pixel in the frame buffer (
Rasterization
).



13

Introduction


Graphics System


Pixels


An image is produced as an
array

(raster) of
picture elements
(pixel).


14

row

column

Introduction


Graphics System


Frame Buffer


It is a part of memory to store the set of pixels.


It is usually implemented with special type of
memory chips to enable redisplaying.


Resolution:
the number of pixels in frame buffer


Depth
or

Precision
: the number of bits used for
each pixel.

15

Introduction


Graphics System


Output Device


The general display is
cathode
-
ray tube (CRT)


16

Image Formation


Description


Image formation is a process analogous to
how images are formed by physical systems


Human Visual System


Camera


The process combining the specification of
objects

with
viewers

to produce 2D image.


Object is an entity existing in space independent of
any image
-
formation process and any viewer.


Viewers is a way to from images from objects.



17

Image Formation

18

Images seen by three different views

Camera View

Object

Image Formation


Light Description


Light is a form of electromagnetic radiation


Wavelengths


Frequencies


The wavelengths in the range of 350 (nm) to
780 nm is called
visible spectrum


19

Image Formation


Pinhole Camera Model


A pinhole camera is a box with a small hole in
the center of one side.


The film is placed inside the box on the side
opposite the pinhole

20

Image Formation


Pinhole Camera Model


Point Projection

21

(,,)
p p
x y d

/
p
x
x
z d
 
/
p
y
y
z d
 
Image Formation


Pinhole Camera Model


Field or View of Angle


The angle made by the largest object that our
image can image on its film plane.

22

/2
tan
2
h
d


1
/2
tan
2
h
d


 
1
2tan
2
h
d


 

Image Formation


Pinhole Camera Model


Depth of Field


The longest distance that the objects can appear
on its film plane.


The ideal pinhole camera model has an infinite
depth of field.


Limitations


The pinhole is so small that it admits only a single
ray from a point source


The camera cannot be adjusted to have different
angle of view.


23

Image Formation


Human Visual System

24

視網膜上兩種視覺接受器:


錐細胞錐細胞
(cone): 6~7 million


桿細胞桿細胞
(rod):75~150 million

Image Formation


Human Visual System


25

人類的視覺神經路徑人類的視覺神經路徑

網膜

視交叉

側膝核

視皮質網膜

視交叉

側膝核

視皮質

Image Formation


Synthetic
-
Camera Model


The image plane is moved in front of camera.


The limitation of field can be expressed by
placing a
clipping window
.

26

Clipping Window

Projection Plane

Center of Projection (COP)

Programmer Interface


Description


There are numerous ways that a user can
interact with a graphics system.


A user develops images through interactions with
display using input devices.


Someone develops the code for the application

27

Programmer Interface


API Functions


It is to provide interfaces between an
application program
and
a graphics system
.


API in OpenGL


It is to specify how to form an image: (1) Objects,
(2) Viewer, (3) Light Source(s), (4) Materials


The APIs provided by OpenGL is based on
the
synthetic
-
camera model
.


28

Programmer Interface


Objects


Objects are usually defined by sets of vertices


Most APIs provide sets of
primitive objects
(primitives)
for the user.


Points (0D object)


Line segments (1D objects)


Polygons (2D objects)


Some curves and surfaces


OpenGL programs define primitives through
lists of vertices.


29

Programmer Interface


Example

30

glBegin
(GL_POLYGON)


glVertex3f(0.0, 0.0, 0.0);


glVertex3f(0.0, 1.0, 0.0);


glVertex3f(0.0, 0.0, 1.0);

glEnd
( );

type of object

location of vertex

end of object definition

Programmer Interface


Example


glBegin
()
and
glEnd
()
brackets the calls
to define the object to be drawn.


OpenGL Commands


Prefix:
gl


Initial capital letters for each word


Optional Character: number of arguments or type


OpenGL Constants


Prefix:
GL


All characters are
capitilized


Underscores among Words.

31

glVertex3f(0.0, 0.0, 0.0);

glBegin
(GL_POLYGON)

Programmer Interface


Viewer


Available APIs differ in how much flexibility in
camera selection.


Camera Specifications


Position


Orientation


Focal Length


Film Plane.

32

Programmer Interface


Light


Point sources
v.s

distributed sources


Spot lights


Near and far sources


Color properties


Material Properties


Absorption: color properties


Scattering



33

Graphics Architecture


General Description


Two Sides of API


Application Program


Combination of hardware and software that
implements the functionality of the API.


Various approaches are to develop graphics
architectures for supporting graphics APIs.

34

Graphics Architecture


Early Graphics System


It used general
-
purposed computers
characterized by a CPU.


CPU Task


Run the application program


Compute the endpoints of line segment.

35

Graphics Architecture


Display Processors


The display processors include instructions to
display primitives
.


The display primitives are stored in its own
memory denoted as
display list
.

36

Graphics Architecture


Pipeline Architecture


The creation of special
-
purpose VLSI chips
enables the
pipeline

technology.


The pipeline is workable in graphics because
it processes data in the same manner.


For two stage pipeline, the
throughput
of the
system has been doubled.

37

a+(b*c)

Graphics Architecture


Scene Geometry


Scene geometry is the collection of primitives
and vertices.


A scene consists of a set of
objects
.


Each object comprises a set of
primitives
.


A primitive comprises a set of
vertices.


In a complex scene, there are may be
thousands of vertices.


We must process all these vertices
in a similar
manner

to form an image in the frame buffer.

38

Graphics Architecture


Graphics Pipeline


The imaging processing includes four steps.


Vertex Processing


Clipping and Primitive Assembly


Rasterization


Fragment Processing


These four steps can be performed in a
pipeline manner.

39

Graphics Architecture


Vertex Processing


Coordinate Transformation:
imaging process is a
transformation between different coordinate system.


Vertex Coloring


Program Specification


Computation from a
realistic shading model
.


40

Graphics Architecture


Clipping and Primitive Assembly


Determine the

area in the world that can be
seen by the camera.


Clipping Volume


The projection in this volume appear in the image.


Those that are outside are to be clipped out.


The clipping is done in
primitive level
rather
than
vertex level
.


The output of this stage is a set of primitives
whose projections can appear in the image.

41

Graphics Architecture


Clipping and Primitive Assembly


42

3D Clipping Volume

2D Clipping Volume

Graphics Architecture


Rasterization

(Drawing)


It converts the primitives in terms of vertices
to
pixels
in the frame buffer.


The output is a set of
fragments

for each
primitive, that is, pixel with color or location


Fragment Processing


It takes the generated fragments to update
the pixels in the frame buffer.


The pixels in frame buffer can be read to
blend with the fragment.


43

44