在好例子网,分享、交流、成长!
您当前所在位置:首页js 开发实例Ajax框架/RIA → OpenGL ES 3.0 Programming Guide, 2nd Edition by Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner, Aaftab Munshi

OpenGL ES 3.0 Programming Guide, 2nd Edition by Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner, Aaftab Munshi

Ajax框架/RIA

下载此实例
  • 开发语言:js
  • 实例大小:11.26M
  • 下载次数:11
  • 浏览次数:49
  • 发布时间:2022-12-12
  • 实例类别:Ajax框架/RIA
  • 发 布 人:lallal123
  • 文件格式:.pdf
  • 所需积分:0
 相关标签: Programming OpenGL GUIDE OPENG edit

实例介绍

【实例简介】OpenGL ES 3.0 Programming Guide, 2nd Edition by Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner, Aaftab Munshi (z-lib.org)

【实例截图】

【核心代码】

Contents
List of Figures ���������������������������������������������������������������������������������������xvii
List of Examples �������������������������������������������������������������������������������������xxi
List of Tables ������������������������������������������������������������������������������������������xxv
Foreword �����������������������������������������������������������������������������������������������xxix
Preface ��������������������������������������������������������������������������������������������������xxxi
Intended Audience . ??????????????????????xxxi
Organization of This Book . ??????????????????xxxii
Example Code and Shaders . ?????????????????xxxvi
Errata . ????????????????????????????xxxvi
Acknowledgments ����������������������������������������������������������������������������xxxvii
About the Authors ������������������������������������������������������������������������������xxxix
1� Introduction to OpenGL ES 3�0 � ��������������������������������������������������������������1
OpenGL ES 3.0 . ?????????????????????????3
Vertex Shader . ??????????????????????????4
Primitive Assembly . ???????????????????????7
Rasterization . ??????????????????????????7
Fragment Shader .?????????????????????????8
Per-Fragment Operations .?????????????????????9
What’s New in OpenGL ES 3.0 . ?????????????????11
Texturing .??????????????????????????11
Shaders .???????????????????????????13
www.it-ebooks.info
viii Contents
Geometry . ???????????????????????????15
Buffer Objects . ?????????????????????????16
Framebuffer . ??????????????????????????17
OpenGL ES 3.0 and Backward Compatibility .???????????17
EGL . ??????????????????????????????19
Programming with OpenGL ES 3.0 . ???????????????20
Libraries and Include Files .????????????????????20
EGL Command Syntax . ?????????????????????20
OpenGL ES Command Syntax . ?????????????????21
Error Handling . ?????????????????????????22
Basic State Management . ????????????????????23
Further Reading . ????????????????????????25
2� Hello Triangle: An OpenGL ES 3�0 Example ������������������������������������������27
Code Framework . ????????????????????????28
Where to Download the Examples .????????????????28
Hello Triangle Example . ?????????????????????29
Using the OpenGL ES 3.0 Framework . ??????????????34
Creating a Simple Vertex and Fragment Shader . ??????????35
Compiling and Loading the Shaders . ???????????????36
Creating a Program Object and Linking the Shaders . ???????38
Setting the Viewport and Clearing the Color Buffer .????????39
Loading the Geometry and Drawing a Primitive . ?????????40
Displaying the Back Buffer . ???????????????????41
Summary .????????????????????????????42
3� An Introduction to EGL ���������������������������������������������������������������������������43
Communicating with the Windowing System . ??????????44
Checking for Errors . ???????????????????????45
Initializing EGL .?????????????????????????46
Determining the Available Surface Configurations . ????????46
Querying EGLConfig Attributes . ?????????????????48
Letting EGL Choose the Configuration .??????????????51
Creating an On-Screen Rendering Area: The EGL Window . ????53
Creating an Off-Screen Rendering Area: EGL Pbuffers . ???????56
Creating a Rendering Context . ??????????????????60
www.it-ebooks.info
Contents ix
Making an EGLContext Current .?????????????????62
Putting All Our EGL Knowledge Together. ????????????63
Synchronizing Rendering . ????????????????????66
Summary .????????????????????????????67
4� Shaders and Programs ���������������������������������������������������������������������������69
Shaders and Programs .??????????????????????69
Creating and Compiling a Shader . ????????????????70
Creating and Linking a Program .?????????????????74
Uniforms and Attributes . ????????????????????80
Getting and Setting Uniforms . ??????????????????81
Uniform Buffer Objects . ?????????????????????87
Getting and Setting Attributes .??????????????????92
Shader Compiler . ????????????????????????93
Program Binaries . ????????????????????????94
Summary .????????????????????????????95
5� OpenGL ES Shading Language �������������������������������������������������������������97
OpenGL ES Shading Language Basics . ??????????????98
Shader Version Specification . ??????????????????98
Variables and Variable Types . ??????????????????99
Variable Constructors . ?????????????????????100
Vector and Matrix Components . ????????????????101
Constants .???????????????????????????102
Structures .???????????????????????????103
Arrays . ????????????????????????????104
Operators .???????????????????????????104
Functions .???????????????????????????106
Built-In Functions . ???????????????????????107
Control Flow Statements .????????????????????107
Uniforms . ???????????????????????????108
Uniform Blocks . ????????????????????????109
Vertex and Fragment Shader Inputs/Outputs . ??????????111
Interpolation Qualifiers . ????????????????????114
Preprocessor and Directives . ??????????????????115
Uniform and Interpolator Packing . ???????????????117
www.it-ebooks.info
x Contents
Precision Qualifiers . ??????????????????????119
Invariance . ??????????????????????????121
Summary . ???????????????????????????123
6� Vertex Attributes, Vertex Arrays, and Buffer Objects ��������������������������125
Specifying Vertex Attribute Data . ????????????????126
Constant Vertex Attribute . ???????????????????126
Vertex Arrays . ?????????????????????????126
Declaring Vertex Attribute Variables in a Vertex Shader . ?????135
Binding Vertex Attributes to Attribute Variables in a Vertex Shader
. ?????????????????????????????137
Vertex Buffer Objects . ?????????????????????140
Vertex Array Objects .??????????????????????150
Mapping Buffer Objects . ????????????????????154
Flushing a Mapped Buffer . ?????????????????158
Copying Buffer Objects . ????????????????????159
Summary . ???????????????????????????160
7� Primitive Assembly and Rasterization �������������������������������������������������161
Primitives .???????????????????????????161
Triangles . ???????????????????????????162
Lines . ?????????????????????????????163
Point Sprites .??????????????????????????164
Drawing Primitives . ??????????????????????165
Primitive Restart . ???????????????????????168
Provoking Vertex . ???????????????????????169
Geometry Instancing . ?????????????????????169
Performance Tips . ???????????????????????172
Primitive Assembly . ??????????????????????174
Coordinate Systems . ??????????????????????175
Perspective Division . ??????????????????????178
Viewport Transformation . ???????????????????178
Rasterization . ?????????????????????????179
Culling . ????????????????????????????180
Polygon Offset . ????????????????????????181
Occlusion Queries . ???????????????????????183
Summary . ???????????????????????????185
www.it-ebooks.info
Contents xi
8� Vertex Shaders ����������������������������������������������������������������������������187
Vertex Shader Overview . ????????????????????188
Vertex Shader Built-In Variables . ????????????????189
Precision Qualifiers . ??????????????????????192
Number of Uniforms Limitations in a Vertex Shader .???????193
Vertex Shader Examples . ????????????????????196
Matrix Transformations . ????????????????????196
Lighting in a Vertex Shader . ??????????????????199
Generating Texture Coordinates . ????????????????205
Vertex Skinning . ????????????????????????207
Transform Feedback . ??????????????????????211
Vertex Textures . ????????????????????????214
OpenGL ES 1.1 Vertex Pipeline as an ES 3.0 Vertex Shader . ????215
Summary . ???????????????????????????223
9� Texturing �������������������������������������������������������������������������������������225
Texturing Basics . ????????????????????????226
2D Textures . ??????????????????????????226
Cubemap Textures .???????????????????????228
3D Textures . ??????????????????????????229
2D Texture Arrays . ???????????????????????230
Texture Objects and Loading Textures . ?????????????230
Texture Filtering and Mipmapping . ???????????????237
Automatic Mipmap Generation . ????????????????242
Texture Coordinate Wrapping . ?????????????????243
Texture Swizzles . ????????????????????????244
Texture Level of Detail .?????????????????????245
Depth Texture Compare (Percentage Closest Filtering) .??????245
Texture Formats . ????????????????????????246
Using Textures in a Shader . ???????????????????255
Example of Using a Cubemap Texture . ?????????????258
Loading 3D Textures and 2D Texture Arrays . ??????????260
Compressed Textures . ?????????????????????262
Texture Subimage Specification .?????????????????266
Copying Texture Data from the Color Buffer . ??????????269
www.it-ebooks.info
xii Contents
Sampler Objects . ????????????????????????273
Immutable Textures . ??????????????????????276
Pixel Unpack Buffer Objects . ??????????????????277
Summary . ???????????????????????????278
10� Fragment Shaders �����������������������������������������������������������������������279
Fixed-Function Fragment Shaders . ???????????????280
Fragment Shader Overview . ??????????????????282
Built-In Special Variables .????????????????????283
Built-In Constants .???????????????????????284
Precision Qualifiers . ??????????????????????285
Implementing Fixed-Function Techniques Using Shaders . ????286
Multitexturing . ????????????????????????286
Fog . ??????????????????????????????288
Alpha Test (Using Discard) . ???????????????????291
User Clip Planes . ????????????????????????293
Summary . ???????????????????????????295
11� Fragment Operations �������������������������������������������������������������������297
Buffers . ????????????????????????????298
Requesting Additional Buffers . ?????????????????299
Clearing Buffers . ????????????????????????299
Using Masks to Control Writing to Framebuffers . ????????301
Fragment Tests and Operations .?????????????????303
Using the Scissor Test . ?????????????????????304
Stencil Buffer Testing . ?????????????????????305
Blending . ???????????????????????????311
Dithering . ???????????????????????????314
Multisampled Anti-Aliasing . ??????????????????314
Centroid Sampling . ????????????????????316
Reading and Writing Pixels to the Framebuffer . ?????????316
Pixel Pack Buffer Objects . ??????????????????320
Multiple Render Targets . ????????????????????320
Summary . ???????????????????????????324
www.it-ebooks.info
Contents xiii
12� Framebuffer Objects ��������������������������������������������������������������������325
Why Framebuffer Objects? .???????????????????325
Framebuffer and Renderbuffer Objects . ?????????????327
Choosing a Renderbuffer Versus a Texture as
a Framebuffer Attachment . ????????????????328
Framebuffer Objects Versus EGL Surfaces . ??????????329
Creating Framebuffer and Renderbuffer Objects .?????????329
Using Renderbuffer Objects . ??????????????????330
Multisample Renderbuffers . ??????????????????333
Renderbuffer Formats . ?????????????????????333
Using Framebuffer Objects .???????????????????335
Attaching a Renderbuffer as a Framebuffer Attachment . ???337
Attaching a 2D Texture as a Framebuffer Attachment . ????338
Attaching an Image of a 3D Texture as a Framebuffer
Attachment . ??????????????????????????339
Checking for Framebuffer Completeness . ????????????341
Framebuffer Blits . ???????????????????????342
Framebuffer Invalidation .????????????????????344
Deleting Framebuffer and Renderbuffer Objects. ?????????346
Deleting Renderbuffer Objects That Are Used
as Framebuffer Attachments . ???????????????347
Reading Pixels and Framebuffer Objects .???????????347
Examples . ???????????????????????????348
Performance Tips and Tricks . ??????????????????354
Summary . ???????????????????????????355
13� Sync Objects and Fences ������������������������������������������������������������357
Flush and Finish . ???????????????????????357
Why Use a Sync Object? . ????????????????????358
Creating and Deleting a Sync Object . ??????????????358
Waiting for and Signaling a Sync Object . ????????????359
Example . ???????????????????????????360
Summary . ???????????????????????????361
www.it-ebooks.info
xiv Contents
14� Advanced Programming with OpenGL ES 3�0 �������������������������������363
Per-Fragment Lighting . ?????????????????????363
Lighting with a Normal Map .??????????????????364
Lighting Shaders . ???????????????????????366
Lighting Equations . ??????????????????????369
Environment Mapping . ????????????????????370
Particle System with Point Sprites . ???????????????374
Particle System Setup . ?????????????????????374
Particle System Vertex Shader . ?????????????????375
Particle System Fragment Shader . ????????????????377
Particle System Using Transform Feedback . ???????????380
Particle System Rendering Algorithm .??????????????381
Particle Emission with Transform Feedback .???????????381
Rendering the Particles .?????????????????????385
Image Postprocessing . ?????????????????????387
Render-to-Texture Setup . ????????????????????387
Blur Fragment Shader . ?????????????????????388
Projective Texturing . ??????????????????????390
Projective Texturing Basics . ???????????????????391
Matrices for Projective Texturing . ????????????????392
Projective Spotlight Shaders . ??????????????????394
Noise Using a 3D Texture . ???????????????????397
Generating Noise . ???????????????????????397
Using Noise . ??????????????????????????402
Procedural Texturing . ?????????????????????404
A Procedural Texture Example . ?????????????????405
Anti-Aliasing of Procedural Textures . ??????????????407
Further Reading on Procedural Textures . ????????????410
Rendering Terrain with Vertex Texture Fetch . ??????????410
Generating a Square Terrain Grid .??????????????411
Computing Vertex Normal and Fetching Height Value
in Vertex Shader . ?????????????????????412
Further Reading on Large Terrain Rendering .?????????413
Shadows Using a Depth Texture . ????????????????414
Rendering from the Light Position Into a Depth Texture . ????415
Rendering from the Eye Position with the Depth Texture . ????418
Summary . ???????????????????????????420
www.it-ebooks.info
Contents xv
15� State Queries ������������������������������������������������������������������������������421
OpenGL ES 3.0 Implementation String Queries . ?????????421
Querying Implementation-Dependent Limits . ??????????423
Querying OpenGL ES State .???????????????????429
Hints . ?????????????????????????????435
Entity Name Queries .??????????????????????436
Nonprogrammable Operations Control and Queries . ??????436
Shader and Program State Queries . ???????????????438
Vertex Attribute Queries . ????????????????????440
Texture State Queries . ?????????????????????441
Sampler Queries . ????????????????????????442
Asynchronous Object Queries . ?????????????????442
Sync Object Queries . ??????????????????????443
Vertex Buffer Queries . ?????????????????????444
Renderbuffer and Framebuffer State Queries . ??????????445
Summary . ???????????????????????????446
16� OpenGL ES Platforms ���������������������������������������������������������������������������447
Building for Microsoft Windows with Visual Studio . ???????447
Building for Ubuntu Linux .???????????????????449
Building for Android 4.3 NDK (C ) .??????????????450
Prerequisites .??????????????????????????451
Building the Example Code with Android NDK . ?????????452
Building for Android 4.3 SDK (Java). ??????????????452
Building for iOS 7 . ???????????????????????453
Prerequisites .??????????????????????????453
Building the Example Code with Xcode 5 .????????????453
Summary . ???????????????????????????455
A� GL_HALF_FLOAT ������������������������������������������������������������������������457
16-Bit Floating-Point Number . ?????????????????458
Converting a Float to a Half-Float . ???????????????459
B� Built-In Functions ������������������������������������������������������������������������463
Angle and Trigonometry Functions . ??????????????465
Exponential Functions . ????????????????????466
Common Functions . ??????????????????????467
www.it-ebooks.info
xvi Contents
Floating-Point Pack and Unpack Functions . ???????????471
Geometric Functions . ?????????????????????472
Matrix Functions . ???????????????????????474
Vector Relational Functions . ??????????????????475
Texture Lookup Functions . ???????????????????476
Fragment Processing Functions .?????????????????483
C� ES Framework API ���������������������������������������������������������������������������������485
Framework Core Functions . ??????????????????485
Transformation Functions . ???????????????????490
Index �������������������������������������������������������������������������������������������495


实例下载地址

OpenGL ES 3.0 Programming Guide, 2nd Edition by Dan Ginsburg, Budirijanto Purnomo, Dave Shreiner, Aaftab Munshi

不能下载?内容有错? 点击这里报错 + 投诉 + 提问

好例子网口号:伸出你的我的手 — 分享

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警