没有合适的资源?快使用搜索试试~ 我知道了~
首页OpenGL超级宝典第四版:3D图形编程入门与高级特性解析
"OpenGL超级宝典 第四版 (英文版)"
OpenGL超级宝典第四版是一部专为初学者和进阶者准备的3D图形编程权威指南,尤其关注使用最新版本的OpenGL进行编程。作者团队包括Richard S. Wright Jr., Benjamin Lipchak和Nicholas Haemel,他们通过丰富的章节内容,全面解析了OpenGL的核心概念和技术。
本书分为三个部分:
第一部分(第1章至第14章)是基础教程,引导读者逐步建立使用OpenGL编程的能力。这部分涵盖了创建OpenGL程序的基础,如环境设置、窗口系统集成、上下文创建和管理。此外,还包括3D坐标系统、视口和投影变换、顶点数组、颜色和纹理映射、光照模型、深度测试等基础知识。这一部分还讲解了基本的着色技术,如固定功能管线的使用。
第二部分(第15章至第18章)则深入探讨OpenGL的新特性和可编程硬件的支持,尤其是OpenGL着色语言(GLSL)。GLSL是OpenGL中用于编写顶点和片段着色器的高级编程语言,这部分详细介绍了GLSL的基本语法、变量类型、控制流、向量与矩阵运算,以及如何创建复杂的着色效果。此外,还讨论了纹理合成、混合模式、多重采样抗锯齿等高级图形技术。
第三部分(第19章至第22章)关注的是平台兼容性和跨平台开发。这一部分讲解了如何在Windows、Mac OS X、Linux以及掌上设备上集成和使用OpenGL。涵盖了平台特定的配置、驱动程序、库和工具,帮助开发者理解如何在不同操作系统上实现OpenGL程序的移植和优化。
附录部分提供了更多的学习资源推荐、图形编程术语表以及OpenGL API的参考信息,这些对于读者深入理解和应用OpenGL编程至关重要。
本书不仅适合初学者,也适合有一定经验的OpenGL开发者,通过详尽的实例和解释,帮助读者掌握现代OpenGL的核心技术,从而能够创建出令人惊叹的3D图形应用程序。

Color in the Real World..............................................................................186
Ambient Light....................................................................................187
Diffuse Light ......................................................................................188
Specular Light ....................................................................................188
Putting It All Together.......................................................................189
Materials in the Real World........................................................................190
Material Properties.............................................................................190
Adding Light to Materials..................................................................190
Calculating Ambient Light Effects ....................................................190
Diffuse and Specular Effects ..............................................................191
Adding Light to a Scene..............................................................................192
Enabling the Lighting........................................................................192
Setting Up Cosmic Background Radiation........................................192
Setting Material Properties ................................................................193
Using a Light Source ...................................................................................196
Which Way Is Up?.............................................................................197
Surface Normals.................................................................................197
Specifying a Normal ..........................................................................198
Unit Normals .....................................................................................201
Finding a Normal...............................................................................202
Setting Up a Source............................................................................203
Setting the Material Properties ..........................................................205
Specifying the Polygons ....................................................................205
Lighting Effects ...........................................................................................207
Specular Highlights............................................................................207
Specular Light ....................................................................................208
Specular Reflectance ..........................................................................208
Specular Exponent.............................................................................209
Normal Averaging..............................................................................211
Putting It All Together ................................................................................213
Creating a Spotlight...........................................................................214
Drawing a Spotlight...........................................................................216
Shadows.......................................................................................................221
What Is a Shadow? ............................................................................222
Squish Code .......................................................................................223
A Shadow Example ............................................................................223
Sphere World Revisited......................................................................227
Summary .....................................................................................................227
Contents xv

6 More on Colors and Materials....................................................................229
Blending ......................................................................................................229
Combining Colors .............................................................................230
Changing the Blending Equation .....................................................234
Antialiasing ........................................................................................234
Multisample .......................................................................................238
Applying Fog ...............................................................................................240
Fog Equations ....................................................................................242
Fog Coordinates.................................................................................244
Accumulation Buffer...................................................................................244
Other Color Operations..............................................................................248
Color Masking ...................................................................................248
Color Logical Operations...................................................................248
Alpha Testing .....................................................................................249
Dithering............................................................................................250
Summary .....................................................................................................250
7 Imaging with OpenGL ................................................................................251
Bitmaps........................................................................................................252
Bitmapped Data .................................................................................253
The Raster Position ............................................................................256
Pixel Packing ...............................................................................................257
Pixmaps .......................................................................................................258
Packed Pixel Formats .........................................................................260
A More Colorful Example..................................................................261
Moving Pixels Around .......................................................................265
Saving Pixels ......................................................................................266
More Fun with Pixels..................................................................................268
Pixel Zoom.........................................................................................275
Pixel Transfer .....................................................................................277
Pixel Mapping....................................................................................281
The Imaging “Subset” and Pipeline............................................................283
Color Matrix ......................................................................................288
Color Lookup.....................................................................................289
Proxies................................................................................................290
Other Operations...............................................................................291
Convolutions .....................................................................................292
Histogram ..........................................................................................297
Minmax Operations...........................................................................301
Summary .....................................................................................................301
OpenGL SuperBible, Fourth Editionxvi

8 Texture Mapping: The Basics .....................................................................303
Loading Textures.........................................................................................304
Using the Color Buffer ......................................................................307
Updating Textures..............................................................................307
Mapping Textures to Geometry ........................................................308
Texture Matrix ...................................................................................311
A Simple 2D Example .................................................................................311
Texture Environment..................................................................................316
Texture Parameters......................................................................................318
Basic Filtering.....................................................................................318
Texture Wrap .....................................................................................320
Cartoons with Texture.......................................................................321
Mipmapping ......................................................................................325
Texture Objects ...........................................................................................330
Managing Multiple Textures .............................................................331
Summary .....................................................................................................339
9 Texture Mapping: Beyond the Basics.........................................................341
Secondary Color..........................................................................................341
Anisotropic Filtering ...................................................................................344
Texture Compression ..................................................................................347
Compressing Textures........................................................................348
Loading Compressed Textures...........................................................349
Texture Coordinate Generation..................................................................350
Object Linear Mapping......................................................................354
Eye Linear Mapping...........................................................................355
Sphere Mapping.................................................................................356
Cube Mapping ...................................................................................357
Multitexture ................................................................................................362
Multiple Texture Coordinates ...........................................................363
A Multitextured Example ..................................................................364
Texture Combiners......................................................................................369
Point Sprites ................................................................................................371
Using Points.......................................................................................372
Texture Application ...........................................................................374
Point Parameters................................................................................374
Summary .....................................................................................................375
Contents xvii

10 Curves and Surfaces....................................................................................377
Built-in Surfaces ..........................................................................................378
Setting Quadric States........................................................................379
Drawing Quadrics ..............................................................................381
Modeling with Quadrics....................................................................385
Bézier Curves and Surfaces .........................................................................388
Parametric Representation.................................................................388
Evaluators...........................................................................................391
NURBS .........................................................................................................401
From Bézier to B-Splines....................................................................402
Knots ..................................................................................................402
Creating a NURBS Surface .................................................................403
NURBS Properties...............................................................................404
Defining the Surface ..........................................................................404
Trimming ...........................................................................................406
NURBS Curves....................................................................................409
Tessellation..................................................................................................409
The Tessellator ...................................................................................411
Tessellator Callbacks ..........................................................................412
Specifying Vertex Data ......................................................................413
Putting It All Together.......................................................................414
Summary .....................................................................................................419
11 It’s All About the Pipeline: Faster Geometry Throughput.........................421
Display Lists ................................................................................................422
Batch Processing ................................................................................423
Preprocessed Batches .........................................................................424
Display List Caveats...........................................................................426
Converting to Display Lists...............................................................426
Vertex Arrays ...............................................................................................428
Loading the Geometry ......................................................................432
Enabling Arrays..................................................................................432
Where’s the Data?..............................................................................433
Pull the Data and Draw .....................................................................434
Indexed Vertex Arrays .......................................................................435
Vertex Buffer Objects ..................................................................................450
Managing and Using Buffer Objects .................................................450
Back to the Thunderbird! ..................................................................452
Summary .....................................................................................................455
OpenGL SuperBible, Fourth Editionxviii

12 Interactive Graphics....................................................................................457
Selection ......................................................................................................458
Naming Your Primitives ....................................................................458
Working with Selection Mode...........................................................460
The Selection Buffer...........................................................................461
Picking ...............................................................................................464
Hierarchical Picking...........................................................................466
Feedback.............................................................................................471
The Feedback Buffer ..........................................................................471
Feedback Data....................................................................................472
Passthrough Markers .........................................................................473
A Feedback Example ...................................................................................473
Label the Objects for Feedback..........................................................473
Step 1: Select the Object....................................................................476
Step 2: Get Feedback on the Object ..................................................478
Summary .....................................................................................................480
13 Occlusion Queries: Why Do More Work Than You Need To? ...................481
The World Before Occlusion Queries .........................................................482
Bounding Boxes ..........................................................................................485
Querying the Query Object ........................................................................490
Best Practices ...............................................................................................492
Summary .....................................................................................................493
14 Depth Textures and Shadows.....................................................................495
Be That Light...............................................................................................496
Fit the Scene to the Window.............................................................496
No Bells or Whistles, Please...............................................................497
A New Kind of Texture ...............................................................................498
Size Matters........................................................................................499
Draw the Shadows First?!............................................................................500
And Then There Was Light.........................................................................501
Projecting Your Shadow Map: The “Why” .......................................501
Projecting Your Shadow Map: The “How”........................................503
The Shadow Comparison ..................................................................505
Two Out of Three Ain’t Bad........................................................................509
A Few Words About Polygon Offset ...........................................................510
Summary .....................................................................................................511
Contents xix
剩余1261页未读,继续阅读
154 浏览量
155 浏览量
点击了解资源详情
171 浏览量

simimasaiya
- 粉丝: 9
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

最新资源
- 编程技巧:从新手到专家的进阶指南
- 基于.NET 2.0的面向对象编程基础指南
- Ubuntu环境下配置GNU交叉工具链arm-linux-gcc 3.4.4
- 深入探索Bash Shell脚本编程指南
- 十天精通C#版ASP.NET实战教程
- OSWorkflow 2.8 中文手册:工作流深度解析
- Hibernate入门与实战指南
- Bindows用户手册:构建富Web应用程序
- 数据库系统概论第四版答案详解
- 探索MATLAB中创新的俄罗斯方块新玩法
- C语言编程关键概念与技巧解析
- Hibernate 3.2官方文档详解:入门与配置
- 设计模式解析:从简单工厂到抽象工厂
- UML与设计模式:理解和应用
- Java高级成像编程指南
- JAVA面试:BS与CS模式深入解析
安全验证
文档复制为VIP权益,开通VIP直接复制
