Mobile 3D Graphics with OpenGL ES and M3G

333 520 2
Mobile 3D Graphics with OpenGL ES and M3G

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Mobile 3D Graphics with OpenGL ES and M3G

The OpenGLRGraphics System:A Specification(Version 1.5)Mark SegalKurt AkeleyEditor (version 1.1): Chris FrazierEditor (versions 1.2, 1.2.1, 1.3, 1.4, 1.5): Jon Leech Copyrightc 1992-2003 Silicon Graphics, Inc.This document contains unpublished information ofSilicon Graphics, Inc.This document is protected by copyright, and contains information proprietary toSilicon Graphics, Inc. Any copying, adaptation, distribution, public performance,or public display of this document without the express written consent of SiliconGraphics, Inc. is strictly prohibited. The receipt or possession of this documentdoes not convey any rights to reproduce, disclose, or distribute its contents, or tomanufacture, use, or sell anything that it may describe, in whole or in part.U.S. Government Restricted Rights LegendUse, duplication, or disclosure by the Government is subject to restrictions set forthin FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Dataand Computer Software clause at DFARS 252.227-7013 and/or in similar or succes-sor clauses in the FAR or the DOD or NASA FAR Supplement. Unpublished rightsreserved under the copyright laws of the United States. Contractor/manufacturer isSilicon Graphics, Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043.OpenGL is a registered trademark of Silicon Graphics, Inc.Unix is a registered trademark of The Open Group.The ”X” device and X Windows System are trademarks ofThe Open Group. Contents1 Introduction 11.1 Formatting of Optional Features . . . . . . . . . . . . . . . . . . 11.2 What is the OpenGL Graphics System? . . . . . . . . . . . . . . 11.3 Programmer’s View of OpenGL . . . . . . . . . . . . . . . . . . 21.4 Implementor’s View of OpenGL . . . . . . . . . . . . . . . . . . 21.5 Our View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 OpenGL Operation 42.1 OpenGL Fundamentals . . . . . . . . . . . . . . . . . . . . . . . 42.1.1 Floating-Point Computation . . . . . . . . . . . . . . . . 62.2 GL State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3 GL Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . 72.4 Basic GL Operation . . . . . . . . . . . . . . . . . . . . . . . . . 102.5 GL Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.6 Begin/End Paradigm . . . . . . . . . . . . . . . . . . . . . . . . 122.6.1 Begin and End Objects . . . . . . . . . . . . . . . . . . . 132.6.2 Polygon Edges . . . . . . . . . . . . . . . . . . . . . . . 182.6.3 GL Commands within Begin/End . . . . . . . . . . . . . 192.7 Vertex Specification . . . . . . . . . . . . . . . . . . . . . . . . . 192.8 Vertex Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232.9 Buffer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302.9.1 Vertex Arrays in Buffer Objects . . . . . . . . . . . . . . 352.9.2 Array Indices in Buffer Objects . . . . . . . . . . . . . . 362.10 Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372.11 Coordinate Transformations . . . . . . . . . . . . . . . . . . . . 372.11.1 Controlling the Viewport . . . . . . . . . . . . . . . . . . 392.11.2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 402.11.3 Normal Transformation . . . . . . . . . . . . . . . . . . . 452.11.4 Generating Texture Coordinates . . . . . . . . . . . . . . 46i ii CONTENTS2.12 Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482.13 Current Raster Position . . . . . . . . . . . . . . . . . . . . . . . 512.14 Colors and Coloring . . . . . . . . . . . . . . . . . . . . . . . . . 552.14.1 Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . 562.14.2 Lighting Parameter Specification . . . . . . . . . . . . . . 602.14.3 ColorMaterial . . . . . . . . . . . . . . . . . . . . . . . 622.14.4 Lighting State . . . . . . . . . . . . . . . . . . . . . . . . 642.14.5 Color Index Lighting . . . . . . . . . . . . . . . . . . . . 642.14.6 Clamping or Masking . . . . . . . . . . . . . . . . . . . 652.14.7 Flatshading . . . . . . . . . . . . . . . . . . . . . . . . . 652.14.8 Color and Texture Coordinate Clipping . . . . . . . . . . 652.14.9 Final Color Processing . . . . . . . . . . . . . . . . . . . 663 Rasterization 683.1 Invariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.2 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703.2.1 Multisampling . . . . . . . . . . . . . . . . . . . . . . . 713.3 Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733.3.1 Basic Point Rasterization . . . . . . . . . . . . . . . . . . 743.3.2 Point Rasterization State . . . . . . . . . . . . . . . . . . 773.3.3 Point Multisample Rasterization . . . . . . . . . . . . . . 773.4 Line Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . 773.4.1 Basic Line Segment Rasterization . . . . . . . . . . . . . 783.4.2 Other Line Segment Features . . . . . . . . . . . . . . . . 803.4.3 Line Rasterization State . . . . . . . . . . . . . . . . . . 833.4.4 Line Multisample Rasterization . . . . . . . . . . . . . . 833.5 Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843.5.1 Basic Polygon Rasterization . . . . . . . . . . . . . . . . 843.5.2 Stippling . . . . . . . . . . . . . . . . . . . . . . . . . . 863.5.3 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . 873.5.4 Options Controlling Polygon Rasterization . . . . . . . . 873.5.5 Depth Offset . . . . . . . . . . . . . . . . . . . . . . . . 883.5.6 Polygon Multisample Rasterization . . . . . . . . . . . . 893.5.7 Polygon Rasterization State . . . . . . . . . . . . . . . . 903.6 Pixel Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.6.1 Pixel Storage Modes . . . . . . . . . . . . . . . . . . . . 903.6.2 The Imaging Subset . . . . . . . . . . . . . . . . . . . . 913.6.3 Pixel Transfer Modes . . . . . . . . . . . . . . . . . . . . 923.6.4 Rasterization of Pixel Rectangles . . . . . . . . . . . . . 1023.6.5 Pixel Transfer Operations . . . . . . . . . . . . . . . . . 113Version 1.5 - October 30, 2003 CONTENTS iii3.6.6 Pixel Rectangle Multisample Rasterization . . . . . . . . 1233.7 Bitmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233.8 Texturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1253.8.1 Texture Image Specification . . . . . . . . . . . . . . . . 1263.8.2 Alternate Texture Image Specification Commands . . . . 1353.8.3 Compressed Texture Images . . . . . . . . . . . . . . . . 1393.8.4 Texture Parameters . . . . . . . . . . . . . . . . . . . . . 1423.8.5 Depth Component Textures . . . . . . . . . . . . . . . . 1433.8.6 Cube Map Texture Selection . . . . . . . . . . . . . . . . 1433.8.7 Texture Wrap Modes . . . . . . . . . . . . . . . . . . . . 1453.8.8 Texture Minification . . . . . . . . . . . . . . . . . . . . 1473.8.9 Texture Magnification . . . . . . . . . . . . . . . . . . . 1533.8.10 Texture Completeness . . . . . . . . . . . . . . . . . . . 1533.8.11 Texture State and Proxy State . . . . . . . . . . . . . . . 1543.8.12 Texture Objects . . . . . . . . . . . . . . . . . . . . . . . 1563.8.13 Texture Environments and Texture Functions . . . . . . . 1583.8.14 Texture Comparison Modes . . . . . . . . . . . . . . . . 1643.8.15 Texture Application . . . . . . . . . . . . . . . . . . . . . 1643.9 Color Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673.10 Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673.11 Antialiasing Application . . . . . . . . . . . . . . . . . . . . . . 1693.12 Multisample Point Fade . . . . . . . . . . . . . . . . . . . . . . . 1694 Per-Fragment Operations and the Framebuffer 1704.1 Per-Fragment Operations . . . . . . . . . . . . . . . . . . . . . . 1714.1.1 Pixel Ownership Test . . . . . . . . . . . . . . . . . . . . 1714.1.2 Scissor Test . . . . . . . . . . . . . . . . . . . . . . . . . 1724.1.3 Multisample Fragment Operations . . . . . . . . . . . . . 1724.1.4 Alpha Test . . . . . . . . . . . . . . . . . . . . . . . . . 1734.1.5 Stencil Test . . . . . . . . . . . . . . . . . . . . . . . . . 1744.1.6 Depth Buffer Test . . . . . . . . . . . . . . . . . . . . . . 1754.1.7 Occlusion Queries . . . . . . . . . . . . . . . . . . . . . 1764.1.8 Blending . . . . . . . . . . . . . . . . . . . . . . . . . . 1774.1.9 Dithering . . . . . . . . . . . . . . . . . . . . . . . . . . 1804.1.10 Logical Operation . . . . . . . . . . . . . . . . . . . . . 1814.1.11 Additional Multisample Fragment Operations . . . . . . . 1814.2 Whole Framebuffer Operations . . . . . . . . . . . . . . . . . . . 1834.2.1 Selecting a Buffer for Writing . . . . . . . . . . . . . . . 1834.2.2 Fine Control of Buffer Updates . . . . . . . . . . . . . . 1844.2.3 Clearing the Buffers . . . . . . . . . . . . . . . . . . . . 185Version 1.5 - October 30, 2003 iv CONTENTS4.2.4 The Accumulation Buffer . . . . . . . . . . . . . . . . . 1874.3 Drawing, Reading, and Copying Pixels . . . . . . . . . . . . . . . 1884.3.1 Writing to the Stencil Buffer . . . . . . . . . . . . . . . . 1884.3.2 Reading Pixels . . . . . . . . . . . . . . . . . . . . . . . 1884.3.3 Copying Pixels . . . . . . . . . . . . . . . . . . . . . . . 1944.3.4 Pixel Draw/Read State . . . . . . . . . . . . . . . . . . . 1945 Special Functions 1965.1 Evaluators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965.2 Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2025.3 Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2045.4 Display Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2065.5 Flush and Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . 2115.6 Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2116 State and State Requests 2136.1 Querying GL State . . . . . . . . . . . . . . . . . . . . . . . . . 2136.1.1 Simple Queries . . . . . . . . . . . . . . . . . . . . . . . 2136.1.2 Data Conversions . . . . . . . . . . . . . . . . . . . . . . 2146.1.3 Enumerated Queries . . . . . . . . . . . . . . . . . . . . 2156.1.4 Texture Queries . . . . . . . . . . . . . . . . . . . . . . . 2176.1.5 Stipple Query . . . . . . . . . . . . . . . . . . . . . . . . 2186.1.6 Color Matrix Query . . . . . . . . . . . . . . . . . . . . . 2196.1.7 Color Table Query . . . . . . . . . . . . . . . . . . . . . 2196.1.8 Convolution Query . . . . . . . . . . . . . . . . . . . . . 2206.1.9 Histogram Query . . . . . . . . . . . . . . . . . . . . . . 2216.1.10 Minmax Query . . . . . . . . . . . . . . . . . . . . . . . 2216.1.11 Pointer and String Queries . . . . . . . . . . . . . . . . . 2226.1.12 Occlusion Queries . . . . . . . . . . . . . . . . . . . . . 2236.1.13 Buffer Object Queries . . . . . . . . . . . . . . . . . . . 2246.1.14 Saving and Restoring State . . . . . . . . . . . . . . . . . 2256.2 State Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229A Invariance 259A.1 Repeatability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259A.2 Multi-pass Algorithms . . . . . . . . . . . . . . . . . . . . . . . 260A.3 Invariance Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 260A.4 What All This Means . . . . . . . . . . . . . . . . . . . . . . . . 262B Corollaries 263Version 1.5 - October 30, 2003 CONTENTS vC Version 1.1 266C.1 Vertex Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266C.2 Polygon Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . 267C.3 Logical Operation . . . . . . . . . . . . . . . . . . . . . . . . . . 267C.4 Texture Image Formats . . . . . . . . . . . . . . . . . . . . . . . 267C.5 Texture Replace Environment . . . . . . . . . . . . . . . . . . . . 267C.6 Texture Proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . 268C.7 Copy Texture and Subtexture . . . . . . . . . . . . . . . . . . . . 268C.8 Texture Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 268C.9 Other Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . 268C.10 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 269D Version 1.2 271D.1 Three-Dimensional Texturing . . . . . . . . . . . . . . . . . . . . 271D.2 BGRA Pixel Formats . . . . . . . . . . . . . . . . . . . . . . . . 271D.3 Packed Pixel Formats . . . . . . . . . . . . . . . . . . . . . . . . 272D.4 Normal Rescaling . . . . . . . . . . . . . . . . . . . . . . . . . . 272D.5 Separate Specular Color . . . . . . . . . . . . . . . . . . . . . . 272D.6 Texture Coordinate Edge Clamping . . . . . . . . . . . . . . . . 272D.7 Texture Level of Detail Control . . . . . . . . . . . . . . . . . . . 273D.8 Vertex Array Draw Element Range . . . . . . . . . . . . . . . . . 273D.9 Imaging Subset . . . . . . . . . . . . . . . . . . . . . . . . . . . 273D.9.1 Color Tables . . . . . . . . . . . . . . . . . . . . . . . . 273D.9.2 Convolution . . . . . . . . . . . . . . . . . . . . . . . . . 274D.9.3 Color Matrix . . . . . . . . . . . . . . . . . . . . . . . . 274D.9.4 Pixel Pipeline Statistics . . . . . . . . . . . . . . . . . . . 275D.9.5 Constant Blend Color . . . . . . . . . . . . . . . . . . . . 275D.9.6 New Blending Equations . . . . . . . . . . . . . . . . . . 275D.10 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 275E Version 1.2.1 279F Version 1.3 280F.1 Compressed Textures . . . . . . . . . . . . . . . . . . . . . . . . 280F.2 Cube Map Textures . . . . . . . . . . . . . . . . . . . . . . . . . 280F.3 Multisample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281F.4 Multitexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281F.5 Texture Add Environment Mode . . . . . . . . . . . . . . . . . . 282F.6 Texture Combine Environment Mode . . . . . . . . . . . . . . . 282F.7 Texture Dot3 Environment Mode . . . . . . . . . . . . . . . . . . 282Version 1.5 - October 30, 2003 vi CONTENTSF.8 Texture Border Clamp . . . . . . . . . . . . . . . . . . . . . . . 282F.9 Transpose Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 283F.10 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 283G Version 1.4 288G.1 Automatic Mipmap Generation . . . . . . . . . . . . . . . . . . . 288G.2 Blend Squaring . . . . . . . . . . . . . . . . . . . . . . . . . . . 288G.3 Changes to the Imaging Subset . . . . . . . . . . . . . . . . . . . 289G.4 Depth Textures and Shadows . . . . . . . . . . . . . . . . . . . . 289G.5 Fog Coordinate . . . . . . . . . . . . . . . . . . . . . . . . . . . 289G.6 Multiple Draw Arrays . . . . . . . . . . . . . . . . . . . . . . . . 289G.7 Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 290G.8 Secondary Color . . . . . . . . . . . . . . . . . . . . . . . . . . 290G.9 Separate Blend Functions . . . . . . . . . . . . . . . . . . . . . . 290G.10 Stencil Wrap . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290G.11 Texture Crossbar Environment Mode . . . . . . . . . . . . . . . . 290G.12 Texture LOD Bias . . . . . . . . . . . . . . . . . . . . . . . . . . 291G.13 Texture Mirrored Repeat . . . . . . . . . . . . . . . . . . . . . . 291G.14 Window Raster Position . . . . . . . . . . . . . . . . . . . . . . 291G.15 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 291H Version 1.5 294H.1 Buffer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294H.2 Occlusion Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 295H.3 Shadow Functions . . . . . . . . . . . . . . . . . . . . . . . . . . 295H.4 Changed Tokens . . . . . . . . . . . . . . . . . . . . . . . . . . . 295H.5 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 295I ARB Extensions 300I.1 Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . 300I.2 Promoting Extensions to Core Features . . . . . . . . . . . . . . 301I.3 Multitexture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301I.4 Transpose Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 301I.5 Multisample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301I.6 Texture Add Environment Mode . . . . . . . . . . . . . . . . . . 301I.7 Cube Map Textures . . . . . . . . . . . . . . . . . . . . . . . . . 302I.8 Compressed Textures . . . . . . . . . . . . . . . . . . . . . . . . 302I.9 Texture Border Clamp . . . . . . . . . . . . . . . . . . . . . . . 302I.10 Point Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 302I.11 Vertex Blend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302Version 1.5 - October 30, 2003 CONTENTS viiI.12 Matrix Palette . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302I.13 Texture Combine Environment Mode . . . . . . . . . . . . . . . 303I.14 Texture Crossbar Environment Mode . . . . . . . . . . . . . . . . 303I.15 Texture Dot3 Environment Mode . . . . . . . . . . . . . . . . . . 303I.16 Texture Mirrored Repeat . . . . . . . . . . . . . . . . . . . . . . 303I.17 Depth Texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303I.18 Shadow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303I.19 Shadow Ambient . . . . . . . . . . . . . . . . . . . . . . . . . . 303I.20 Window Raster Position . . . . . . . . . . . . . . . . . . . . . . 304I.21 Low-Level Vertex Programming . . . . . . . . . . . . . . . . . . 304I.22 Low-Level Fragment Programming . . . . . . . . . . . . . . . . 304I.23 Buffer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304I.24 Occlusion Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 304I.25 Shader Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 304I.26 High-Level Vertex Programming . . . . . . . . . . . . . . . . . . 305I.27 High-Level Fragment Programming . . . . . . . . . . . . . . . . 305I.28 OpenGL Shading Language . . . . . . . . . . . . . . . . . . . . 305I.29 Non-Power-Of-Two Textures . . . . . . . . . . . . . . . . . . . . 305I.30 Point Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306Index of OpenGL Commands 307Version 1.5 - October 30, 2003 List of Figures2.1 Block diagram of the GL. . . . . . . . . . . . . . . . . . . . . . . 102.2 Creation of a processed vertex from a transformed vertex and cur-rent values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Primitive assembly and processing. . . . . . . . . . . . . . . . . . 132.4 Triangle strips, fans, and independent triangles. . . . . . . . . . . 162.5 Quadrilateral strips and independent quadrilaterals. . . . . . . . . 172.6 Vertex transformation sequence. . . . . . . . . . . . . . . . . . . 372.7 Current raster position. . . . . . . . . . . . . . . . . . . . . . . . 512.8 Processing of RGBA colors. . . . . . . . . . . . . . . . . . . . . 552.9 Processing of color indices. . . . . . . . . . . . . . . . . . . . . . 552.10 ColorMaterial operation. . . . . . . . . . . . . . . . . . . . . . . 623.1 Rasterization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.2 Rasterization of non-antialiased wide points. . . . . . . . . . . . . 753.3 Rasterization of antialiased wide points. . . . . . . . . . . . . . . 753.4 Visualization of Bresenham’s algorithm. . . . . . . . . . . . . . . 783.5 Rasterization of non-antialiased wide lines. . . . . . . . . . . . . 813.6 The region used in rasterizing an antialiased line segment. . . . . 823.7 Operation of DrawPixels. . . . . . . . . . . . . . . . . . . . . . 1023.8 Selecting a subimage from an image . . . . . . . . . . . . . . . . 1063.9 A bitmap and its associated parameters. . . . . . . . . . . . . . . 1243.10 A texture image and the coordinates used to access it. . . . . . . . 1333.11 Multitexture pipeline. . . . . . . . . . . . . . . . . . . . . . . . . 1664.1 Per-fragment operations. . . . . . . . . . . . . . . . . . . . . . . 1714.2 Operation of ReadPixels. . . . . . . . . . . . . . . . . . . . . . . 1884.3 Operation of CopyPixels. . . . . . . . . . . . . . . . . . . . . . . 1945.1 Map Evaluation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1985.2 Feedback syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . 207viii [...]... polynomial functions of input values The next stage operates on geometric primitives described by vertices: points, line segments, and polygons In this stage vertices are transformed and lit, and primitives are clipped to a viewing volume in preparation for the next stage, rasterization The rasterizer produces a series of framebuffer addresses and values using a two-dimensional description of a point, line... behavior implies that two distinct GL implementations may not agree pixel for pixel when presented with the same input even when run on identical framebuffer configurations Version 1.5 - October 30, 2003 6 CHAPTER 2 OPENGL OPERATION Finally, command names, constants, and types are prefixed in the GL (by gl, GL , and GL, respectively in C) to reduce name clashes with other packages The prefixes are omitted... Modes are set, primitives specified, and other GL operations described by sending commands in the form of function or procedure calls Primitives are defined by a group of one or more vertices A vertex defines a point, an endpoint of an edge, or a corner of a polygon where two edges meet Data (consisting of positional coordinates, colors, normals, and texture coordinates) are associated with a vertex and. .. names 296 Version 1.5 - October 30, 2003 Chapter 1 Introduction This document describes the OpenGL graphics system: what it is, how it acts, and what is required to implement it We assume that the reader has at least a rudimentary understanding of computer graphics This means familiarity with the essentials of computer graphics algorithms as well as familiarity with basic graphics. .. line and polygon primitives, clipping may insert new vertices into the primitive The vertices defining a primitive to be rasterized have texture coordinates and colors associated with them 2.6.1 Begin and End Objects Begin and End require one state variable with eleven values: one value for each of the ten possible Begin/End objects, and one other value indicating that no Begin/End object is being processed... TexCoord and MultiTexCoord, FogCoord), the ArrayElement command (see section 2.8), the EvalCoord and EvalPoint commands (see section 5.1), commands for specifying lighting material parameters (Material commands; see section 2.14.2), display list invocation commands (CallList and CallLists; see section 5.4), and the EdgeFlag command Executing any other GL command between the execution of Begin and the corresponding... Programmer’s View of OpenGL To the programmer, OpenGL is a set of commands that allow the specification of geometric objects in two or three dimensions, together with commands that control how these objects are rendered into the framebuffer For the most part, OpenGL provides an immediate-mode interface, meaning that specifying an object causes it to be drawn A typical program that uses OpenGL begins with calls... command) The GL provides direct control over the fundamental operations of 3D and 2D graphics This includes specification of such parameters as transformation matrices, lighting equation coefficients, antialiasing methods, and pixel update operators It does not provide a means for describing or modeling complex geometric objects Another way to describe this situation is to say that the GL provides mechanisms... each processed vertex of an assembled polygonal primitive must be augmented with a bit indicating whether or not the edge beginning on that vertex is boundary or non-boundary 2.6.3 GL Commands within Begin/End The only GL commands that are allowed within any Begin/End pairs are the commands for specifying vertex coordinates, vertex colors, normal coordinates, texture coordinates, and fog coordinates (Vertex,... lines and polygons to sophisticated floating-point processors capable of transforming and computing on geometric data The OpenGL implementor’s task is to provide the CPU software interface while dividing the work for each OpenGL command between the CPU and the graphics hardware This division must be tailored to the available graphics hardware to obtain optimum performance in carrying out OpenGL calls OpenGL . 2. OPENGL OPERATIONFinally, command names, constants, and types are prefixed in the GL (by gl,GL , and GL, respectively in C) to reduce name clashes with. interpretation of GL commands is client-server. That is, a pro-gram (the client) issues commands, and these commands are interpreted and pro-cessed by the GL (the

Ngày đăng: 03/11/2012, 11:23

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan