35
Introduction to Computer Graphics CS 445 / 645 Lecture 3 Lecture 3 General Graphics Systems General Graphics Systems Daniel Rozin, Wooden Mirror (1999)

Computer graphic lecturer no 3

Embed Size (px)

Citation preview

Page 1: Computer graphic lecturer no 3

Introduction to Computer GraphicsCS 445 / 645

Lecture 3Lecture 3General Graphics SystemsGeneral Graphics Systems

Daniel Rozin, Wooden Mirror (1999)

Page 2: Computer graphic lecturer no 3

AnnouncementAnnouncement• Assignment 1 (Fire Truck) is outAssignment 1 (Fire Truck) is out

– Due Feb 3Due Feb 3rdrd

Overview – Read Chapter 2 and Appendix A1-A5Overview – Read Chapter 2 and Appendix A1-A5• Display devicesDisplay devices

• Graphics hardwareGraphics hardware

• Input devicesInput devices

• Graphics SoftwareGraphics Software

Page 3: Computer graphic lecturer no 3

Review• CRTsCRTs

– Vector basedVector based

– Raster basedRaster based

– InterlacingInterlacing

Page 4: Computer graphic lecturer no 3

ReviewVector vs. RasterVector vs. Raster• Another place we see this… web-based graphicsAnother place we see this… web-based graphics

– Macromedia flash is vector basedMacromedia flash is vector based

– JPG images are raster basedJPG images are raster basedSo what…

• Time to transmit vs. time to generateTime to transmit vs. time to generate

– Bandwidth vs. CPUBandwidth vs. CPU

• Reuse of image descriptionReuse of image description

Page 5: Computer graphic lecturer no 3

Vector GraphicsHow to generate an image using vectorsHow to generate an image using vectors• A line is represented by endpoints (10,10) to (90,90)A line is represented by endpoints (10,10) to (90,90)

• The points along the line are computed using a line equationThe points along the line are computed using a line equation

– y = mx + by = mx + b• If you want the image larger, no If you want the image larger, no

problem…problem…

Cheap transmission

Computation required

Page 6: Computer graphic lecturer no 3

Raster GraphicsHow to generate a line using rastersHow to generate a line using rasters• A line is represented by assigning some pixels a value of 1A line is represented by assigning some pixels a value of 1

• The entire line is specified by the pixel valuesThe entire line is specified by the pixel values

– What do we do to make image larger?What do we do to make image larger?

No computation

Lot’s of extra info to communicate

Page 7: Computer graphic lecturer no 3

Display Technology: LCDs

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

state, that liquefy when excited by heat or E fieldstate, that liquefy when excited by heat or E field

• Crystalline state twists polarized light 90º. Crystalline state twists polarized light 90º.

Page 8: Computer graphic lecturer no 3

Display Technology: LCDs

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

state, that liquefy when excited by heat or E fieldstate, that liquefy when excited by heat or E field

• Crystalline state twists polarized light 90ºCrystalline state twists polarized light 90º

Page 9: Computer graphic lecturer no 3

Liquid Crystal Display (LCD)

Figure 2.16 from Hearn and Baker

Page 10: Computer graphic lecturer no 3

Display Technology: DMD / DLPDigital Micromirror Devices (projectors) or Digital Micromirror Devices (projectors) or

Digital Light ProcessingDigital Light Processing• Microelectromechanical (MEM) devices, fabricated Microelectromechanical (MEM) devices, fabricated

with VLSI techniqueswith VLSI techniques

Page 11: Computer graphic lecturer no 3

Display Technology: DMD / DLP

• DMDs are truly digital pixelsDMDs are truly digital pixels

• Vary grey levels by modulating pulse lengthVary grey levels by modulating pulse length

• Color: multiple chips, or color-wheelColor: multiple chips, or color-wheel

• Great resolutionGreat resolution

• Very brightVery bright

• Flicker problemsFlicker problems

Page 12: Computer graphic lecturer no 3

Display Technologies: Organic LED Arrays

Organic Light-Emitting Diode (OLED) ArraysOrganic Light-Emitting Diode (OLED) Arrays• The display of the future? Many think so.The display of the future? Many think so.

• OLEDs function like regular semiconductor LEDsOLEDs function like regular semiconductor LEDs

• But they emit lightBut they emit light

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

– Dope emissive layers with fluorescent Dope emissive layers with fluorescent molecules to create color.molecules to create color.

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

Page 13: Computer graphic lecturer no 3

Display Technologies: Organic LED Arrays

OLED pros:OLED pros:• TransparentTransparent• FlexibleFlexible• Light-emitting, and quite bright (daylight visible)Light-emitting, and quite bright (daylight visible)• Large viewing angleLarge viewing angle• Fast (< 1 microsecond off-on-off)Fast (< 1 microsecond off-on-off)• Can be made large or smallCan be made large or small• Available for cell phones and car stereosAvailable for cell phones and car stereos

Page 14: Computer graphic lecturer no 3

Display Technologies: Organic LED Arrays

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

– Passive matrix:Passive matrix: Pixels are illuminated in scanline Pixels are illuminated in scanline order (like a raster display), but the lack of order (like a raster display), but the lack of phospherescence causes flickerphospherescence causes flicker

– Active matrix:Active matrix: A polysilicate layer provides thin film A polysilicate layer provides thin film transistors at each pixel, allowing direct pixel access transistors at each pixel, allowing direct pixel access and constant illuminationand constant illumination

See See http://www.howstuffworks.com/lcd4.htmhttp://www.howstuffworks.com/lcd4.htm for more info for more info

Page 15: Computer graphic lecturer no 3

Additional DisplaysDisplay WallsDisplay Walls

• PrincetonPrinceton

• StanfordStanford

• UVa – Greg HumphreysUVa – Greg Humphreys

Page 16: Computer graphic lecturer no 3

Display Wall Alignment

Page 17: Computer graphic lecturer no 3

Additional DisplaysStereoStereo

Page 18: Computer graphic lecturer no 3

InterfacesWhat is spatial dimensionality of computer What is spatial dimensionality of computer screen?screen?What is dimensionality of mouse input?What is dimensionality of mouse input?

How many degrees of freedom (DOFs) define the How many degrees of freedom (DOFs) define the position of your hand in space?position of your hand in space?• Space ballSpace ball

Page 19: Computer graphic lecturer no 3

Video ControllersGraphics HardwareGraphics Hardware• Frame buffer is anywhereFrame buffer is anywhere

in system memoryin system memory

System Bus

CPU Video Controller

System Memory

Monitor

Frame bufferCartesian

Coordinates

Page 20: Computer graphic lecturer no 3

Video ControllersGraphics HardwareGraphics Hardware• Permanent place forPermanent place for

frame bufferframe buffer

• Direct connection toDirect connection tovideo controllervideo controller

System Bus

CPU Video Controller

System Memory Monitor

Frame bufferCartesian

Coordinates

FrameBuffer

Page 21: Computer graphic lecturer no 3

Video ControllersThe need for The need for synchronizationsynchronization

System Bus

CPU Video Controller

System Memory MonitorFrame

Buffer

synchronized

Page 22: Computer graphic lecturer no 3

Video ControllersThe need for The need for

synchronizationsynchronization• Double bufferingDouble buffering

System Bus

CPU Video Controller

System Memory MonitorDouble

Buffer

synchronized

previouscurrent

Page 23: Computer graphic lecturer no 3

Raster Graphics Systems

DisplayProcessor

SystemMemoryCPU

FrameBuffer

MonitorVideoController

System Bus

I/O Devices

Figure 2.29 from Hearn and Baker

Page 24: Computer graphic lecturer no 3

Frame Buffer

Frame Buffer Figure 1.2 from Foley et al.

Page 25: Computer graphic lecturer no 3

Frame Buffer Refresh

Figure 1.3 from FvDFH Refresh rate is usually 30-75Hz

Page 26: Computer graphic lecturer no 3

DAC

Direct Color FramebufferStore the actual intensities of R, G, and B individually in the Store the actual intensities of R, G, and B individually in the

framebufferframebuffer

24 bits per pixel = 8 bits red, 8 bits green, 8 bits blue24 bits per pixel = 8 bits red, 8 bits green, 8 bits blue

• 16 bits per pixel = ? bits red, ? bits green, ? bits blue

Page 27: Computer graphic lecturer no 3

Color Lookup FramebufferStore indices (usually 8 bits) in framebufferStore indices (usually 8 bits) in framebuffer

Display controller looks up the R,G,B values before triggering Display controller looks up the R,G,B values before triggering the electron gunsthe electron guns

Frame Buffer

DACPixel color = 14

Color LookupTable

0

1024

14R G B

Page 28: Computer graphic lecturer no 3

SoftwareHide the detailsHide the details• User should not need to worry about how graphics are User should not need to worry about how graphics are

displayed on monitordisplayed on monitor

• User doesn’t need to know about how a line is converted into User doesn’t need to know about how a line is converted into pixels and drawn on screen (hardware dependent)pixels and drawn on screen (hardware dependent)

• User doesn’t need to rebuild the basic tools of a 3D sceneUser doesn’t need to rebuild the basic tools of a 3D scene

– Virtual camera, light sources, polygon drawingVirtual camera, light sources, polygon drawing

OpenGL does this for you…OpenGL does this for you…

Page 29: Computer graphic lecturer no 3

SoftwareHide the detailsHide the details• User doesn’t need to know how to read the data coming from User doesn’t need to know how to read the data coming from

the mousethe mouse

• User doesn’t need to know how to read the keystrokesUser doesn’t need to know how to read the keystrokes

OpenGL Utility Toolkit (GLUT) does this for you…OpenGL Utility Toolkit (GLUT) does this for you…

Page 30: Computer graphic lecturer no 3

SoftwareHide the detailsHide the details• User doesn’t have to build a graphical user interface (GUI)User doesn’t have to build a graphical user interface (GUI)

– Pull-down menus, scrollbars, file loadersPull-down menus, scrollbars, file loaders

Fast Light Toolkit (FLTK) does this for you…Fast Light Toolkit (FLTK) does this for you…

Page 31: Computer graphic lecturer no 3

SoftwareHide the detailsHide the details• User shouldn’t have to write code to create a GUIUser shouldn’t have to write code to create a GUI

– Positioning text boxes, buttons, scrollbarsPositioning text boxes, buttons, scrollbars

– Use a graphical tool to arrange visuallyUse a graphical tool to arrange visually

– Assign callback functions to hook into source codeAssign callback functions to hook into source code

Fast Light User Interface Designer (FLUID) does Fast Light User Interface Designer (FLUID) does this for you…this for you…

Page 32: Computer graphic lecturer no 3

OpenGL Design GoalsSGI’s design goals for OpenGL:SGI’s design goals for OpenGL:

• High-performance (hardware-accelerated) graphics APIHigh-performance (hardware-accelerated) graphics API

• Some hardware independence Some hardware independence

• Natural, terse API with some built-in extensibilityNatural, terse API with some built-in extensibility

OpenGL has become a standard (competing with DirectX) because:OpenGL has become a standard (competing with DirectX) because:• It doesn’t try to do too muchIt doesn’t try to do too much

– Only renders the image, doesn’t manage windows, etc.Only renders the image, doesn’t manage windows, etc.– No high-level animation, modeling, sound (!), etc.No high-level animation, modeling, sound (!), etc.

• It does enoughIt does enough

– Useful rendering effects + high performanceUseful rendering effects + high performance• Open source and promoted by SGI (& Microsoft, half-heartedly)Open source and promoted by SGI (& Microsoft, half-heartedly)

Page 33: Computer graphic lecturer no 3

The Big PictureWho gets control of the main control loop?Who gets control of the main control loop?• FLTKFLTK – the code that waits for user input and processes it – the code that waits for user input and processes it

– Must be responsive to user… Must be responsive to user… do as I saydo as I say• GLUTGLUT – the code that controls the window and refresh – the code that controls the window and refresh

– Must be responsive to windowing system and OSMust be responsive to windowing system and OS

• OpenGLOpenGL – the code that controls what is drawn – the code that controls what is drawn

– Must be responsive to the program that specifies where Must be responsive to the program that specifies where objects are located. If something moves, I want to see it.objects are located. If something moves, I want to see it.

Page 34: Computer graphic lecturer no 3

The Big PictureWho gets control of the main control loop?Who gets control of the main control loop?• Answer: FLTKAnswer: FLTK

– We’ll try to hide the details from you for nowWe’ll try to hide the details from you for now

– But be aware of the conflict that existsBut be aware of the conflict that exists

• FLTK must be aware of GLUT and OpenGL state at all timesFLTK must be aware of GLUT and OpenGL state at all times

– Must give code compute cycles when neededMust give code compute cycles when needed

• We’ll discuss OpenGL as if it were standaloneWe’ll discuss OpenGL as if it were standalone

Page 35: Computer graphic lecturer no 3

ReviewRead Chapter 2Read Chapter 2Read Appendix 1 – 5 (for next week)Read Appendix 1 – 5 (for next week)

Implement OpenGLImplement OpenGL• Section 2.9 is good introduction to OpenGLSection 2.9 is good introduction to OpenGL