
The OpenGL R Graphics System: A Specification (Version 3.0 - September 23, 2008) Mark Segal Kurt Akeley Editor (version 1.1): Chris Frazier Editor (versions 1.2-3.0): Jon Leech Editor (version 2.0): Pat Brown Copyright c 2006-2008 The Khronos Group Inc. All Rights Reserved. This specification is protected by copyright laws and contains material proprietary to the Khronos Group, Inc. It or any components may not be reproduced, repub- lished, distributed, transmitted, displayed, broadcast or otherwise exploited in any manner without the express prior written permission of Khronos Group. You may use this specification for implementing the functionality therein, without altering or removing any trademark, copyright or other notice from the specification, but the receipt or possession of this specification does not convey any rights to reproduce, disclose, or distribute its contents, or to manufacture, use, or sell anything that it may describe, in whole or in part. Khronos Group grants express permission to any current Promoter, Contributor or Adopter member of Khronos to copy and redistribute UNMODIFIED versions of this specification in any fashion, provided that NO CHARGE is made for the specification and the latest available update of the specification for any version of the API is used whenever possible. Such distributed specification may be re- formatted AS LONG AS the contents of the specification are not changed in any way. The specification may be incorporated into a product that is sold as long as such product includes significant independent work developed by the seller. A link to the current version of this specification on the Khronos Group web-site should be included whenever possible with specification distributions. Khronos Group makes no, and expressly disclaims any, representations or war- ranties, express or implied, regarding this specification, including, without limita- tion, any implied warranties of merchantability or fitness for a particular purpose or non-infringement of any intellectual property. Khronos Group makes no, and expressly disclaims any, warranties, express or implied, regarding the correctness, accuracy, completeness, timeliness, and reliability of the specification. Under no circumstances will the Khronos Group, or any of its Promoters, Contributors or Members or their respective partners, officers, directors, employees, agents or rep- resentatives be liable for any damages, whether direct, indirect, special or conse- quential damages for lost revenues, lost profits, or otherwise, arising from or in connection with these materials. Khronos is a trademark of The Khronos Group Inc. OpenGL is a registered trade- mark, and OpenGL ES is a trademark, of Silicon Graphics, Inc. Contents 1 Introduction1 1.1 Formatting of Optional Features . .1 1.2 What is the OpenGL Graphics System? . .1 1.3 Programmer’s View of OpenGL . .2 1.4 Implementor’s View of OpenGL . .2 1.5 Our View . .3 1.6 The Deprecation Model . .3 1.7 Companion Documents . .3 1.7.1 OpenGL Shading Language . .3 1.7.2 Window System Bindings . .3 2 OpenGL Operation5 2.1 OpenGL Fundamentals . .5 2.1.1 Floating-Point Computation . .7 2.1.2 16-Bit Floating-Point Numbers . .8 2.1.3 Unsigned 11-Bit Floating-Point Numbers . .9 2.1.4 Unsigned 10-Bit Floating-Point Numbers . .9 2.2 GL State . 10 2.2.1 Shared Object State . 11 2.3 GL Command Syntax . 11 2.4 Basic GL Operation . 13 2.5 GL Errors . 15 2.6 Begin/End Paradigm . 16 2.6.1 Begin and End . 19 2.6.2 Polygon Edges . 23 2.6.3 GL Commands within Begin/End ............. 24 2.7 Vertex Specification . 24 2.8 Vertex Arrays . 28 2.9 Buffer Objects . 38 i CONTENTS ii 2.9.1 Mapping and Unmapping Buffer Data . 42 2.9.2 Vertex Arrays in Buffer Objects . 46 2.9.3 Array Indices in Buffer Objects . 47 2.9.4 Buffer Object State . 47 2.10 Vertex Array Objects . 48 2.11 Rectangles . 49 2.12 Coordinate Transformations . 49 2.12.1 Controlling the Viewport . 51 2.12.2 Matrices . 52 2.12.3 Normal Transformation . 57 2.12.4 Generating Texture Coordinates . 59 2.13 Asynchronous Queries . 61 2.14 Conditional Rendering . 63 2.15 Transform Feedback . 64 2.16 Primitive Queries . 67 2.17 Clipping . 68 2.18 Current Raster Position . 70 2.19 Colors and Coloring . 73 2.19.1 Lighting . 75 2.19.2 Lighting Parameter Specification . 80 2.19.3 ColorMaterial ....................... 84 2.19.4 Lighting State . 84 2.19.5 Color Index Lighting . 85 2.19.6 Clamping or Masking . 86 2.19.7 Flatshading . 86 2.19.8 Color and Associated Data Clipping . 87 2.19.9 Final Color Processing . 88 2.20 Vertex Shaders . 88 2.20.1 Shader Objects . 89 2.20.2 Program Objects . 90 2.20.3 Shader Variables . 92 2.20.4 Shader Execution . 104 2.20.5 Required State . 110 3 Rasterization 112 3.1 Discarding Primitives Before Rasterization . 114 3.2 Invariance . 114 3.3 Antialiasing . 114 3.3.1 Multisampling . 115 3.4 Points . 117 Version 3.0 (September 23, 2008) CONTENTS iii 3.4.1 Basic Point Rasterization . 119 3.4.2 Point Rasterization State . 123 3.4.3 Point Multisample Rasterization . 123 3.5 Line Segments . 123 3.5.1 Basic Line Segment Rasterization . 124 3.5.2 Other Line Segment Features . 126 3.5.3 Line Rasterization State . 129 3.5.4 Line Multisample Rasterization . 129 3.6 Polygons . 130 3.6.1 Basic Polygon Rasterization . 130 3.6.2 Stippling . 132 3.6.3 Antialiasing . 133 3.6.4 Options Controlling Polygon Rasterization . 133 3.6.5 Depth Offset . 134 3.6.6 Polygon Multisample Rasterization . 135 3.6.7 Polygon Rasterization State . 136 3.7 Pixel Rectangles . 136 3.7.1 Pixel Storage Modes and Pixel Buffer Objects . 136 3.7.2 The Imaging Subset . 138 3.7.3 Pixel Transfer Modes . 138 3.7.4 Rasterization of Pixel Rectangles . 149 3.7.5 Pixel Transfer Operations . 163 3.7.6 Pixel Rectangle Multisample Rasterization . 173 3.8 Bitmaps . 174 3.9 Texturing . 176 3.9.1 Texture Image Specification . 177 3.9.2 Alternate Texture Image Specification Commands . 192 3.9.3 Compressed Texture Images . 197 3.9.4 Texture Parameters . 201 3.9.5 Depth Component Textures . 203 3.9.6 Cube Map Texture Selection . 203 3.9.7 Texture Minification . 204 3.9.8 Texture Magnification . 213 3.9.9 Combined Depth/Stencil Textures . 213 3.9.10 Texture Completeness . 213 3.9.11 Texture State and Proxy State . 215 3.9.12 Texture Objects . 216 3.9.13 Texture Environments and Texture Functions . 219 3.9.14 Texture Comparison Modes . 222 3.9.15 sRGB Texture Color Conversion . 225 Version 3.0 (September 23, 2008) CONTENTS iv 3.9.16 Shared Exponent Texture Color Conversion . 227 3.9.17 Texture Application . 227 3.10 Color Sum . 228 3.11 Fog . 230 3.12 Fragment Shaders . 231 3.12.1 Shader Variables . 232 3.12.2 Shader Execution . 233 3.13 Antialiasing Application . 237 3.14 Multisample Point Fade . 237 4 Per-Fragment Operations and the Framebuffer 239 4.1 Per-Fragment Operations . 241 4.1.1 Pixel Ownership Test . 241 4.1.2 Scissor Test . 242 4.1.3 Multisample Fragment Operations . 242 4.1.4 Alpha Test . 243 4.1.5 Stencil Test . 244 4.1.6 Depth Buffer Test . 246 4.1.7 Occlusion Queries . 246 4.1.8 Blending . 247 4.1.9 sRGB Conversion . 252 4.1.10 Dithering . 252 4.1.11 Logical Operation . 253 4.1.12 Additional Multisample Fragment Operations . 254 4.2 Whole Framebuffer Operations . 255 4.2.1 Selecting a Buffer for Writing . 255 4.2.2 Fine Control of Buffer Updates . ..
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages510 Page
-
File Size-