ebook img

Advanced Graphics Programming Using OpenGL PDF

672 Pages·2005·16.426 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Advanced Graphics Programming Using OpenGL

Advanced Graphics Programming Using OpenGL TOM McREYNOLDS DAVID BLYTHE AMSTERDAM•BOSTON•HEIDELBERG•LONDON NEWYORK•OXFORD•PARIS•SANDIEGO SANFRANCISCO•SINGAPORE•SYDNEY•TOKYO MORGANKAUFMANNPUBLISHERSISANIMPRINTOFELSEVIER TEAM LinG Advanced Graphics Programming Using OpenGL TEAM LinG The Morgan Kaufmann Series in Computer Graphics and Geometric Modeling SeriesEditor:BrianA.BarskyUniversityofCalifornia,Berkeley Thisseriespublishesthefinestworksfortheaccomplishedandaspiringgraphicsprofessional.Theseriesincludesintermediate andadvancedtextbooks,graphicsprogrammingbooks,surveysofimportantnewareasandmethods,andreferenceworks. AdvancedGraphicsProgrammingUsingOpenGL TheComputerAnimator’sTechnicalHandbook TomMcReynoldsandDavidBlythe LynnPocockandJudsonRosebush DigitalGeometryGeometricMethodsforDigital AdvancedRenderMan: PictureAnalysis CreatingCGIforMotionPictures RienhardKletteandAzrielRosenfeld AnthonyA.ApodacaandLarryGritz DigitalVideoandHDTVAlgorithmsandInterfaces CurvesandSurfacesinGeometricModeling: CharlesPoynton TheoryandAlgorithms JeanGallier Real-TimeShaderProgramming RonFosner AndrewGlassner’sNotebook: RecreationalComputerGraphics CompleteMayaProgramming: AndrewS.Glassner AnExtensiveGuidetoMELandtheC++API DavidGould WarpingandMorphingofGraphicalObjects JonasGomes,LuciaDarsa,BrunoCosta,andLuizVelho MELScriptingforMayaAnimators MarkR.WilkinsandChrisKazmier JimBlinn’sCorner:DirtyPixels JimBlinn DigitalVideoandHDTVAlgorithmsandInterfaces CharlesPoynton RenderingwithRadiance: TheArtandScienceofLightingVisualization Texturing&Modeling: GregWardLarsonandRobShakespeare AProceduralApproach,ThirdEdition DavidS.Ebert,F.KentonMusgrave,DarwynPeachey, IntroductiontoImplicitSurfaces KenPerlin,andStevenWorley EditedbyJulesBloomenthal GeometricToolsforComputerGraphics JimBlinn’sCorner: PhilipSchneiderandDavidEberly ATripDowntheGraphicsPipeline JimBlinn UnderstandingVirtualReality: Interface,Application,andDesign InteractiveCurvesandSurfaces: WilliamShermanandAlanCraig AMultimediaTutorialonCAGD AlynRockwoodandPeterChambers JimBlinn’sCorner:Notation,Notation,Notation JimBlinn WaveletsforComputerGraphics: TheoryandApplications LevelofDetailfor3DGraphics: EricJ.Stollnitz,TonyD.DeRose,andDavidH.Salesin DavidLuebke,MartinReddy,JonathanD.Cohen, AmitabhVarshney,BenjaminWatson,and PrinciplesofDigitalImageSynthesis RobertHuebner AndrewS.Glassner PyramidAlgorithms:ADynamicProgramming Radiosity&GlobalIllumination ApproachtoCurvesandSurfacesforGeometric FrançoisX.SillionandClaudePuech Modeling Knotty:AB-SplineVisualizationProgram RonGoldman JonathanYen Non-PhotorealisticComputerGraphics: UserInterfaceManagementSystems: Modeling,Rendering,andAnimation ModelsandAlgorithms ThomasStrothotteandStefanSchlechtweg DanR.Olsen,Jr. CurvesandSurfacesforCAGD:APracticalGuide, MakingThemMove:Mechanics,Control,andAnimation FifthEdition ofArticulatedFigures GeraldFarin EditedbyNormanI.Badler,BrianA.Barsky,and SubdivisionMethodsforGeometricDesign: DavidZeltzer AConstructiveApproach GeometricandSolidModeling:AnIntroduction JoeWarrenandHenrikWeimer ChristophM.Hoffmann ComputerAnimation:AlgorithmsandTechniques AnIntroductiontoSplinesforUseinComputerGraphics RickParent andGeometricModeling TEAM LinG RichardH.Bartels,JohnC.Beatty,andBrianA.Barsky PublishingDirector: DianeCerra PublishingServicesManager: SimonCrump ProjectManager: BrandyLilly EditorialCoordinator: MonaBuehler CoverDesign: Dutton&ShermanDesign TextDesign: JulioEsperas Composition: CephaImagingPvt.Ltd. Illustrations: DartmouthPublishing,Inc. Copyeditor: DarilBentley;GraphicWorld Proofreader: GraphicWorld Indexer: GraphicWorld Interiorprinter: ChinaTranslation&PrintingServices,Ltd. Coverprinter: ChinaTranalation&PrintingServices,Ltd. MorganKaufmannPublishersisanimprintofElsevier. 500SansomeStreet,Suite400,SanFrancisco,CA94111 Thisbookisprintedonacid-freepaper. ©2005byElsevierInc.Allrightsreserved. Designationsusedbycompaniestodistinguishtheirproductsareoftenclaimedastrademarksor registeredtrademarks.InallinstancesinwhichMorganKaufmannPublishersisawareofaclaim, theproductnamesappearininitialcapitalorallcapitalletters.Readers,however,shouldcontact theappropriatecompaniesformorecompleteinformationregardingtrademarksandregistration. Nopartofthispublicationmaybereproduced,storedinaretrievalsystem,ortransmittedinanyform orbyanymeans—electronic,mechanical,photocopying,scanning,orotherwise—withoutpriorwritten permissionofthepublisher. PermissionsmaybesoughtdirectlyfromElsevier’sScience&TechnologyRightsDepartmentinOxford, UK:phone:(+44)1865843830,fax:(+44)1865853333,e-mail:[email protected] mayalsocompleteyourrequeston-lineviatheElsevierhomepage(http://elsevier.com)byselecting “CustomerSupport”andthen“ObtainingPermissions.” LibraryofCongressCataloging-in-PublicationData ApplicationSubmitted ISBN:1-55860-659-9 ForinformationonallMorganKaufmannpublications, visitourWebsiteatwww.mkp.comorwww.books.elsevier.com PrintedinChina 10 9 8 7 6 5 4 3 2 1 TEAM LinG TomyfriendsandcolleaguesfromSiliconGraphics;itwasafabuloustimeandplaceto learnabout3Dgraphics.–DB ToEdeForneyandHarryMcGinnis;youweretherewhenitcounted.–TM TEAM LinG Contents Preface xxiii Acknowledgments xxvii Biographies xxviii PART I Concepts 1 CHAPTER 1 Geometry Representation and Modeling 3 1.1 Polygonal Representation 3 1.2 Decomposition and Tessellation 4 1.3 Shading Normals 8 1.3.1 SmoothShading 9 1.3.2 VertexWindingOrder 11 1.4 Triangle Stripping 12 1.4.1 GreedyTri-stripping 13 1.5 Vertices and Vertex Arrays 14 1.5.1 VertexBufferObjects 15 1.5.2 TriangleLists 16 1.6 Modeling vs. Rendering Revisited 17 TEAM LinG vi Contents vii CHAPTER 2 3D Transformations 19 2.1 Data Representation 19 2.2 Overview of the Transformation Pipeline 20 2.2.1 ObjectSpaceandtheModelviewTransform 20 2.2.2 EyeSpaceandProjectionTransform 21 2.2.3 ClipSpaceandPerspectiveDivide 22 2.2.4 NDCSpaceandtheViewportTransform 22 2.2.5 WindowSpace 23 2.3 Normal Transformation 23 2.4 Texture Coordinate Generation and Transformation 25 2.4.1 TextureMatrix 25 2.4.2 TextureCoordinateGeneration 25 2.5 Modeling Transforms 27 2.6 Visualizing Transform Sequences 28 2.7 Projection Transform 30 2.8 The Z Coordinate and Perspective Projection 30 2.8.1 ZCoordinatesandFog 32 2.9 Vertex Programs 32 2.10 Summary 34 CHAPTER 3 Color, Shading, and Lighting 35 3.1 Representing Color 35 3.1.1 Resolution and Dynamic Range 36 3.1.2 Gamma 37 3.1.3 Alpha 39 3.1.4 Color Index 39 3.2 Shading 40 3.3 Lighting 43 3.3.1 Intensities,Colors,andMaterials 46 3.3.2 LightSourceProperties 47 TEAM LinG viii Contents 3.3.3 MaterialProperties 49 3.3.4 VertexandFragmentLighting 50 3.4 Fixed-Point and Floating-Point Arithmetic 53 3.4.1 BiasedArithmetic 54 3.5 Summary 56 CHAPTER 4 Digital Images and Image Manipulation 57 4.1 Image Representation 57 4.2 Digital Filtering 60 4.3 Convolution 62 4.4 Images in OpenGL 63 4.5 Positioning Images 65 4.6 Pixel Store Operations 65 4.7 Pixel Transfer Operations 67 4.7.1 ScaleandBias 67 4.7.2 PixelMappingOperations 67 4.8 ARB Imaging Subset 68 4.8.1 Convolution 68 4.8.2 ColorMatrixTransform 68 4.8.3 Histogram 69 4.8.4 MinMax 70 4.8.5 ColorTables 70 4.8.6 BlendEquationandConstantColorBlending 71 4.9 Off-Screen Processing 72 4.10 Summary 72 CHAPTER 5 Texture Mapping 73 5.1 Loading Texture Images 73 5.1.1 TextureBorders 74 5.1.2 InternalTextureFormats 75 TEAM LinG Contents ix 5.1.3 CompressedTextures 76 5.1.4 ProxyTextures 77 5.2 Texture Coordinates 77 5.2.1 TextureCoordinateGenerationandTransformation 79 5.3 Loading Texture Images from the Frame Buffer 79 5.4 Environment Mapping 80 5.4.1 GeneratingEnvironmentMapTextureCoordinates 81 5.4.2 TextureMapsUsedinEnvironmentMapping 82 5.4.3 CubeMapping 83 5.4.4 SphereMapping 85 5.5 3D Texture 88 5.5.1 Using3DTexturestoRenderSolidMaterials 89 5.6 Filtering 90 5.7 Additional Control of Texture Level of Detail 91 5.8 Texture Objects 93 5.9 Multitexture 95 5.9.1 MultitextureModel 96 5.9.2 MultitextureTextureEnvironments 97 5.10 Texture Environment 98 5.10.1 AdvancedTextureEnvironmentFunctionality 99 5.10.2 FragmentPrograms 100 5.11 Summary 102 CHAPTER 6 Rasterization and Fragment Processing 103 6.1 Rasterization 104 6.1.1 RasterizationConsistency 105 6.1.2 Z-Fighting 105 6.1.3 BitmapsandPixelRectangles 107 6.1.4 Texture,Color,andDepthInterpolation 108 6.1.5 wBuffering 109 6.2 Fragment Operations 110 6.2.1 MultisampleOperations 111 6.2.2 AlphaTest 111 6.2.3 StencilTest 111 TEAM LinG x Contents 6.2.4 Blending 112 6.2.5 LogicOp 114 6.3 Framebuffer Operations 115 6.3.1 AccumulationBuffer 116 6.4 Summary 117 CHAPTER 7 Window System and Platform Integration 119 7.1 Renderer and Window State 120 7.2 Address Space and Threads 121 7.3 Anatomy of a Window 122 7.3.1 OverlayandUnderlayWindows 122 7.3.2 MultipleDisplays 123 7.4 Off-ScreenRendering 124 7.4.1 GLXPbuffers 125 7.4.2 WGLPbuffers 126 7.5 Rendering to Texture Maps 126 7.6 Direct and Indirect Rendering 127 CHAPTER 8 OpenGL Implementations 129 8.1 OpenGL Versions 129 8.2 OpenGL Extensions 131 8.3 OpenGL ES for Embedded Systems 131 8.3.1 EmbeddedProfiles 132 8.3.2 CommonandCommon-LiteProfiles 133 8.3.3 SafetyCriticalProfile 136 8.3.4 OpenGLESRevisions 136 8.4 OpenGL Pipeline Evolution 137 8.5 Hardware Implementations of the Pipeline 138 8.5.1 RasterizationAcceleration 138 8.5.2 PrimitiveSetupAcceleration 141 8.5.3 TransformandLightingAcceleration 141 8.5.4 PipelineBalance 142 TEAM LinG

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.