没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
The OpenGL
R
Graphics System:
A Specification
(Version 2.0 - October 22, 2004)
Mark Segal
Kurt Akeley
Editor (version 1.1): Chris Frazier
Editor (versions 1.2-1.5): Jon Leech
Editors (version 2.0): Jon Leech and Pat Brown
Copyright
c
1992-2004 Silicon Graphics, Inc.
This document contains unpublished information of
Silicon Graphics, Inc.
This document is protected by copyright, and contains information proprietary to
Silicon Graphics, Inc. Any copying, adaptation, distribution, public performance,
or public display of this document without the express written consent of Silicon
Graphics, Inc. is strictly prohibited. The receipt or possession of this document
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.
U.S. Government Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions set forth
in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data
and 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 rights
reserved under the copyright laws of the United States. Contractor/manufacturer is
Silicon 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 of
The Open Group.
Contents
1 Introduction 1
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 Companion Documents . . . . . . . . . . . . . . . . . . . . . . . 3
2 OpenGL Operation 4
2.1 OpenGL Fundamentals . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1 Floating-Point Computation . . . . . . . . . . . . . . . . 6
2.2 GL State . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 GL Command Syntax . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Basic GL Operation . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 GL Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6 Begin/End Paradigm . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6.1 Begin and End . . . . . . . . . . . . . . . . . . . . . . . 15
2.6.2 Polygon Edges . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.3 GL Commands within Begin/End . . . . . . . . . . . . . 19
2.7 Vertex Specification . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8 Vertex Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.9 Buffer Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.9.1 Vertex Arrays in Buffer Objects . . . . . . . . . . . . . . 38
2.9.2 Array Indices in Buffer Objects . . . . . . . . . . . . . . 39
2.10 Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
2.11 Coordinate Transformations . . . . . . . . . . . . . . . . . . . . 40
2.11.1 Controlling the Viewport . . . . . . . . . . . . . . . . . . 41
2.11.2 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.11.3 Normal Transformation . . . . . . . . . . . . . . . . . . . 48
i
CONTENTS ii
2.11.4 Generating Texture Coordinates . . . . . . . . . . . . . . 49
2.12 Clipping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.13 Current Raster Position . . . . . . . . . . . . . . . . . . . . . . . 54
2.14 Colors and Coloring . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.14.1 Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.14.2 Lighting Parameter Specification . . . . . . . . . . . . . . 64
2.14.3 ColorMaterial . . . . . . . . . . . . . . . . . . . . . . . 66
2.14.4 Lighting State . . . . . . . . . . . . . . . . . . . . . . . . 68
2.14.5 Color Index Lighting . . . . . . . . . . . . . . . . . . . . 68
2.14.6 Clamping or Masking . . . . . . . . . . . . . . . . . . . 69
2.14.7 Flatshading . . . . . . . . . . . . . . . . . . . . . . . . . 69
2.14.8 Color and Associated Data Clipping . . . . . . . . . . . . 70
2.14.9 Final Color Processing . . . . . . . . . . . . . . . . . . . 71
2.15 Vertex Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.15.1 Shader Objects . . . . . . . . . . . . . . . . . . . . . . . 72
2.15.2 Program Objects . . . . . . . . . . . . . . . . . . . . . . 73
2.15.3 Shader Variables . . . . . . . . . . . . . . . . . . . . . . 75
2.15.4 Shader Execution . . . . . . . . . . . . . . . . . . . . . . 84
2.15.5 Required State . . . . . . . . . . . . . . . . . . . . . . . 88
3 Rasterization 90
3.1 Invariance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.2 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.2.1 Multisampling . . . . . . . . . . . . . . . . . . . . . . . 93
3.3 Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.3.1 Basic Point Rasterization . . . . . . . . . . . . . . . . . . 97
3.3.2 Point Rasterization State . . . . . . . . . . . . . . . . . . 101
3.3.3 Point Multisample Rasterization . . . . . . . . . . . . . . 101
3.4 Line Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
3.4.1 Basic Line Segment Rasterization . . . . . . . . . . . . . 102
3.4.2 Other Line Segment Features . . . . . . . . . . . . . . . . 104
3.4.3 Line Rasterization State . . . . . . . . . . . . . . . . . . 107
3.4.4 Line Multisample Rasterization . . . . . . . . . . . . . . 107
3.5 Polygons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.5.1 Basic Polygon Rasterization . . . . . . . . . . . . . . . . 108
3.5.2 Stippling . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.5.3 Antialiasing . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.5.4 Options Controlling Polygon Rasterization . . . . . . . . 111
3.5.5 Depth Offset . . . . . . . . . . . . . . . . . . . . . . . . 111
3.5.6 Polygon Multisample Rasterization . . . . . . . . . . . . 113
Version 2.0 - October 22, 2004
CONTENTS iii
3.5.7 Polygon Rasterization State . . . . . . . . . . . . . . . . 113
3.6 Pixel Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.6.1 Pixel Storage Modes . . . . . . . . . . . . . . . . . . . . 114
3.6.2 The Imaging Subset . . . . . . . . . . . . . . . . . . . . 114
3.6.3 Pixel Transfer Modes . . . . . . . . . . . . . . . . . . . . 116
3.6.4 Rasterization of Pixel Rectangles . . . . . . . . . . . . . 126
3.6.5 Pixel Transfer Operations . . . . . . . . . . . . . . . . . 137
3.6.6 Pixel Rectangle Multisample Rasterization . . . . . . . . 147
3.7 Bitmaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
3.8 Texturing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.8.1 Texture Image Specification . . . . . . . . . . . . . . . . 150
3.8.2 Alternate Texture Image Specification Commands . . . . 158
3.8.3 Compressed Texture Images . . . . . . . . . . . . . . . . 163
3.8.4 Texture Parameters . . . . . . . . . . . . . . . . . . . . . 166
3.8.5 Depth Component Textures . . . . . . . . . . . . . . . . 168
3.8.6 Cube Map Texture Selection . . . . . . . . . . . . . . . . 168
3.8.7 Texture Wrap Modes . . . . . . . . . . . . . . . . . . . . 169
3.8.8 Texture Minification . . . . . . . . . . . . . . . . . . . . 170
3.8.9 Texture Magnification . . . . . . . . . . . . . . . . . . . 176
3.8.10 Texture Completeness . . . . . . . . . . . . . . . . . . . 177
3.8.11 Texture State and Proxy State . . . . . . . . . . . . . . . 178
3.8.12 Texture Objects . . . . . . . . . . . . . . . . . . . . . . . 180
3.8.13 Texture Environments and Texture Functions . . . . . . . 182
3.8.14 Texture Comparison Modes . . . . . . . . . . . . . . . . 185
3.8.15 Texture Application . . . . . . . . . . . . . . . . . . . . . 189
3.9 Color Sum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
3.10 Fog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
3.11 Fragment Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . 193
3.11.1 Shader Variables . . . . . . . . . . . . . . . . . . . . . . 193
3.11.2 Shader Execution . . . . . . . . . . . . . . . . . . . . . . 194
3.12 Antialiasing Application . . . . . . . . . . . . . . . . . . . . . . 197
3.13 Multisample Point Fade . . . . . . . . . . . . . . . . . . . . . . . 197
4 Per-Fragment Operations and the Framebuffer 198
4.1 Per-Fragment Operations . . . . . . . . . . . . . . . . . . . . . . 199
4.1.1 Pixel Ownership Test . . . . . . . . . . . . . . . . . . . . 199
4.1.2 Scissor Test . . . . . . . . . . . . . . . . . . . . . . . . . 200
4.1.3 Multisample Fragment Operations . . . . . . . . . . . . . 200
4.1.4 Alpha Test . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.1.5 Stencil Test . . . . . . . . . . . . . . . . . . . . . . . . . 202
Version 2.0 - October 22, 2004
剩余381页未读,继续阅读
资源评论
gqb666
- 粉丝: 439
- 资源: 122
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功