没有合适的资源?快使用搜索试试~ 我知道了~
OpenGL3.3规范文档
1星 需积分: 40 22 下载量 60 浏览量
2018-09-21
22:33:06
上传
评论
收藏 2.5MB PDF 举报
温馨提示
试读
425页
OpenGL 函数都遵循一个命名约定,通过这个约定可以了解函数来源于哪个库,需要多少个参数以及参数的类型。以上是OpenGL3.3版本的基本规范。目前主要是依照3.3版本的规范而使用的。
资源推荐
资源详情
资源评论
The OpenGL
R
Graphics System:
A Specification
(Version 3.3 (Core Profile) - March 11, 2010)
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.1 Formatting of the OpenGL Specification . . . . . . . . . . . . . . 1
1.2 What is the OpenGL Graphics System? . . . . . . . . . . . . . . 1
1.3 Programmer’s View of OpenGL . . . . . . . . . . . . . . . . . . 1
1.4 Implementor’s View of OpenGL . . . . . . . . . . . . . . . . . . 2
1.5 Our View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
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 Operation 5
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 . . . . . . . . . 8
2.1.4 Unsigned 10-Bit Floating-Point Numbers . . . . . . . . . 9
2.1.5 Fixed-Point Data Conversions . . . . . . . . . . . . . . . 10
2.2 GL State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.1 Shared Object State . . . . . . . . . . . . . . . . . . . . . 13
2.3 GL Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Basic GL Operation . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.5 GL Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.6 Primitives and Vertices . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.1 Primitive Types . . . . . . . . . . . . . . . . . . . . . . . 21
2.7 Vertex Specification . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.8 Vertex Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.8.1 Transferring Array Elements . . . . . . . . . . . . . . . . 31
2.8.2 Packed Vertex Data Formats . . . . . . . . . . . . . . . . 32
i
CONTENTS ii
2.8.3 Drawing Commands . . . . . . . . . . . . . . . . . . . . 32
2.9 Buffer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.9.1 Creating and Binding Buffer Objects . . . . . . . . . . . 38
2.9.2 Creating Buffer Object Data Stores . . . . . . . . . . . . 40
2.9.3 Mapping and Unmapping Buffer Data . . . . . . . . . . . 42
2.9.4 Effects of Accessing Outside Buffer Bounds . . . . . . . 47
2.9.5 Copying Between Buffers . . . . . . . . . . . . . . . . . 47
2.9.6 Vertex Arrays in Buffer Objects . . . . . . . . . . . . . . 48
2.9.7 Array Indices in Buffer Objects . . . . . . . . . . . . . . 48
2.9.8 Buffer Object State . . . . . . . . . . . . . . . . . . . . . 49
2.10 Vertex Array Objects . . . . . . . . . . . . . . . . . . . . . . . . 49
2.11 Vertex Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.11.1 Shader Objects . . . . . . . . . . . . . . . . . . . . . . . 51
2.11.2 Program Objects . . . . . . . . . . . . . . . . . . . . . . 52
2.11.3 Vertex Attributes . . . . . . . . . . . . . . . . . . . . . . 55
2.11.4 Uniform Variables . . . . . . . . . . . . . . . . . . . . . 58
2.11.5 Samplers . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.11.6 Varying Variables . . . . . . . . . . . . . . . . . . . . . . 75
2.11.7 Shader Execution . . . . . . . . . . . . . . . . . . . . . . 77
2.11.8 Required State . . . . . . . . . . . . . . . . . . . . . . . 83
2.12 Geometry Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . 84
2.12.1 Geometry Shader Input Primitives . . . . . . . . . . . . . 85
2.12.2 Geometry Shader Output Primitives . . . . . . . . . . . . 86
2.12.3 Geometry Shader Variables . . . . . . . . . . . . . . . . . 87
2.12.4 Geometry Shader Execution Environment . . . . . . . . . 88
2.13 Coordinate Transformations . . . . . . . . . . . . . . . . . . . . 92
2.13.1 Controlling the Viewport . . . . . . . . . . . . . . . . . . 92
2.14 Asynchronous Queries . . . . . . . . . . . . . . . . . . . . . . . 93
2.15 Conditional Rendering . . . . . . . . . . . . . . . . . . . . . . . 95
2.16 Transform Feedback . . . . . . . . . . . . . . . . . . . . . . . . 96
2.17 Primitive Queries . . . . . . . . . . . . . . . . . . . . . . . . . . 99
2.18 Flatshading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
2.19 Primitive Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . 100
2.19.1 Clipping Shader Varying Outputs . . . . . . . . . . . . . 103
3 Rasterization 104
3.1 Discarding Primitives Before Rasterization . . . . . . . . . . . . 105
3.2 Invariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.3 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.3.1 Multisampling . . . . . . . . . . . . . . . . . . . . . . . 107
OpenGL 3.3 (Core Profile) - March 11, 2010
CONTENTS iii
3.4 Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.4.1 Basic Point Rasterization . . . . . . . . . . . . . . . . . . 110
3.4.2 Point Rasterization State . . . . . . . . . . . . . . . . . . 110
3.4.3 Point Multisample Rasterization . . . . . . . . . . . . . . 111
3.5 Line Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . 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
3.6 Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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
3.6.5 Polygon Multisample Rasterization . . . . . . . . . . . . 120
3.6.6 Polygon Rasterization State . . . . . . . . . . . . . . . . 121
3.7 Pixel Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
3.7.1 Pixel Storage Modes and Pixel Buffer Objects . . . . . . . 121
3.7.2 Transfer of Pixel Rectangles . . . . . . . . . . . . . . . . 122
3.8 Texturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.8.1 Texture Objects . . . . . . . . . . . . . . . . . . . . . . . 135
3.8.2 Sampler Objects . . . . . . . . . . . . . . . . . . . . . . 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
3.8.15 Texture State and Proxy State . . . . . . . . . . . . . . . 181
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
3.9.1 Shader Variables . . . . . . . . . . . . . . . . . . . . . . 185
OpenGL 3.3 (Core Profile) - March 11, 2010
剩余424页未读,继续阅读
资源评论
- 泠沧2019-01-16不合符我的要求,浪费我积分
q1398284020
- 粉丝: 24
- 资源: 34
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功