Introduction to Computer Graphics
Introduction to Computer Graphics CS 412
Popular in Course
verified elite notetaker
Fanny Flatley V
verified elite notetaker
Fanny Flatley V
verified elite notetaker
Fanny Flatley V
verified elite notetaker
verified elite notetaker
verified elite notetaker
Popular in ComputerScienence
This 21 page Class Notes was uploaded by Trent Dare on Wednesday September 23, 2015. The Class Notes belongs to CS 412 at University of New Mexico taught by Pradeep Sen in Fall. Since its upload, it has received 8 views. For similar materials see /class/212187/cs-412-university-of-new-mexico in ComputerScienence at University of New Mexico.
Reviews for Introduction to Computer Graphics
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/23/15
ECECS 412 Introduction to Computer Graphi Class September 1d mm P vadeep Sen Advanced Graphics Lab CS II III I I III Highlights ofSlGGRAPH 2008 Friday Septemberll 2m ECE 118 at noon I III Last time Signal processing A mgimmmnomnmcm mwwmmn mx Today Introduction to 2D graphics Computational photography A f gmwwmm marsmmm mx Traditional 2D graphics Sprites 2D transformations tc 7 mp9quot We will talk about these things in a few weeks when we lead up to 3D graphics as m mmmn 7 Owner cm mwwmmn mx A s stem gt 2DI Computational Photography Kind of like image processing on steroids Image processing 2D image gt 2D image Computational photography y mage mm mm 7 mm mm 7 mp9quot imagingimage marsmmm mx Examples Example 1 Image deblur r ECECS 412 Introduction to Computer Graphics 6 ECECS 412 Introduction to Computer Graphics Slide courtesy Ramesh Raskar MERL V Pradeep Sen Class 5 September 10 2008 it Pradeep Sen Class 5 September 10 2008 Traditional image processing Traditional Camera Blurring Box Filter Sync Function Traditional deblurring New technique r t Convolution I unun n WY 39 l I39lt llm I llquot n Hi 394 I far i lvlbriynxuw liIIAJIIL 39 a 39 aECEcs 412 Introductio Slide courtesy Ramesh Raskar MERL cmECEcs 412 Introduction to Computer Graphics Slide courtesy Ramesh Raskar MERL Pradeep Sen lass 5 September 10 2008 Pradeep Sen Class 5 September 10 2008 34u Solution flutter shutter camera Implementation m Completely Portable Slide courtesy Ramesh Raskar MERL ao f ECECS 412 Introduction to Computer Graphics ECECS 412 Introduction to Computer Graphics Pradeep Sen Class 5 September 10 2008 Pradeep Sen Class 5 gt Flutter S h u tte r Cod ed FI Ite r EOE08472 irilrpduclipri p Cprrpuler Graphics Slide courtesy Ramesh Raskar MERL r EOECS 472 lrilr ducli h ID CUmpUlE r Graphics Slide courtesy Ramesh Raskar MERL Pradeep Seri Class 5 rSeplernber 10 2008 Pradeep Seri Class 5 rSeplernber 10 2008 Short Exposure Example 2 Image completion VMatlab Lucy 77 nae courtesy Ramesh Raskar MERL Slide courtesyAlyosha Efros CMU EOECS 412 irilrpduclip EOECS 412 inlrpduclipri In Cpmpuler Graphics Pradeep Seri 7 7 v Pradeep Seri Class 5rSeptember10 2008 Add a database of images Results Slide courtesy Alyosha Efros CMU EOECS 4 72 lrilrpduclipri p Cprrpuler Graphics f EOECS 472 lrilrpduclipri p Cpmpuler Graphics Pradeep Seri Class 5 rSeplernber 10 2008 Pradeep Seri Class 5 rSeplernber 10 2008 Example 3 Tour Into the plcturequot Photo popup vmeu rmm mu Hum a a a by phmu Edmng by on Eta Hmem 213 m umww Examplea Refocusmg Ren Mg wm ms camera 39 3917 N Mmmwm 2 m mew The ma sswmme were a mmvmens anav m quotmm mm sensunu SEpavate me vavs mum that wuum nuvmaHv be waged m a smme pm mama aw am 1i msmwm quotzrrzmu camera assembly Observations they na m 12 observauons esmmmn mm Thenumbevm we delevmmesme num usemunev usmg no EssermaHv WE ave Uadmu cm Spatwa vesmmmn mangmanesmmmn a 5 may each xensm by m angmav sammes vesuhmun mam a The rm a whey m angmav sammes m be 12 x12 2 Tms 5 MIme mm mm have mmed um vm a nume cameva ralhmgmmw THESm g 3MMM Ems2m Refocusmg results Lk lmammwm Stanford swimmeet Palace of Fine Ans SF mg mmwm mummy Images What are light fields uwmg a ung aume rays at ngm m a scene xi lmzrmmwm The light field LXy 5 w sum Phonyinky Wm gumquot g maimmmnomnercm V 7 4 mp9quot msswmmn mx Light eld definition Formally we de ne a light field as the radiance at every point in any direction Informally we can think of radiance as the amount oflight in a ray radiance is the power per unit projected area perpendicular to the ray per unit solid angle in the direction ofthe ray units Wmzsr amp mmmmwmm r 7 mp9quot clxxerevkmmm mx ECECS 412 Introduction to Started talking about texture mapping Computer Graphics Last time ClasslB October 29 mm P vaueep Sen Advanced Graphics Lat mm mm 7 mm mm mevsu Today Texture filtering Texture ltering Screen space samples are closertogether than texture samples magni cation OpenGL provides two reconstruction lters GLNEAREST GL NEA Screen space samples are farther apart than texture samples mini cation Summed area tabl Mipmapping maimmmnnmnercm W mp9quot mm mm 7 mm mm mum39s mx mm Summed area tables Mipmapping MIP multum in panic many things in a small place in which to perform precompu ed mini cation T hnique ltering for ix mazmmmnnmnerc m s mp9quot mm mm 7 mm mm mevsu Mipmapping Accessing the mipmap maimmmnnmnercm as Problems with mipmapping Decimated textures all have a square footprint isotropic mm mm 7 mm mm mp5s magma mx Anisotropic filtering Reading ellipse multisampling maimmmnnmnercm mp9quot Approximate the pier footprint with an Compute contribution in eipse through Angel thru Ch 8 mm mm 7 mm mm mevsu magma mx ECECS 412 Introduction to ClasslB November 5 mm P vadeep Sen Advanced Graphics Lab Computer Graphics Announcements Homework 3 is due today by midnight Let me know ifyou are taking late days mm mm 7 mm mm mm ca 97 mm mx Final Project info on class webste Get started on project asap by Sunday nIght maimmmnnmnercm mp9quot Final project proposal due this Sunday by midnight lwill post project announcement and XNA Good rule of thumb complete XNA tutorials lwill showyou some game examples on onday Grading Grading nished HW1 HW2 and midterm We are halfway throughquot the course grade nal project nal exam and one or two lwill send out status grades via email soon mm mm 7 mm mm mm ca 97 mm mx Today Vertex and fragment programs mm mmmnnmnercm Realtime APl s OpenGL vs DirectX Realtime APls Rendering engine communicates to the hardware via a realtime API There are currently two popular realtime APls39 OpenGL DirectX mm mm 7 mm mm mp9quot ca 97 mm mx Realtime APls licecsuzmmwcmn to ammonia mm atquot Class lQerembei 2mg OpenGL state machine icecsuzmowamn n common Viadeev atquot Class lQerembei 2mg Immediate mode Vertices are passed down as soon as they are specified for each vertex 1 1n geometry speclfy the vertex normal g1Normal3f nl O nl 1 nl 2 speclfy the vertex color speclfy the texture coordlnates texi O texl 1 m H 1 m x 0 o o m D I m glVerteX3f vl O vl 1 vl 2 OpenGL Design led by Kurt Akeley one ofthe founders of Silicon Graphics Expose the graphics hardware as a state machine Specification controlled by the ARB Architecture Review oa d httpWWW opengl org Class aeNWamia 2mm tcmsmmvmquot to Computererth may atquot icecsuzmowamn n common Viadeev atquot Class lemma 2mg Issuing geometry There are two ways to pass geometry down to the hardware in OpenGL Immediate mode Display lists Class aeNWamia 2mm Ecscsuzmtmdwmn n CMputerGriahc m p atquot Immediate mode Note that there are various commands to allow different format types vold glVerteX234 slfd v TYPE coords Examples glVerteX2d34 glVerteX2f3142 float v3 10 29 35 glVe rtex3t v Class lemma 2mm Ecscsuzmtmdwmn n CMputerGriahc v atquot Immediate mode The ngegin statement indicates what kind of primitive is being drawn ngeg1nGL7TRIANGLES glVertex2d00 glVertede 23 glVertede 715 glEndU Some others include GLPONTS GLLNES GL QUA GLTRANGLESTRP Yetc swammm 3 common Map St Class lemma 2mg Vertex arrays Instead of performing individual calls per vertex pack them into an array and call it once First we must enable the vertex arrays VOld glEnableCllentStateGLenum array Where array can be 7 GLivERTExiARRAY 7 GL7COLOR7ARRAY 7 GLiTEXTUREicooRDiARRAY etc Ecscsl12mrmducmn 3 Waterman mm s Class gimmua 2mm Vertex arrays Provide a pointer to the array that contains the appropriate information VOld glVerteXPolnter1nt sue GLenum type Glezel stride const GLvold ptr Similar calls exist for color texture coordinates etc swammm 3 common Way St Class lemma 2mg Display lists Provides a cache of OpenGL commands drawScene glNelest 1 GL7COMPILE glEndLlst39 glLoadMatrlx M glCallLlstl Cannot be modified swammm 3 common 5 radeev Class 197Nwember5 2mg Vertex arrays To draw use void glArrayElement1nt 1 To send down the im element or VOld ngrawArraysGLenum mode lnt first lezel count To draw a group of elements int 1 ngeg1nmode for 10 1 lt count 1 glArrayElement f1rst1 g1End ECECSMZrmudwmn 3 cmpurercraanm m ev s Class gimmua 2mm OpenGL Extensions OpenGL was meant to be dynamic and to evolve as hardware capabilities changed Designers developed an extensionbased architecture where the driver reports to OpenGL what extensions it exposes Complete list of extensions can be seen in the extension registry httpwww opengl orgregistry ECECSMZrmudwmn 3 cmpurercraanm v s Class 197Navember5 2mm DirectX Really a collection of APIs for different tasks in the form of COMcompliant objects Directlnput to handle IO from input devices such as joysticks keyboard e c DirectPlay to handle networking between PCs DirectSound for playingrecording of sound fx DirectMusic for playing audio soundtracks DirectXMedia for animation and multimedia streaming apps DirectDraw for 2 D drawing to the screen Direct3D for 3D rendering sag2541212222222 2 2222129222 212 5 2155 12422215 2222 History of DirectX History of DirectX DirectX 4 was never released back to the drawing board DirectX 5 was released July 1997 Latest version is DirectX 10 released Nov 2006 only on Windows Vista 2155 12422215 2222 In 1992 a company was founded called RenderMorphics They created a 3D API called RealityLab In 1995 Microsoft bought RenderMorphics and soon produced the 3D API called DirectX 20 for Windows95 DirectX 20 released June 1996 DirectX 30 released September 1996 People began to use it 52g254121mmmn 2 22221 2 212 5 2155 1241mm 2222 Differences between DirectX and OpenGL Differences between DirectX and OpenGL DirectX is natively lefthanded OpenGL is righthanded Projection matrix maps zdepths to 0 to 1 range 1 to 1 in OpenGL Row major matrix representation column major in OpenGL etc quot sag2541212222222 2 2222129222 1 V12 5 2155 12422215 2222 At a highlevel OpenGL is much easier to get something to draw to the screen DirectX is intended for highperformance applications so drawing a single triangle is complicated 2155 1241mm 2222 Overview of DirectX 52g254121mmmn 2 22221 2 212 5 2155 1241mm 2222 m m mmmn 7 Owner cm Taking a look at some code Acquiring a Direct3D inter ce handle IDHEELEDS mamem md dohjeo DnreccancreategDanisnkivlIRSIONI Creating the Direct3D object IblreoerDevloeg gmmme md dohjeorrgtcreacebev1o2t magnum pnmarv adapter nannsvnpgmu 1 mh alnilnd vnnduw dev ehavlurl Jsgs vertex processing smdadPP present parami Lgd dbevloEi return created devlce mm mm 7 mm mm mp9 ca 9 Taking a look at some code I D3DPRESENTPARAMETERS v r pedei scrum inanpnasamimmamns lt m mseamen hmemz m gt mmmutmgm amp minzmmmnomnercm m mm mm Taking a look at some code Sample settings alarmFlags dldppFullScreenikefxeshkaceln z nanmsmimzinmm d dppPresentaclonlncexval D3mmszmimnxvnilmmlnz mm mm 7 mm mm maps ca 9 Vertex and index buffers Vertex buffer a chunk ofcontiguous memory that contains the vertex data represented by the ID1rect3DVertexBuffer9 interface Index buffer a chunk ofcontiguous memory that contains the index data represented by the ID1rect3DIndexBuffer9 interface Access this memory through LockUnlock methOds bu ermeWW mm mm w m m mmmn 7 Owner cm mp9quot m 9 mm mx Taking a look at some code Creating a vertex buffer edadne vloergtCreaceVercexEuiiErt a slzeuftverce y hum hVEES DanusncaiwITEoNLY dynamlcscacn u v r x z a MDPOOLiHANAGED menm pun LnVE handle an vb a mm mm 7 mm mm mm ca 9 mm mx Simple example Program to draw two shapes crests m vertex mums ans in each hape gd dDevcergtCxeaceVexcexEuffetislzeafishapelr nanusssziumzumv u DanpuuLimmszb spshapelv quotmy gd dDevcergtCxeaceVexcexEuffetislzeafishapelr nanusssziumzumv u DanpuuLimmszb Apshapezv mm m in bath ativad lspbaay l mg k all r Lus zssupna s cm daca nu buffer h p we memcpylpbacayshapelslzeaf shay ShapelVErgtLanackllF psss dawn vertex nfaxma ps s s rgtLack 1 pShapezv rgtLacklUslzeaflPDacalrivald lspDaaUl mm memcpvlpDacayshapezslzeafishapell Hearty daca nu buffer PShapeZVErgtUnlackUF Himmmnnmnemm Simple example Now onto the drawing loop gd dbevlcer leari mm nanchJmn l Dancun z un Dancumx xxs imm ty mm m n gdldbevlcergt egan5cene scan dramng draw 5 shape gdldbevcergtSecscxeamSauxCEUr pshspsww slzeafiDEDVERTEXHF gdldbevcergtDmenmUVElDClDP39L39KRIAIlEvLELls39KEhll draw 2nd shape gdldbevcergtSecscxeamSauxCEUr pshspszvausussimanv2mxn gdldbevcergtDmenmUVElDClDP39L39KRIAIlEvLELls39KEhll gdadnevncer ndsceneit snap drawing gdldbevlcer xesentquotULLJILVLLIILVLLyllLVLll swap buffers maimmcmnmnumm my on is mum39s mx Some things are easier than OpenGL Creating and using textures D3DXCKEBEETEXEHKEFKDEF113lgiAPPE39EEDE nEEH incurspug spl ly39lexcuxEl giApp sssnsms i t rgt5alexcuxe tummzsxmsi DirectSD 10 rendering pipeline g mgmmm w m sxx s mm mx 1quot mg mm 7 mm mm ECECS 412 Introduction to Computer Graphi Class eememeei ui mm P iaeeep eeii Advanced ciaimies Lab CS Last time 2D Hardware 3D graphics pipeline mm mm 7 mm mm maps Elxxerevhnihuzt mx Taday 3D Graphics pipeline Geometry maimmmnnmnermpms W uneven Eltsrslvlnihu x The realtime rendering pipeline lnsdelhe cw Elxxerevhnihuzt mx The realtime rendering pipeline Rasterlzatlon iliiiii imam a mum em Geometrlcal rlangles are convened inm plxels Also called scan converslon Eltsrslvlnihu mx Rasterizatian mm mm 7 mm mm maps Elxxerevhnihuzt mx The real 39me rendering pipeline lure Alluvvs mudulatmn uf the surface ulur Dr umer prupemes by a bitmap Texturing mm mm 7 mm mm maps The realtime rendering pipeline Fragment prunessmg Tradmunallythis Was unly Simple blending Nuvv GPUs alluvvfur prugra b h l Alsu includes framebuffer ups l l m m mmmn 7 Owner cm Display mmcnn a mum calms The realtime rendering pipeline DA cunv framebu ertu the display eners scan u Scrimmava mx The real me rendering pipeline gamma mx Madeling ren dere mm mm 7 mm mm mevsu How do you describe the 3D shapes to be snurce Stantnm Granhlcs Lah marsme mx Point cloud Polygonal mesh Unstructured set of 3D point samples A mesh of connected polygons triangles aquot 9939 9 JV source it unr sm mm MMMWWW m 3 mm mm 7 mm mm mp9quot clxxerevhmmzt mx Polygonal meshes Polygon mesh representations Why do we care Important properties Simple representation Fast traversal oftopology Hardware acceleration Memory ef cien Updates quickly gquot mailmmmnomnemm 1X mm mm 7 mm mm clnsr vhmmnmx 77 mp9quot clxxerevhmmzt mx Subdivision surfaces Computed from coarser polygonal meshes by subdividing the pol ons Smooth sur ce is de ned by the limit ofthe subdivisions we source mummm clnsr mmmm mx ECEICS 412 Introduction to Computer Graphics Class 23 Nuvember 19 ZEIEIE F39 adeep Sen Advanced Graphics Lab Announcements ecsos m ntmamn to Computer Graphic Vladeev Sen one ZLNmembel a 2mm Last time Today Started talking about illumination Diffuse reflection 50505 ltzmuducmn a Computer Grimm mated Sen Class ZZerembel a mum More on illumination Iscycs m ntmamn to Computer Graphic V Vladeev Sen one ZLNmembel a 2mm Diffuse reflection Diffuse reflection Aka Lambeltian reflection Diffuse reflection is only dependent on the incident light direction and the surface normal not the View direction A measure of the irradiance on the surface lrnagesaume Vlnkipediz 50505 ltzmuducmn a Computer Grimm Vladewse ElassZZerembeltg mm Goniometric diagrams N c059 radiant intensity exiting power per unit solid angle ecsos m ntmamn to Computer Graphic Vladeev Sen L is constant radiance exiting power per unit solid angle per unit area one ZLNmembel a 2mm Specular reflecnon Glossy reflecnon Mwur re ecter ng mude Assumesmamere s a preferred mrectmn rurme mgnngm Ver dependenu SEIZW39quot quot quot ar w ll mmw ar Glossy objects Glossy objects A 1 39quot quot EEIZ M39quot ar Arbltrary materials ERDF mannerspecuxarnurmmsw Funcnun ERDFS Fvst de ned by Nmudemus m 197m Rana ufumgmng ramance m madam wamance Umts 1sr gf ilmmw mum mm lf 1fmmwm ar ERDF propemes i A mam C vvn ivh Recipiucaneimnuiu a gtq m m Lineainv ismiupic mum mayer J m quot 39quot rim ERDF Implementation comeu on uni acts ERDFS can be measured imm rEaLWEmd mummy RumNW Readlng Fhong Shadlng Angei on e
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'