You are on page 1of 26

ComputerGraphics Hardwareand Software

Lecture Notes, CEng 477

What is Computer Graphics?

Differentthingsindifferentcontexts:

pictures,scenesthataregeneratedbyacomputer. toolsusedtomakesuchpictures,softwareandhardware, input/outputdevices. thewholefieldofstudythatinvolvesthesetoolsandthepictures theyproduce.

Useofcomputertodefine,store,manipulate,interrogate andpresentpictorialoutput.

Howpicturesarerepresentedincomputergraphics? Howpicturesarepreparedforpresentation? Howinteractionwithinthepictureisaccomplished?

Computer Graphics Applications

Art,entertainment,andpublishing

movieproduction,animation,specialeffects computergames WorldWideWeb Book,magazinedesign,photoediting

CGandImageprocessing(syntesisvs.analysis) Simulations(education,training) CADarchitectural,circuitdesignetc. Scientificanalysisandvisualization GraphicalUserInterfaces

Display (Video Display Device)

MostCGonvideomonitors

Stillmostpopular:CathodeRayTube(CRT) Otherpopulardisplaytypes:

LiquidCrystalDisplay Plasmadisplay FieldEmissionDisplays DigitalMeromirrorDevices LightEmittingDiodes 3Ddisplaydevices(hologramorpagescanmethods)

CRT
3. when electron beams contact screen phosphor emits light

1. cathode rays emitted by the electron gun 2. focusing and deflection

4. light fades, redraw required in a small period (refresh)

CRT types

DirectViewStorageTubes(notCRT,noneedforrefresh, picturesstoredasapermanentchargeonphosphor screen) CalligraphicrefreshCRT(linedrawingorvectorrandom scan,needrefreshing) Rasterscan(pointbypointrefreshing) Refreshrate:#ofcompleteimages(frames)drawnonthe screenin1second.Frames/sec. Frametime:reciprocaloftherefreshrate,timebetween eachcompletescan.sec/frame

Vector Scan

Picturedefinitionisstoredasasetoflinedrawing commandsinarefreshbuffer. todisplayapicture,thesystemcyclesthroughthesetof commandsinthebuffer Designedforlinedrawingapplications(CAD)

Raster Scan

Screenisaregulargridofsamplescalledpixels(picture element) Screenisrefreshedlinebyline


non-interlaced interlaced, cycle 1 interlaced, cycle 2 interlaced, 2 cycles

Interlacing:Avoidflickeringaffectforsmallrefreshrates. interlaced50Hz:actually25Hz

resolution:a2Dtermthatmeasuresthenumberofscan linesandthenumberofpixelsoneachline(maximum numberofpointsthatcanbedisplayedwithoutoverlapon aCRT) blackandwhitedisplayonlybinarypixels. intensityofapixelcanbeachievedbytheforceof electronbeam(grayscale) colordisplay?

Color Displays

Beampenetrationmethod:
specialphosphorsemittingdifferentcolorsfordifferentintensityof electron.Slow,limitedcolors.

Shadowmaskmethod:
3electronguns+ashadowmaskgrid.Intensitiesof3colorsresultin anarbitrarycolorpixel.(mostTVsandmonitors)

blackandwhite:1bitperpixel. grayscale:1byteperpixel(256graylevels) truecolor:3bytes=24pitsperpixel(2 24colors) indexedcolorframebuffer:eachpixeluses1byte,an indexentryinacolormaptablematchingthecolortothe actualcolor.

Vector vs Raster Scan

rasterscanmonitors:

inexpensive filledareas,patterns refreshprocessisindependent(constantforanycomplexscene)

vectorscanmonitors:

Smoothlines.noneedforscanconversion:linestopixels.(raster scansolutionantialiasing) sometimesmemoryandCPUefficient1000lines: Vectorscan:2000endpointsand1000operations Rasterscan:wholeframebuffer1000scanconversions.

LCD Displays

Thinnerandlighter.Notubeandelectronbeams. Blocking/unblockinglightthroughpolarizedcrystals. AmatrixofLCcells oneforeachpixel. Norefreshunlessthe screenchanges. Color3cellsperpixel.

Simple Raster Display System

Framebuffer:storedpixelmapofscreen

Videocontrollerjustrefreshestheframebufferonthe monitorperiodically.
CPU Peripheral Devices

System Bus

System Frame Memory Buffer

Video Controller

Monitor

Inexpensive Scanconversionofoutputprimitives(lines,rectanglesetc.) donebytheCPU.Slow. Asrefreshcycleincreases,memorycyclesusedbythe videocontrollerincreases.Memoryislessavailableto CPU. Solution:GraphicsDisplayProcessor

Scanconversion,outputprimitives,rasteroperations (doublebuffering) Separeteframe buffer


CPU Peripheral Devices

Graphics Display Processor

System Bus

Display Processor

System Memory

D. Proc. Frame memory. Buffer

Video Controller

Monitor

Computer Graphics Software

RenderingPrimitives

Modelsarecomposedof,orcanbeconvertedto,alargenumber ofgeometricprimitives. Typicalrenderingprimitivesdirectlysupportedinhardware include:


Points(singlepixels) Linesegments Polygons(perhapssimple,triangle,rectangle)

Modelingprimitivesincludethese,butalso

Piecewisepolynomial(spline)curves Piecewisepolynomial(spline)surfaces Implicitsurfaces(quadrics,blobbies,etc.) Other...

Softwarerenderermaysupportmodelingprimitivesdirectly,or mayconvertthemintopolygonalorlinearapproximationsfor hardwarerendering

Anumberofbasicalgorithmsareneeded:

Algorithms

Transformation:Convertrepresentationsofmodels/primitives fromonecoordinatesystemtoanother Clipping/Hiddensurfaceremoval:removeprimitivesandpartof primitivesthatarenotvisibleonthedisplay Rasterization:Convertaprojectedscreenspaceprimitivetoa setofpixels.

Advancedalgorithms:

Picking:selecta3Dobejctbyclickinganinputdeviceovera pixellocation. Shadingandillumination:Simulatetheinteractionoflightwitha scene. Animation:Simulatemovementbyrenderingasequenceof frames.

Application Programming Interfaces

X11:2Drasterization Postscript,PDF:2Dtransformations,2Drasterization Phigs+,GL,OpenGL,Direct3D:3Dpipeline APIsprovideaccesstorenderinghardwareviaconceptual model. APIsabstractthehardwareimplementationsand algorithmsinstandardsoftwarecalls.

For3Dinteractiveapplications,wemightmodifythescene oramodeldirectlyorjustthechangetheattributeslike viewinginformation. Weneedtointerfacetoinputdevicesinaneventdriven, asynchronousanddeviceindependentfashion.APIsand toolkitsarealsodefinedforthistask.GLUT,Qt,GTK, MFC,DirectX,Motif,Tcl/Tk.

Rendering:conversionfromscenetoimage

Graphics Rendering Pipeline


3D Scene Render 2D Image

Sceneisrepresentedasamodelcomposedofprimitives. Modelisgeneratedbyaprogramorinputbyauser. Imageisdrawnonanoutputdevice:monitor,printer, memory,file,videoframe.Deviceindependence.

Typicallyrenderingprocessisdividedintostepscalledthe graphicspipeline. Somestepsareimplementedbygraphicshardware. Programmablegraphicsaccelerator,GPU: programmablepipelinesingraphicshardware

Thebasicforwardprojectionpipeline:
Modeling Transformations
M1 Model M2 M3 3D World Scene V 3D View Scene

Model

Viewing Transformations

Model

MCS

WCS

VCS
Rasterization

Clip

Normalize

2D/3D Device Scene

Projection

NDCS
2D Image

DCS SCS

You might also like