3D graphics card and OpenGL.docx
- 文档编号:10109807
- 上传时间:2023-05-23
- 格式:DOCX
- 页数:36
- 大小:783.82KB
3D graphics card and OpenGL.docx
《3D graphics card and OpenGL.docx》由会员分享,可在线阅读,更多相关《3D graphics card and OpenGL.docx(36页珍藏版)》请在冰点文库上搜索。
3DgraphicscardandOpenGL
3D-Graphics-CardsandOpenGL
Author:
AndreasPilz
HauptseminarElektrotechnik98/99
LehrstuhlfürProzessrechentechnikLPR
TUMünchen
TableofContents
1Introduction
2.TheGraphicsPipeling
3.Algorithmsfor3D-Graphics3.1Homogeneouscoordinates
3.2Shadingmodels1.Flatshading
2.Gourandshading
3.Phongshading3.3Z-Buffering
3.4Texture-Mapping
3.5Environment-Mapping
3.6Texture-andEnvironment-Mapping
3.7Bump-Mapping
3.8TransparentTextures(Alpha-Buffer)4.Graphics-cardswithintegrated3D-Accelerator4.1Basicsofgraphics-cards1.Function
2.Bottlenecks,whichaffecttheperformanceBUS-SystemandAGP
VideoChipset,VideoMemoryandRAMDAC3.Driver4.2UptodateLow-Endgraphics-cards1.RIVATNTversusVoodoo2
2.PerformanceWindows98
3.PerformanceWindownNT4.04.3High-End:
Example3DLabsOxygenGMX
4.4ComparisonofLow-andHigh-End
4.5Summary5.OpenGL
6.Literature
7.Appendix
1Introduction
Inthebeginningofthecomputertechnologytheoutputdeviceprovidingdatafortheuserweresimplelights,punchedcardsandprintsinbadquality.Butitwasnotveryefficienttoprogramacomputerusingabout20switchesandthesamenumberofLEDs.Asthecomputersbecamemorepowerfulandfaster,aappropriateoutputdisplaywasnecessary,inordertobeabletointeractwiththecomputerinacomfortableway.TheideawastocombineacomputerwiththeCRT-technology(Cathode-Ray-Tube).ThefirstcomputersystemssuppliedwithmonochromeCRT-displaysweretextbasedwith40or80charactersperline.Butthefastinnovationoftheprocessorsmadeitpossibletothinkofvisualisingdata.Astheresolutionoftheoldtext-basedsystemswastoopoor,newgraphics-standardslikeCGA,EGA,VGAandXGAwerecreatedandgraphics-cardswith2D-acceleratorsweredesigned,inordertoincreaseperformanceandquality.Thenextevolutionwastogenerate3D-graphicsfore.g.CADorevenanimationsformovies.Howeverspecialhardwarehastobeusedandisstillbeused.Theleaderinhigh-end3D-graphics-systemsforprofessionalsisSiliconGraphics.Butitshardwareisveryexpensive,beginningat$75,000forastandardversionofaSGIOnyxIR2uptoseveralmilliondollars.Butnowadaystheideaofgeneratingmoving3D-graphicsinphotoqualityandinreal-timeevenforconsumerPCsisthemotivationfordevelopingnewgraphics-cardswithintegrated3D-accelerators.Theseacceleratorsareverycomplexchips,whichconsistofmorethan7,5milliontransistors(IntelPentiumIIprocessor:
~7milliontransistors).Asthereisabigmarketforcomputergameswithverygood3D-graphics(e.g.Quake,Forsaken),theinnovationprocessintheconsumermarketisveryfast.Asaresultofthis,newversionsofeachgraphics-chipsetarepresentedeveryhalfyearandalotofnewfeaturesareintroduced.Thereforeitisnotsurprising,thatthecheapconsumergraphics-chipsetsmakeupfortheprofessionalmarket,e.g.theElsaSyngergyII,aprofessionalcard,isbasedontheRIVATNTchipset.Thisessayisonlyabletogiveaoverviewontherecent3D-graphicstechnologyandfeatures,becauseoftherapidproductcycle.Afterthatrecentlow-andhigh-endgraphics-cardsforPCsarecompared.InthelastsectiontheOpenGLlibraryisintroduced.
TableofContents
2TheGraphicsPipeline
TheApplicationprogramcreatesahierarchical3D-wireframe-model,whichisdescribedinworldcoordinates.Inadditiontothecreationofthe3D-modeltheilluminationandshadingmodelisdefined.Thissceneistransferredtothe3D-Graphics-card.FirstofallthiscardperformsTransformations,likerotation,translation,shearing,scaling,...onthegivenobjects,usingainternalcoordinatesystemandtheintegratedaccelerator.AfterthattheShadingmodeliscalculated.Asaresultofthisthereareseveralobjects,whichareilluminatedandshadedandwhicharepositionedin3D-space.Nowthereisaveryimportantstep:
Theconversionfrom3D-spaceinto2D-spaceofthescreenincludingtheVisible-surfaceDetermination.Acommonmethodtosolvethevisibilityproblemisthez-Bufferalgorithm.ThenTextureMapping(paperingaobjectwithaimage)andAnti-Aliasing(reductionofedgesandsteps)isperformed.Inthelaststepofthispipelinethedigitalimageinformationisconvertedintoananalogsignalforthemonitor.
TableofContents
3Algorithmsfor3D-Graphics
3.1Homogeneouscoordinates
Auniformrepresentationofalltransformationsinmatrixnotationisnecessaryforimplementingthesetransformationsinhardware.Asitisnotpossibletodescribethetranslationinmatrixnotationincartesiancoordinates,thehomogeneouscoordinateshavetobeused.Butitisveryeasytotransformcartesianintohomogeneouscoordinatesandviceversa.Thefollowingformulasshowtherelationofcartesianandhomogenouscoordinatesanddescribethetranslationinmatrixnotationinhomogenouscoordinates:
Thereforeinhomogeneouscoordinatesitispossibletodescribeanytransformationinmatrixnotations:
Thisuniversalmatrixfortransformationscanbedevidedintofourfunctionblocks:
Thehomogeneousmatrixrepresentationsofcommontransformationsareshownintheappendix.
Thereforeitispossibletodescribeallthree-dimensionalgeometrictransformationsinmatrixform.Asaresultofthis,onesinglestructurehastobeimplementedinhardware,inordertocomputeanygeometrictransformation.
Important:
∙Asequenceoftransformationscanberepresentedbyonematrix:
T=T1*T2*T3*...
∙ Ifthereisasequenceoftransformationstobeexecuted,thenfirstofallcalculatethematrix,whichrepresentsthewholesequence.Afterthatperformthetransformationonthegivendata.
∙ Theorderofthetransformationseffectstheresult!
TableofContents
3.2Shadingmodels
Theusageofashadingmodelmakesitpossibletocalculatereflexionsandshades.Thereforetheimageofthe3D-sceneismorerealistic.Butthereareadditionalparametersnecessaryforshadingmodels:
∙Descriptionofthelightsource
∙ Characterizationofthesurface
∙ Relativepositionsofthelightsourcesandoftheobserver
Thefollowingfigureshowstheidealreflexion:
Objectswithdull,mattesurfacescanbedescribebytheso-calledLambert-Reflection.Asthesesurfacesreflectlightwithequalintensityinalldirections,theyappearequalbrightfromallviewing.Thediffuseilluminationequationis:
TableofContents
3.2.1Flatshading
Flatshadingistheeasiestmethodforcalculatingshadesandreflexions:
Theshadingmodelisperformedatonesinglepointofapolygon.Thecalculatedcolorofthispointisthefill-colorofthewholepolygon.Thereforethecolorshavetobeonlycalculatedatasmanypointsasmanypolygonstheobjectconsistof.Becauseofthis,flatshadingisveryfastandeasy,butifthepolygonsarebig,thentheimageofthescenelooksfiledanditisnotveryrealistic.
TableofContents
3.2.2Gourandshading
TheideaofGourandshadingistheinterpolationofthecolorofeachsinglepointusingthecolorsatthevertices.Thecolorsattheverticesarecomputedusingtheshadingmodel.Therearethetwofollowingsteps:
1.Calculatingthecolorofthevertexes
Firstofallthenormalsattheverticesarecomputedbyaveringthenormalsofthepolygonsconnectedtoavertex:
Nowtheexactcolorofeachvertexcanbecomputedbyusingtheshadingmodel.
2.Projection&Interpolation(=Rendering)
Inthesecondstepthe3Dobjectisprojectedintothe2Dspace.Asaresolutionisdefinedforthescreenrepresentation(e.g.640*480pixels)theimagehastoberasterized.Thefollowingdiagramshowsthe2Dprojectionofan3Dexampletriangle:
Therasterizationisdonebyscanningthe2Dimagealongso-calledscanlines,whichcorrespondtothepixelrowsofthedisplay.Inthediagramonescanlineisshown.ItcutsthetriangleatthepointIl(eft)andIr(igth).ThecolorvaluesatthesetwopointsareinterpolatedusingthecalculatedcolorvaluesatthepointsI1,I2andI3andthefollowingformulas:
Nowthecolorvaluesalongthescanlinecanbecalculatedbyusingthefollowingformulas:
Thepixelsarecomputedinthesameway.Gourandshadingissuitablefordiffuseobjects.Theproblemsofthismethodarefastchangesoftheintensity.
TableofContents
3.2.3Phongshading
ContrarytotheGourandshadingmethodPhongshadinginterpolatesthenormalvectorsateachpixelandperformstheilluminationandshadingcalculationateachpointusingtheinterpolatednormals:
ThePhong-shadingmethodisabletocalculatereflections.Buttheexpenditureofcomputingpowerisbigger,becauseoftheinterpolationofthenormalvectorandofthecalculationoftheshadingmodelateachsinglepoint.
TableofContents
3.3Z-Buffering
Byperformingtheprojectionfromthe3Dmodellintothe2Dviewplane,theinformationofwhichpointisinthefrontandwhichisinthebackislost.Thereforeitisnecessarytocalculateandstorethedepthofeachsinglepixelinadditionaltoitscolor.Thisdepth(z-value)isstoredintheso-calledz-Buffer.Whenanewpointisprojectedintothe2Dspace,itcanbedecided,ifitisinthefrontofanexistingpointandthereforehastobedrawnorifitisinthebackandcanbeskipped.Themostimportantadvantageofthez-Buffermethodis,thattheobjectsofa3D-scenecanbetransformedintothe2Dviewplaneinanyorderandthatobjectscanbeaddedtothesceneatanytime.
Thefollowingfigureshowstheprojectionofaobject(yellow)intheXYZ-spaceintothe2D-UV-viewplane(blue)andthelineofsight
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 3D graphics card and OpenGL