Top Banner
Prof.Dr. Aydın Öztürk [email protected] http://www.ube.ege.edu.tr/~ozturk
74
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Prof.Dr. Aydın Öztü[email protected]://www.ube.ege.edu.tr/~ozturk

Page 2: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Objectives:

The course gives the fundementals of computer graphics. A subset of topics dealing with two-dimensional drawing methods and graphics primitives will be discussed

Page 3: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Grading

• Midterm 25• Assignments 25• Project 50• Final -• Attendance 10

Page 4: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Course Outline

• Mathematics for Computer Graphics• Overview of Graphics Systems• Graphics Output Primitives• Attributes of Graphics Primitives• Geometric Transformations• Two-dimensional Viewing• Midterm• Interactive Input Methods and Graphical User

Interfaces• Color Models and Color Applicatios• Computer Animation• Final

Page 5: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Rules

Attendance is required at all times. Students are expected to come to class fully prepared to discuss textbook readings and course assignments. Some percentage of your final grade will be based on your attendance and class participation.

Page 6: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Computer Graphics with OpenGL▪ Third Edition▪ Hearn and Baker

Page 7: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Computer Graphics Using OpenGL, 3rd edition/2005, F.S.Hill, Jr. Prentice Hall

OpenGL Programming Guide, Version 2, 5th edition, D. Shreiner,M.Woo, J.Neider, T.Davis, Addison-Wesley, 2005, ISBN: 0321335732

Page 8: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Computer graphics: generating 2D images of a 3D world represented in a computer.Main tasks:

modeling: creating and representing the geometry of objects in the 3D world

rendering: generating 2D images of the objects animation: describing how objects change in

time

Page 9: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Graphics is cool I like to see what I’m doing I like to show people what I’m doing

Graphics is interesting Involves simulation, algorithms,

architecture…I’ll never get an Oscar for my acting

But maybe I’ll get one for my CG special effects

Graphics is fun

Page 10: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Entertainment: Cinema

Pixar: Monster’s Inc. Square: Final Fantasy

Page 11: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Final Fantasy (Square, USA)

Entertainment: CinemaEntertainment: CinemaEntertainment: CinemaEntertainment: Cinema

Page 12: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Entertainment: Games

GT Racer 3

Polyphony Digital: Gran Turismo 3, A Spec

Page 13: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Video Games

Page 14: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Medical Visualization

MIT: Image-Guided Surgery Project

Th

e V

isib

le H

um

an

Pro

jec

t

Page 15: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Computer Aided Design (CAD)

Page 16: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Scientific Visualization

Page 17: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Everyday Use Microsoft’s Whistler OS will use graphics

seriously Graphics visualizations and debuggers Visualize complex software systems

Page 18: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 19: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Window system and large-screen interaction metaphors (François Guimbretière)

Page 20: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Outside In (Geometry Center, University of Minnesota)

Page 21: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Reflection models

Reference Image Copula-Frank

Blue-Metallic Paint

Page 22: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 23: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Moore’s LawPower of a CPU doubles every 18 months / 2

years

Page 24: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Number of transistors on GPU doubles each 6 months. Three times Moore’s Law

▪ Good article on Jen-Hsun Huang, Nvidia CEO: http://www.wired.com/wired/archive/10.07/Nvidia_pr.html

$7 Billion Man $5.6 Billion Man

Worldwiderevenues

Retro flashback???Lee Majors

Col. Steve Austin

Page 25: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

But… Video game sales is roughly same as

Hollywood box office Americans bought $3.2 billion in VCRs

and DVDs in 2002 Total revenues to movie studios is 5

times total video game revenues

Page 26: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Cathode Ray Tubes (CRTs) Most common display device today Evacuated glass bottle Extremely high voltage

Page 27: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Heating element (filament)

Electrons pulled towards anode focusing cylinder

Vertical and horizontal deflection plates

Beam strikes phosphor coating on front of tube

Page 28: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Contains a filament that, when heated, emits a stream of electronsElectrons are focused with an electromagnet into a sharp beam and directed to a specific point of the face of the picture tubeThe front surface of the picture tube is coated with small phospher dotsWhen the beam hits a phospher dot it glows with a brightness proportional to the strength of the beam and how long it is hit

Page 29: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

What’s the largest (diagonal) CRT you’ve seen? Why is that the largest?

▪ Evacuated tube == massive glass▪ Symmetrical electron paths (corners vs. center)

How might one measure CRT capabilities? Size of tube Brightness of phosphers vs. darkness of tube Speed of electron gun Width of electron beam Pixels?

Page 30: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Vector Displays

Page 31: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Vector Displays Early computer displays: basically an

oscilloscope Control X,Y with vertical/horizontal plate

voltage Often used intensity as Z

Name two disadvantages Just does wireframe Complex scenes couse visible flicker

Page 32: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Raster Displays Raster: A rectangular array of points

or dots Pixel: One dot or picture element of

the raster Scan line: A row of pixels

Page 33: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Raster Displays Black and white television: an oscilloscope with

a fixed scan pattern: left to right, top to bottom▪ As beam sweeps across entire face of CRT,

beam intensity changes to reflect brightness Analog signal vs. digital display

Page 34: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Can a computer display work like a black and white TV?

Must synchronize▪ Your program makes decisions about the intensity

signal at the pace of the CPU…▪ The screen is “painted” at the pace of the

electron gun scanning the raster Solution: special memory to buffer image with scan-

out synchronous to the raster. We call this the framebuffer.

Digital description to analog signal to digital display

Page 35: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Phosphers Flourescence: Light emitted while the

phospher is being struck by electrons Phospherescence: Light emitted once

the electron beam is removed Persistence: The time from the

removal of the excitation to the moment when phospherescence has decayed to 10% of the initial light output

Page 36: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Refresh Frame must be “refreshed” to draw new images As new pixels are struck by electron beam,

others are decaying Electron beam must hit all pixels frequently to

eliminate flicker Critical fusion frequency

▪ Typically 60 times/sec▪ Varies with intensity, individuals, phospher

persistence, lighting...

Page 37: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Raster Displays Interlaced Scanning Assume can only scan 30 times /

second To reduce flicker, divide frame into

two “fields” of odd and even lines1/30 Sec 1/30 Sec

1/60 Sec 1/60 Sec 1/60 Sec 1/60 SecField 1 Field 1Field 2 Field 2

Frame Frame

Page 38: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

CRT timing Scanning (left to right, top to bottom)

▪ Vertical Sync Pulse: Signals the start of the next field

▪ Vertical Retrace: Time needed to get from the bottom of the current field to the top of the next field

▪ Horizontal Sync Pulse: Signals the start of the new scan line

▪ Horizontal Retrace: The time needed to get from the end of the current scan line to the start of the next scan line

Page 39: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Wood chips Chrome spheres Trash

Daniel Rozin – NYU: (movies) http://fargo.itp.tsoa.nyu.edu/~danny/art.html

Page 40: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Color CRTs are much more complicated Requires manufacturing very precise geometry Uses a pattern of color phosphors on the screen:

Why red, green, and blue phosphors?Delta electron gun arrangement In-line electron gun arrangement

Page 41: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 42: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 43: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Color CRTs have Three electron guns A metal shadow mask to differentiate the beams

Page 44: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Raster CRT pros: Allows solids, not just wireframes Leverages low-cost CRT technology (i.e., TVs) Bright! Display emits light

Cons: Requires screen-size memory array Discreet sampling (pixels) Practical limit on size (call it 40 inches) Bulky Finicky (convergence, warp, etc)

Page 45: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

CRT technology hasn’t changed much in 50 years

Early television technology▪ high resolution ▪ requires synchronization between video

signal and electron beam vertical sync pulse Early computer displays

▪ avoided synchronization using ‘vector’ algorithm

▪ flicker and refresh were problematic

Page 46: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Raster Displays (early 70s)▪ like television, scan all pixels in regular pattern▪ use frame buffer (video RAM) to eliminate sync

problems RAM

▪ ¼ MB (256 KB) cost $2 million in 1971▪ Do some math…

- 1280 x 1024 screen resolution = 1,310,720 pixels

- Monochrome color (binary) requires 160 KB- High resolution color requires 5.2 MB

Page 47: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Liquid Crystal Displays (LCDs) LCDs: organic molecules, naturally in crystalline

state, that liquefy when excited by heat or E field

Crystalline state twists polarized light 90º

Page 48: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Transmissive & reflective LCDs: LCDs act as light valves, not light emitters, and

thus rely on an external light source. Laptop screen

▪ backlit▪ transmissive display

Palm Pilot/Game Boy▪ reflective display

Page 49: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Plasma display panels Similar in principle to

fluorescent light tubes Small gas-filled capsules

are excited by electric field,emits UV light

UV excites phosphor Phosphor relaxes, emits

some other color

Page 50: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Plasma Display Panel Pros Large viewing angle Good for large-format displays Fairly bright

Cons Expensive Large pixels (~1 mm versus ~0.2 mm) Phosphors gradually deplete Less bright than CRTs, using more

power

Page 51: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Digital Micromirror Devices (projectors) or Digital Light Processing

Microelectromechanical (MEM) devices, fabricated with VLSI techniques

Page 52: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

DMDs are truly digital pixelsVary grey levels by modulating pulse lengthColor: multiple chips, or color-wheelGreat resolutionVery brightFlicker problems

Page 53: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Organic Light-Emitting Diode (OLED) Arrays The display of the future? Many think so. OLEDs function like regular semiconductor LEDs But they emit light

▪ Thin-film deposition of organic, light-emitting molecules through vapor sublimation in a vacuum.

▪ Dope emissive layers with fluorescent molecules to create color.

http://www.kodak.com/global/en/professional/products/specialProducts/OEL/creating.jhtml

Page 54: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

OLED pros: Transparent Flexible Light-emitting, and quite bright (daylight

visible) Large viewing angle Fast (< 1 microsecond off-on-off) Can be made large or small Available for cell phones and car stereos

Page 55: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

OLED cons: Not very robust, display lifetime a key issue Currently only passive matrix displays

▪ Passive matrix: Pixels are illuminated in scanline order, but the lack of phospherescence causes flicker

▪ Active matrix: A polysilicate layer provides thin film transistors at each pixel, allowing direct pixel access and constant illum.

Page 56: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Display Walls (Princeton)

Page 57: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Stereo

Page 58: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Graphics Hardware Frame buffer is

anywherein system memory

System Bus

CPU Video Controller

System Memory

Monitor

Frame bufferCartesian

Coordinates

Page 59: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Graphics Hardware Permanent place for

frame buffer Direct connection to

video controller

System Bus

CPU Video Controller

System Memory Monitor

Frame bufferCartesian

Coordinates

FrameBuffer

Page 60: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

The need for synchronization

System Bus

CPU Video Controller

System Memory Monitor

FrameBuffer

synchronized

Page 61: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

The need for synchronization Double buffering

System Bus

CPU Video Controller

System Memory Monitor

DoubleBuffer

synchronized

previouscurrent

Page 62: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

DisplayProcessorDisplay

ProcessorSystemMemorySystemMemory

CPUCPU

FrameBufferFrameBuffer

MonitorVideoController

VideoController

System Bus

I/O Devices

Figure 2.29 from Hearn and Baker

Page 63: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

DAC

Store the actual intensities of R, G, and B individually in the framebuffer

24 bits per pixel = 8 bits red, 8 bits green, 8 bits blue 16 bits per pixel = ? bits red, ? bits green, ?

bits blue

Page 64: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Store indices (usually 8 bits) in framebufferDisplay controller looks up the R,G,B values before

triggering the electron guns

Frame Buffer

DACPixel color = 14

Color LookupTable

0

1024

14R G B

Page 65: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 66: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 67: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 68: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 69: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 70: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 71: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 72: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.
Page 73: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Figure. Renderings of spheres based on the measured “blue-metallic-paint” [2] BRDF with the eight models. From left to right; Top row: Measured, Ashikhmin-Shirley, Blinn-Phong, Cook-Torrance, Lafortune, Polynomial model (Ashikhmin-Shirley, p=3). Bottom row: Oren-Nayar, Ward, Ward-Duer, Polynomial model (Lafortune, p=5), Polynomial model (Ward, p=5).

Page 74: Prof.Dr. Aydın Öztürk aydin.ozturk@ege.edu.tr ozturk.

Figure. Renderings of a car using copula-based model with different enviroment maps.