logo资料库

OpenGL3.3官方文档.pdf

第1页 / 共425页
第2页 / 共425页
第3页 / 共425页
第4页 / 共425页
第5页 / 共425页
第6页 / 共425页
第7页 / 共425页
第8页 / 共425页
资料共425页,剩余部分请下载后查看
1 Introduction
1.1 Formatting of the OpenGL Specification
1.2 What is the OpenGL Graphics System?
1.3 Programmer's View of OpenGL
1.4 Implementor's View of OpenGL
1.5 Our View
1.6 The Deprecation Model
1.7 Companion Documents
1.7.1 OpenGL Shading Language
1.7.2 Window System Bindings
2 OpenGL Operation
2.1 OpenGL Fundamentals
2.1.1 Floating-Point Computation
2.1.2 16-Bit Floating-Point Numbers
2.1.3 Unsigned 11-Bit Floating-Point Numbers
2.1.4 Unsigned 10-Bit Floating-Point Numbers
2.1.5 Fixed-Point Data Conversions
2.2 GL State
2.2.1 Shared Object State
2.3 GL Command Syntax
2.4 Basic GL Operation
2.5 GL Errors
2.6 Primitives and Vertices
2.6.1 Primitive Types
2.7 Vertex Specification
2.8 Vertex Arrays
2.8.1 Transferring Array Elements
2.8.2 Packed Vertex Data Formats
2.8.3 Drawing Commands
2.9 Buffer Objects
2.9.1 Creating and Binding Buffer Objects
2.9.2 Creating Buffer Object Data Stores
2.9.3 Mapping and Unmapping Buffer Data
2.9.4 Effects of Accessing Outside Buffer Bounds
2.9.5 Copying Between Buffers
2.9.6 Vertex Arrays in Buffer Objects
2.9.7 Array Indices in Buffer Objects
2.9.8 Buffer Object State
2.10 Vertex Array Objects
2.11 Vertex Shaders
2.11.1 Shader Objects
2.11.2 Program Objects
2.11.3 Vertex Attributes
2.11.4 Uniform Variables
2.11.5 Samplers
2.11.6 Varying Variables
2.11.7 Shader Execution
2.11.8 Required State
2.12 Geometry Shaders
2.12.1 Geometry Shader Input Primitives
2.12.2 Geometry Shader Output Primitives
2.12.3 Geometry Shader Variables
2.12.4 Geometry Shader Execution Environment
2.13 Coordinate Transformations
2.13.1 Controlling the Viewport
2.14 Asynchronous Queries
2.15 Conditional Rendering
2.16 Transform Feedback
2.17 Primitive Queries
2.18 Flatshading
2.19 Primitive Clipping
2.19.1 Clipping Shader Varying Outputs
3 Rasterization
3.1 Discarding Primitives Before Rasterization
3.2 Invariance
3.3 Antialiasing
3.3.1 Multisampling
3.4 Points
3.4.1 Basic Point Rasterization
3.4.2 Point Rasterization State
3.4.3 Point Multisample Rasterization
3.5 Line Segments
3.5.1 Basic Line Segment Rasterization
3.5.2 Other Line Segment Features
3.5.3 Line Rasterization State
3.5.4 Line Multisample Rasterization
3.6 Polygons
3.6.1 Basic Polygon Rasterization
3.6.2 Antialiasing
3.6.3 Options Controlling Polygon Rasterization
3.6.4 Depth Offset
3.6.5 Polygon Multisample Rasterization
3.6.6 Polygon Rasterization State
3.7 Pixel Rectangles
3.7.1 Pixel Storage Modes and Pixel Buffer Objects
3.7.2 Transfer of Pixel Rectangles
3.8 Texturing
3.8.1 Texture Objects
3.8.2 Sampler Objects
3.8.3 Texture Image Specification
3.8.4 Alternate Texture Image Specification Commands
3.8.5 Compressed Texture Images
3.8.6 Multisample Textures
3.8.7 Buffer Textures
3.8.8 Texture Parameters
3.8.9 Depth Component Textures
3.8.10 Cube Map Texture Selection
3.8.11 Texture Minification
3.8.12 Texture Magnification
3.8.13 Combined Depth/Stencil Textures
3.8.14 Texture Completeness
3.8.15 Texture State and Proxy State
3.8.16 Texture Comparison Modes
3.8.17 sRGB Texture Color Conversion
3.8.18 Shared Exponent Texture Color Conversion
3.9 Fragment Shaders
3.9.1 Shader Variables
3.9.2 Shader Execution
3.10 Antialiasing Application
3.11 Multisample Point Fade
4 Per-Fragment Operations and the Framebuffer
4.1 Per-Fragment Operations
4.1.1 Pixel Ownership Test
4.1.2 Scissor Test
4.1.3 Multisample Fragment Operations
4.1.4 Stencil Test
4.1.5 Depth Buffer Test
4.1.6 Occlusion Queries
4.1.7 Blending
4.1.8 sRGB Conversion
4.1.9 Dithering
4.1.10 Logical Operation
4.1.11 Additional Multisample Fragment Operations
4.2 Whole Framebuffer Operations
4.2.1 Selecting a Buffer for Writing
4.2.2 Fine Control of Buffer Updates
4.2.3 Clearing the Buffers
4.3 Reading and Copying Pixels
4.3.1 Reading Pixels
4.3.2 Copying Pixels
4.3.3 Pixel Draw/Read State
4.4 Framebuffer Objects
4.4.1 Binding and Managing Framebuffer Objects
4.4.2 Attaching Images to Framebuffer Objects
4.4.3 Feedback Loops Between Textures and the Framebuffer
4.4.4 Framebuffer Completeness
4.4.5 Effects of Framebuffer State on Framebuffer Dependent Values
4.4.6 Mapping between Pixel and Element in Attached Image
4.4.7 Layered Framebuffers
5 Special Functions
5.1 Timer Queries
5.2 Flush and Finish
5.3 Sync Objects and Fences
5.3.1 Waiting for Sync Objects
5.3.2 Signalling
5.4 Hints
6 State and State Requests
6.1 Querying GL State
6.1.1 Simple Queries
6.1.2 Data Conversions
6.1.3 Enumerated Queries
6.1.4 Texture Queries
6.1.5 Sampler Queries
6.1.6 String Queries
6.1.7 Asynchronous Queries
6.1.8 Sync Object Queries
6.1.9 Buffer Object Queries
6.1.10 Vertex Array Object Queries
6.1.11 Shader and Program Queries
6.1.12 Framebuffer Object Queries
6.1.13 Renderbuffer Object Queries
6.2 State Tables
A Invariance
A.1 Repeatability
A.2 Multi-pass Algorithms
A.3 Invariance Rules
A.4 What All This Means
B Corollaries
C Compressed Texture Image Formats
C.1 RGTC Compressed Texture Image Formats
C.1.1 Format COMPRESSED_RED_RGTC1
C.1.2 Format COMPRESSED_SIGNED_RED_RGTC1
C.1.3 Format COMPRESSED_RG_RGTC2
C.1.4 Format COMPRESSED_SIGNED_RG_RGTC2
D Shared Objects and Multiple Contexts
D.1 Object Deletion Behavior
D.1.1 Automatic Unbinding of Deleted Objects
D.1.2 Deleted Object and Object Name Lifetimes
D.2 Sync Objects and Multiple Contexts
D.3 Propagating Changes to Objects
D.3.1 Determining Completion of Changes to an object
D.3.2 Definitions
D.3.3 Rules
E Profiles and the Deprecation Model
E.1 Core and Compatibility Profiles
E.2 Deprecated and Removed Features
E.2.1 Deprecated But Still Supported Features
E.2.2 Removed Features
F Version 3.0 and Before
F.1 New Features
F.2 Deprecation Model
F.3 Changed Tokens
F.4 Change Log
F.5 Credits and Acknowledgements
G Version 3.1
G.1 New Features
G.2 Deprecation Model
G.3 Change Log
G.4 Credits and Acknowledgements
H Version 3.2
H.1 New Features
H.2 Deprecation Model
H.3 Changed Tokens
H.4 Change Log
H.5 Credits and Acknowledgements
I Version 3.3
I.1 New Features
I.2 Deprecation Model
I.3 Change Log
I.4 Credits and Acknowledgements
J Extension Registry, Header Files, and ARB Extensions
J.1 Extension Registry
J.2 Header Files
J.3 ARB Extensions
J.3.1 Naming Conventions
J.3.2 Promoting Extensions to Core Features
J.3.3 Multitexture
J.3.4 Transpose Matrix
J.3.5 Multisample
J.3.6 Texture Add Environment Mode
J.3.7 Cube Map Textures
J.3.8 Compressed Textures
J.3.9 Texture Border Clamp
J.3.10 Point Parameters
J.3.11 Vertex Blend
J.3.12 Matrix Palette
J.3.13 Texture Combine Environment Mode
J.3.14 Texture Crossbar Environment Mode
J.3.15 Texture Dot3 Environment Mode
J.3.16 Texture Mirrored Repeat
J.3.17 Depth Texture
J.3.18 Shadow
J.3.19 Shadow Ambient
J.3.20 Window Raster Position
J.3.21 Low-Level Vertex Programming
J.3.22 Low-Level Fragment Programming
J.3.23 Buffer Objects
J.3.24 Occlusion Queries
J.3.25 Shader Objects
J.3.26 High-Level Vertex Programming
J.3.27 High-Level Fragment Programming
J.3.28 OpenGL Shading Language
J.3.29 Non-Power-Of-Two Textures
J.3.30 Point Sprites
J.3.31 Fragment Program Shadow
J.3.32 Multiple Render Targets
J.3.33 Rectangular Textures
J.3.34 Floating-Point Color Buffers
J.3.35 Half-Precision Floating Point
J.3.36 Floating-Point Textures
J.3.37 Pixel Buffer Objects
J.3.38 Floating-Point Depth Buffers
J.3.39 Instanced Rendering
J.3.40 Framebuffer Objects
J.3.41 sRGB Framebuffers
J.3.42 Geometry Shaders
J.3.43 Half-Precision Vertex Data
J.3.44 Instanced Rendering
J.3.45 Flexible Buffer Mapping
J.3.46 Texture Buffer Objects
J.3.47 RGTC Texture Compression Formats
J.3.48 One- and Two-Component Texture Formats
J.3.49 Vertex Array Objects
J.3.50 Versioned Context Creation
J.3.51 Uniform Buffer Objects
J.3.52 Restoration of features removed from OpenGL 3.0
J.3.53 Fast Buffer-to-Buffer Copies
J.3.54 Shader Texture Level of Detail Control
J.3.55 Depth Clamp Control
J.3.56 Base Vertex Offset Drawing Commands
J.3.57 Fragment Coordinate Convention Control
J.3.58 Provoking Vertex Control
J.3.59 Seamless Cube Maps
J.3.60 Fence Sync Objects
J.3.61 Multisample Textures
J.3.62 BGRA Attribute Component Ordering
J.3.63 Per-Buffer Blend Control
J.3.64 Sample Shading Control
J.3.65 Cube Map Array Textures
J.3.66 Texture Gather
J.3.67 Texture Level-Of-Detail Queries
J.3.68 Profiled Context Creation
J.3.69 Shading Language Include
J.3.70 BPTC texture compression
J.3.71 Extended Blend Functions
J.3.72 Explicit Attribute Location
J.3.73 Boolean Occlusion Queries
J.3.74 Sampler Objects
J.3.75 Shader Bit Encoding
J.3.76 RGB10A2 Integer Textures
J.3.77 Texture Swizzle
J.3.78 Timer Queries
J.3.79 Packed 2.10.10.10 Vertex Formats
The OpenGL R Graphics System: (Version 3.3 (Core Profile) - March 11, 2010) A Specification Mark Segal Kurt Akeley Editor (version 1.1): Chris Frazier Editor (versions 1.2-3.3): Jon Leech Editor (version 2.0): Pat Brown
Copyright c 2006-2010 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 International.
Contents 1 Introduction 1.1 Formatting of the OpenGL Specification . . . . . . . . . . . . . . 1.2 What is the OpenGL Graphics System? . . . . . . . . . . . . . . 1.3 Programmer’s View of OpenGL . . . . . . . . . . . . . . . . . . 1.4 Implementor’s View of OpenGL . . . . . . . . . . . . . . . . . . 1.5 Our View . . . . . . . . . . . . . . . . . . . . . . . . 1.6 The Deprecation Model . . . . . . . . . . . . . . . . . . . . . . . 1.7 Companion Documents . . . . . . . . . . . . . . . . . . . . . . . 1.7.1 OpenGL Shading Language . . . . . . . . . . . . . . . . 1.7.2 Window System Bindings . . . . . . . . . . . . . . . . . . . . . . . 2 OpenGL Operation . . . . . 2.2.1 2.2 GL State . 2.1 OpenGL Fundamentals . . . . . . . . . . . . . . . . . . . . . . . Floating-Point Computation . . . . . . . . . . . . . . . . 2.1.1 2.1.2 16-Bit Floating-Point Numbers . . . . . . . . . . . . . . 2.1.3 Unsigned 11-Bit Floating-Point Numbers . . . . . . . . . 2.1.4 Unsigned 10-Bit Floating-Point Numbers . . . . . . . . . Fixed-Point Data Conversions . . . . . . . . . . . . . . . 2.1.5 . . . . . . . . . . . . . . . . . . . . . . . . . Shared Object State . . . . . . . . . . . . . . . . . . . . . 2.3 GL Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Basic GL Operation . . 2.5 GL Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 2.6 Primitives and Vertices . . . . . . . . . . . . . . . . . . . . . . . Primitive Types . . . . . . . . . . . . . . . . . . . . . . . 2.7 Vertex Specification . . . . . . . . . . . . . . . . . . . . . . . . . 2.8 Vertex Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . 2.8.1 Transferring Array Elements . . . . . . . . . . . . . . . . 2.8.2 Packed Vertex Data Formats . . . . . . . . . . . . . . . . 2.6.1 . . . . . . 1 1 1 1 2 2 3 3 3 3 5 5 7 8 8 9 10 12 13 13 15 18 19 21 26 28 31 32 i
CONTENTS ii . . 2.9 Buffer Objects . 32 2.8.3 Drawing Commands . . . . . . . . . . . . . . . . . . . . 37 . . . . . . . . . . . . . . . . . . . . . . . . . . 38 . . . . . . . . . . . 2.9.1 Creating and Binding Buffer Objects 40 . . . . . . . . . . . . 2.9.2 Creating Buffer Object Data Stores 42 2.9.3 Mapping and Unmapping Buffer Data . . . . . . . . . . . 47 2.9.4 Effects of Accessing Outside Buffer Bounds . . . . . . . 47 2.9.5 Copying Between Buffers . . . . . . . . . . . . . . . . . 48 2.9.6 Vertex Arrays in Buffer Objects . . . . . . . . . . . . . . 48 2.9.7 Array Indices in Buffer Objects . . . . . . . . . . . . . . 49 2.9.8 Buffer Object State . . . . . . . . . . . . . . . . . . . . . 49 2.10 Vertex Array Objects . . . . . . . . . . . . . . . . . . . . . . . . 50 . . . . . . . . . . . . . . . . . . . . . . . . . . 2.11 Vertex Shaders 51 2.11.1 Shader Objects . . . . . . . . . . . . . . . . . . . . . . . 52 2.11.2 Program Objects . . . . . . . . . . . . . . . . . . . . . . 55 2.11.3 Vertex Attributes . . . . . . . . . . . . . . . . . . . . . . 58 2.11.4 Uniform Variables . . . . . . . . . . . . . . . . . . . . . 74 2.11.5 Samplers . . . . . . . . . . . . . . . . . . . . . . . . . . 75 2.11.6 Varying Variables . . . . . . . . . . . . . . . . . . . . . . 77 2.11.7 Shader Execution . . . . . . . . . . . . . . . . . . . . . . 83 2.11.8 Required State . . . . . . . . . . . . . . . . . . . . . . . 84 2.12 Geometry Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . 85 2.12.1 Geometry Shader Input Primitives . . . . . . . . . . . . . 86 2.12.2 Geometry Shader Output Primitives . . . . . . . . . . . . 87 2.12.3 Geometry Shader Variables . . . . . . . . . . . . . . . . . 88 2.12.4 Geometry Shader Execution Environment . . . . . . . . . 92 . . . . . . . . . . . . . . . . . . . . 92 2.13.1 Controlling the Viewport . . . . . . . . . . . . . . . . . . 93 2.14 Asynchronous Queries . . . . . . . . . . . . . . . . . . . . . . . 95 2.15 Conditional Rendering . . . . . . . . . . . . . . . . . . . . . . . 96 2.16 Transform Feedback . . . . . . . . . . . . . . . . . . . . . . . . 99 2.17 Primitive Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 2.18 Flatshading . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 2.19 Primitive Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . 100 . . . . . . . . . . . . . 103 2.19.1 Clipping Shader Varying Outputs 2.13 Coordinate Transformations . . 3 Rasterization 104 3.1 Discarding Primitives Before Rasterization . . . . . . . . . . . . 105 3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . 105 . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 3.3 Antialiasing . 3.3.1 Multisampling . . . . . . . . . . . . . . . . . . . . . . . 107 Invariance . . . . . OpenGL 3.3 (Core Profile) - March 11, 2010
CONTENTS iii . . . . . . . . 3.6 Polygons 3.4 Points . . . 3.8 Texturing . 3.5 Line Segments 3.7 Pixel Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 3.4.1 Basic Point Rasterization . . . . . . . . . . . . . . . . . . 110 Point Rasterization State . . . . . . . . . . . . . . . . . . 110 3.4.2 3.4.3 Point Multisample Rasterization . . . . . . . . . . . . . . 111 . . . . . . . . . . . . . . . . . . . . . . . . . . 111 3.5.1 Basic Line Segment Rasterization . . . . . . . . . . . . . 111 3.5.2 Other Line Segment Features . . . . . . . . . . . . . . . . 114 3.5.3 Line Rasterization State . . . . . . . . . . . . . . . . . . 114 3.5.4 Line Multisample Rasterization . . . . . . . . . . . . . . 114 . . . . . . . . . . . . . . . . . . . . . . . . . . 115 3.6.1 Basic Polygon Rasterization . . . . . . . . . . . . . . . . 116 3.6.2 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . 118 3.6.3 Options Controlling Polygon Rasterization . . . . . . . . 118 3.6.4 Depth Offset . . . . . . . . . . . . . . . . . . . . . . . . 119 Polygon Multisample Rasterization . . . . . . . . . . . . 120 3.6.5 . . . . . . . . . . . . . . . . 121 Polygon Rasterization State 3.6.6 . . . . . . . . . . . . . . . . . . . . . . . . . . 121 3.7.1 Pixel Storage Modes and Pixel Buffer Objects . . . . . . . 121 3.7.2 Transfer of Pixel Rectangles . . . . . . . . . . . . . . . . 122 . . . . . . . . . . . . . . . . . . . . . . . . . . 134 3.8.1 Texture Objects . . . . . . . . . . . . . . . . . . . . . . . 135 3.8.2 . . . . . . . . . . . . . . . . . . . . . . 137 3.8.3 Texture Image Specification . . . . . . . . . . . . . . . . 139 3.8.4 Alternate Texture Image Specification Commands . . . . 151 3.8.5 Compressed Texture Images . . . . . . . . . . . . . . . . 158 3.8.6 Multisample Textures . . . . . . . . . . . . . . . . . . . . 162 3.8.7 Buffer Textures . . . . . . . . . . . . . . . . . . . . . . . 163 3.8.8 Texture Parameters . . . . . . . . . . . . . . . . . . . . . 166 3.8.9 Depth Component Textures . . . . . . . . . . . . . . . . 168 3.8.10 Cube Map Texture Selection . . . . . . . . . . . . . . . . 168 3.8.11 Texture Minification . . . . . . . . . . . . . . . . . . . . 170 3.8.12 Texture Magnification . . . . . . . . . . . . . . . . . . . 179 3.8.13 Combined Depth/Stencil Textures . . . . . . . . . . . . . 179 3.8.14 Texture Completeness . . . . . . . . . . . . . . . . . . . 179 . . . . . . . . . . . . . . . 181 3.8.15 Texture State and Proxy State 3.8.16 Texture Comparison Modes . . . . . . . . . . . . . . . . 183 3.8.17 sRGB Texture Color Conversion . . . . . . . . . . . . . . 183 3.8.18 Shared Exponent Texture Color Conversion . . . . . . . . 184 3.9 Fragment Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Shader Variables . . . . . . . . . . . . . . . . . . . . . . 185 Sampler Objects 3.9.1 . . . OpenGL 3.3 (Core Profile) - March 11, 2010
CONTENTS iv 3.9.2 Shader Execution . . . . . . . . . . . . . . . . . . . . . . 186 3.10 Antialiasing Application . . . . . . . . . . . . . . . . . . . . . . 192 3.11 Multisample Point Fade . . . . . . . . . . . . . . . . . . . . . . . 192 4 Per-Fragment Operations and the Framebuffer Stencil Test 193 4.1 Per-Fragment Operations . . . . . . . . . . . . . . . . . . . . . . 194 Pixel Ownership Test . . . . . . . . . . . . . . . . . . . . 195 4.1.1 Scissor Test . . . . . . . . . . . . . . . . . . . . . . . . . 195 4.1.2 4.1.3 Multisample Fragment Operations . . . . . . . . . . . . . 196 4.1.4 . . . . . . . . . . . . . . . . . . . . . . . . . 198 4.1.5 Depth Buffer Test . . . . . . . . . . . . . . . . . . . . . . 199 4.1.6 Occlusion Queries . . . . . . . . . . . . . . . . . . . . . 200 4.1.7 Blending . . . . . . . . . . . . . . . . . . . . . . . . . . 201 4.1.8 sRGB Conversion . . . . . . . . . . . . . . . . . . . . . 207 4.1.9 Dithering . . . . . . . . . . . . . . . . . . . . . . . . . . 207 4.1.10 Logical Operation . . . . . . . . . . . . . . . . . . . . . 208 4.1.11 Additional Multisample Fragment Operations . . . . . . . 209 4.2 Whole Framebuffer Operations . . . . . . . . . . . . . . . . . . . 210 Selecting a Buffer for Writing . . . . . . . . . . . . . . . 210 . . . . . . . . . . . . . . 214 Fine Control of Buffer Updates . . . . . . . . . . . . . . . . . . . . 216 . . . . . . . . . . . . . . . . . . . . 218 4.3.1 Reading Pixels . . . . . . . . . . . . . . . . . . . . . . . 218 4.3.2 Copying Pixels . . . . . . . . . . . . . . . . . . . . . . . 225 Pixel Draw/Read State . . . . . . . . . . . . . . . . . . . 228 4.3.3 . . . . . . . . . . . . . . . . . . . . . . . . 228 4.4.1 Binding and Managing Framebuffer Objects . . . . . . . . 228 4.4.2 Attaching Images to Framebuffer Objects . . . . . . . . . 231 Feedback Loops Between Textures and the Framebuffer 4.4.3 . 239 4.4.4 Framebuffer Completeness . . . . . . . . . . . . . . . . . 242 4.4.5 Effects of Framebuffer State on Framebuffer Dependent 4.2.1 4.2.2 4.2.3 Clearing the Buffers 4.3 Reading and Copying Pixels 4.4 Framebuffer Objects . Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 4.4.6 Mapping between Pixel and Element in Attached Image . 247 4.4.7 Layered Framebuffers . . . . . . . . . . . . . . . . . . . 248 5 Special Functions 250 5.1 Timer Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 5.2 Flush and Finish . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 5.3 Sync Objects and Fences . . . . . . . . . . . . . . . . . . . . . . 251 5.3.1 Waiting for Sync Objects . . . . . . . . . . . . . . . . . . 253 OpenGL 3.3 (Core Profile) - March 11, 2010
CONTENTS 5.3.2 5.4 Hints . Signalling . . . . . . . . . . . . . . . . . . . . . . . . . . 255 . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 . . . . . v 6 State and State Requests Sampler Queries String Queries 257 6.1 Querying GL State . . . . . . . . . . . . . . . . . . . . . . . . . 257 6.1.1 Simple Queries . . . . . . . . . . . . . . . . . . . . . . . 257 6.1.2 Data Conversions . . . . . . . . . . . . . . . . . . . . . . 258 6.1.3 Enumerated Queries . . . . . . . . . . . . . . . . . . . . 259 6.1.4 Texture Queries . . . . . . . . . . . . . . . . . . . . . . . 261 . . . . . . . . . . . . . . . . . . . . . . 263 6.1.5 6.1.6 . . . . . . . . . . . . . . . . . . . . . . . 264 6.1.7 Asynchronous Queries . . . . . . . . . . . . . . . . . . . 266 Sync Object Queries . . . . . . . . . . . . . . . . . . . . 267 6.1.8 6.1.9 Buffer Object Queries . . . . . . . . . . . . . . . . . . . 268 6.1.10 Vertex Array Object Queries . . . . . . . . . . . . . . . . 270 6.1.11 Shader and Program Queries . . . . . . . . . . . . . . . . 270 6.1.12 Framebuffer Object Queries . . . . . . . . . . . . . . . . 275 6.1.13 Renderbuffer Object Queries . . . . . . . . . . . . . . . . 277 . . . . . . . . . . . . . . . . . . . . . . . . . . 278 6.2 State Tables . . . A Invariance 326 . . . . . . . . . . . . . . . . . . . . . . . . . . 326 A.1 Repeatability . . . . . . . . . . . . . . . . . . . . . . . . 327 A.2 Multi-pass Algorithms A.3 Invariance Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 A.4 What All This Means . . . . . . . . . . . . . . . . . . . . . . . . 328 . B Corollaries 330 C Compressed Texture Image Formats C.1 RGTC Compressed Texture Image Formats 332 . . . . . . . . . . . . 332 C.1.1 Format COMPRESSED_RED_RGTC1 . . . . . . . . . . . . 333 C.1.2 Format COMPRESSED_SIGNED_RED_RGTC1 . . . . . . . 334 C.1.3 Format COMPRESSED_RG_RGTC2 . . . . . . . . . . . . . 334 C.1.4 Format COMPRESSED_SIGNED_RG_RGTC2 . . . . . . . . 335 D Shared Objects and Multiple Contexts 336 D.1 Object Deletion Behavior . . . . . . . . . . . . . . . . . . . . . . 336 D.1.1 Automatic Unbinding of Deleted Objects . . . . . . . . . 336 D.1.2 Deleted Object and Object Name Lifetimes . . . . . . . . 337 D.2 Sync Objects and Multiple Contexts . . . . . . . . . . . . . . . . 337 OpenGL 3.3 (Core Profile) - March 11, 2010
CONTENTS vi D.3 Propagating Changes to Objects . . . . . . . . . . . . . . . . . . 338 D.3.1 Determining Completion of Changes to an object . . . . . 338 . . . . . . . . . . . . . . . . . . . . . . . . . 339 D.3.2 Definitions D.3.3 Rules . . . . . . . . . . . . . . . . . . . . . . 339 . . . . . . 341 E Profiles and the Deprecation Model E.1 Core and Compatibility Profiles . . . . . . . . . . . . . . . . . . 342 E.2 Deprecated and Removed Features . . . . . . . . . . . . . . . . . 342 E.2.1 Deprecated But Still Supported Features . . . . . . . . . . 342 E.2.2 Removed Features . . . . . . . . . . . . . . . . . . . . . 343 F Version 3.0 and Before F.1 New Features . . F.2 Deprecation Model F.3 Changed Tokens . F.4 Change Log . . F.5 Credits and Acknowledgements 348 . . . . . . . . . . . . . . . . . . . . . . . . . . 348 . . . . . . . . . . . . . . . . . . . . . . . . . 349 . . . . . . . . . . . . . . . . . . . . . . . . . . 350 . . . . . . . . . . . . . . . . . . . . . . . . . . 350 . . . . . . . . . . . . . . . . . . 352 . G Version 3.1 G.1 New Features . . G.2 Deprecation Model G.3 Change Log . . G.4 Credits and Acknowledgements 355 . . . . . . . . . . . . . . . . . . . . . . . . . . 355 . . . . . . . . . . . . . . . . . . . . . . . . . 356 . . . . . . . . . . . . . . . . . . . . . . . . . . 356 . . . . . . . . . . . . . . . . . . 357 . H Version 3.2 H.1 New Features . . H.2 Deprecation Model H.3 Changed Tokens . H.4 Change Log . . H.5 Credits and Acknowledgements 360 . . . . . . . . . . . . . . . . . . . . . . . . . . 360 . . . . . . . . . . . . . . . . . . . . . . . . . 361 . . . . . . . . . . . . . . . . . . . . . . . . . . 361 . . . . . . . . . . . . . . . . . . . . . . . . . . 362 . . . . . . . . . . . . . . . . . . 364 . I Version 3.3 I.1 New Features . . I.2 Deprecation Model I.3 Change Log . . I.4 Credits and Acknowledgements 366 . . . . . . . . . . . . . . . . . . . . . . . . . . 366 . . . . . . . . . . . . . . . . . . . . . . . . . 367 . . . . . . . . . . . . . . . . . . . . . . . . . . 368 . . . . . . . . . . . . . . . . . . 368 . J Extension Registry, Header Files, and ARB Extensions 370 J.1 Extension Registry . . . . . . . . . . . . . . . . . . . . . . . . . 370 . . . . . . . . . . . . . . . . . . . . . . . . . . 370 J.2 Header Files . . J.3 ARB Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . 371 . OpenGL 3.3 (Core Profile) - March 11, 2010
分享到:
收藏