没有合适的资源?快使用搜索试试~ 我知道了~
首页OpenGL编程指南(第八版)- 计算机图形学基础
OpenGL编程指南(第八版)- 计算机图形学基础
需积分: 19 5 下载量 171 浏览量
更新于2024-07-18
收藏 11.58MB PDF 举报
"OpenGL红宝书英文版是一本深入介绍OpenGL编程的权威指南,适用于学习计算机图形学、图形游戏开发和研究工作。第八版更新至最新的OpenGL标准,详细讲解了现代OpenGL技术,包括核心特性及新功能,特别是着色器的使用。"
OpenGL是一种广泛应用于3D图形编程的应用程序编程接口(API),它允许程序员直接与图形硬件进行交互,创建复杂的视觉效果和高性能的游戏。OpenGL红宝书,又被称为OpenGL Programming Guide,是这个领域的经典教材,深受专业人士和学者的喜爱。
此书以C++语言为编程基础,深入浅出地讲解了OpenGL的工作原理和使用方法。在第八版中,作者们——Dave Shreiner、Graham Sellers、John Kessenich和Bill Licea-Kane——紧跟OpenGL的发展趋势,提供了关于最新标准的详尽信息,如OpenGL 4.x或更高版本。他们强调了现代OpenGL的核心概念,如基于着色器的编程模型,这是现代图形处理单元(GPU)设计的关键部分。
着色器是OpenGL中的核心组件,它们在GPU上运行,负责处理图像渲染的各个阶段,如顶点变换、光照计算和纹理映射。第八版详细介绍了各种类型的着色器,包括顶点着色器、片段着色器和几何着色器等,以及如何编写和管理这些着色器程序。此外,书中还涵盖了现代OpenGL的其他重要技术,如缓冲区对象、纹理、帧缓冲对象(FBOs)和状态管理。
书中不仅关注技术细节,还强调了最佳实践和性能优化策略,这对于在实际项目中高效使用OpenGL至关重要。同时,通过丰富的示例代码和练习,读者可以加深对理论知识的理解,并将之转化为实际技能。
OpenGL红宝书对于想要进入计算机图形学领域的初学者来说,是一本不可或缺的启蒙书籍。同时,对于有经验的开发者,它也提供了一个全面的参考,帮助他们跟上OpenGL的最新发展,提升图形编程的技能水平。无论是在学术研究、游戏开发还是专业模拟软件领域,这本书都将继续发挥其作为权威参考资料的重要作用。
ptg9898810
Increasing Resolution. ............................................................................. 445
Antialiasing High Frequencies . ............................................................... 447
Frequency Clamping................................................................................ 457
Procedural Antialiasing Summary. .......................................................... 459
Noise . ....................................................................................................... 460
Definition of Noise . ................................................................................. 461
Noise Textures . ........................................................................................ 468
Trade-offs.................................................................................................. 471
A Simple Noise Shader . ........................................................................... 472
Turbulence . .............................................................................................. 475
Marble. ..................................................................................................... 477
Granite. .................................................................................................... 478
Wood ........................................................................................................ 478
Noise Summary. ....................................................................................... 483
Further Information . ............................................................................... 483
9. Tessellation Shaders. ...............................................................................485
Tessellation Shaders. ................................................................................ 486
Tessellation Patches. ................................................................................ 487
Tessellation Control Shaders . .................................................................. 488
Generating Output-Patch Vertices . ......................................................... 489
Tessellation Control Shader Variables. .................................................... 490
Controlling Tessellation . ......................................................................... 491
Tessellation Evaluation Shaders . ............................................................. 496
Specifying the Primitive Generation Domain . ....................................... 497
Specifying the Face Winding for Generated Primitives . ......................... 497
Specifying the Spacing of Tessellation Coordinates. ............................... 498
Additional Tessellation Evaluation Shader layout Options . ................. 498
Specifying a Vertex’s Position . ................................................................ 498
Tessellation Evaluation Shader Variables. ................................................ 499
A Tessellation Example: The Teapot . ...................................................... 500
Processing Patch Input Vertices. .............................................................. 501
Evaluating Tessellation Coordinates for the Teapot. ............................... 501
Additional Tessellation Techniques . ....................................................... 504
View-Dependent Tessellation. ............................................................. 504
Shared Tessellated Edges and Cracking ............................................... 506
Displacement Mapping ....................................................................... 507
Contents
xv
ptg9898810
10. Geometry Shaders. ...................................................................................509
Creating a Geometry Shader . .................................................................. 510
Geometry Shader Inputs and Outputs . ................................................... 514
Geometry Shader Inputs . ......................................................................... 514
Special Geometry Shader Primitives. ....................................................... 517
Geometry Shader Outputs . ..................................................................... 523
Producing Primitives . .............................................................................. 525
Culling Geometry . .................................................................................. 525
Geometry Amplification . ......................................................................... 527
Advanced Transform Feedback ................................................................ 532
Multiple Output Streams ......................................................................... 533
Primitive Queries . ................................................................................... 537
Using Transform Feedback Results . ......................................................... 539
Geometry Shader Instancing. .................................................................. 549
Multiple Viewports and Layered Rendering . .......................................... 550
Viewport Index . ....................................................................................... 550
Layered Rendering. .................................................................................. 556
Chapter Summary. ................................................................................... 559
Geometry Shader Redux ...................................................................... 560
Geometry Shader Best Practices .......................................................... 561
11. Memory . ....................................................................................................563
Using Textures for Generic Data Storage . ............................................... 564
Binding Textures to Image Units . ............................................................ 569
Reading from and Writing to Images . .................................................... 572
Shader Storage Buffer Objects. ................................................................. 576
Writing Structured Data. ...................................................................... 577
Atomic Operations and Synchronization ............................................... 578
Atomic Operations on Images . ............................................................... 578
Atomic Operations on Buffers. ................................................................ 587
Sync Objects. ............................................................................................ 589
Image Qualifiers and Barriers................................................................... 593
High Performance Atomic Counters . ...................................................... 605
Example. .................................................................................................. 609
Order-Independent Transparency. ...................................................... 609
xvi Contents
ptg9898810
12. Compute Shaders. ....................................................................................623
Overview. ................................................................................................. 624
Workgroups and Dispatch . ...................................................................... 625
Knowing Where You Are . ................................................................... 630
Communication and Synchronization.................................................... 632
Communication . ..................................................................................... 633
Synchronization ...................................................................................... 634
Examples. ................................................................................................. 636
Physical Simulation ................................................................................. 636
Image Processing...................................................................................... 642
Chapter Summary. ................................................................................... 647
Compute Shader Redux . ...................................................................... 647
Compute Shader Best Practices ........................................................... 648
A. Basics of GLUT: The OpenGL Utility Toolkit. ..........................................651
Initializing and Creating a Window . ...................................................... 652
Accessing Functions . ............................................................................... 654
Handling Window and Input Events . ..................................................... 655
Managing a Background Process . ............................................................ 658
Running the Program .............................................................................. 658
B. OpenGL ES and WebGL . .........................................................................659
OpenGL ES . .............................................................................................. 660
WebGL ..................................................................................................... 662
Setting up WebGL within an HTML5 page . ........................................ 662
Initializing Shaders in WebGL . ........................................................... 664
Initializing Vertex Data in WebGL . ..................................................... 667
Using Texture Maps in WebGL. ........................................................... 668
C. Built-in GLSL Variables and Functions ...................................................673
Built-in Variables . .................................................................................... 674
Built-in Variable Declarations . ................................................................ 674
Built-in Variable Descriptions . ................................................................ 676
Built-in Constants. ................................................................................... 684
Built-in Functions .................................................................................... 686
Angle and Trigonometry Functions . ................................................... 688
Exponential Functions . ....................................................................... 690
Common Functions. ............................................................................ 692
Floating-Point Pack and Unpack Functions . ....................................... 698
Contents
xvii
ptg9898810
Geometric Functions . ......................................................................... 700
Matrix Functions. ................................................................................ 702
Vector Relational Functions . ............................................................... 703
Integer Functions . ............................................................................... 705
Texture Functions. ............................................................................... 708
Atomic-Counter Functions. ................................................................. 722
Atomic Memory Functions ................................................................. 723
Image Functions . ................................................................................ 725
Fragment Processing Functions . .......................................................... 729
Noise Functions . .................................................................................. 731
Geometry Shader Functions . ............................................................... 732
Shader Invocation Control Functions . ............................................... 734
Shader Memory Control Functions. .................................................... 734
D. State Variables . .........................................................................................737
The Query Commands. ............................................................................ 738
OpenGL State Variables............................................................................ 745
Current Values and Associated Data.................................................... 746
Vertex Array Object State . ................................................................... 747
Vertex Array Data . ............................................................................... 749
Buffer Object State. .............................................................................. 750
Transformation State............................................................................ 751
Coloring State. ..................................................................................... 752
Rasterization State . .............................................................................. 753
Multisampling . .................................................................................... 755
Textures. ............................................................................................... 756
Textures. ............................................................................................... 759
Textures. ............................................................................................... 762
Textures. ............................................................................................... 764
Texture Environment . ......................................................................... 766
Pixel Operations................................................................................... 767
Framebuffer Controls . ......................................................................... 770
Framebuffer State . ............................................................................... 771
Framebuffer State . ............................................................................... 772
Frambuffer State................................................................................... 773
Renderbuffer State . .............................................................................. 775
Renderbuffer State . .............................................................................. 776
Pixel State . ........................................................................................... 778
xviii
Contents
ptg9898810
Shader Object State. ............................................................................. 781
Shader Program Pipeline Object State . ............................................... 782
Shader Program Object State . ............................................................. 783
Program Interface State . ...................................................................... 793
Program Object Resource State. ........................................................... 794
Vertex and Geometry Shader State ..................................................... 797
Query Object State . ............................................................................. 797
Image State .......................................................................................... 798
Transform Feedback State . .................................................................. 799
Atomic Counter State. ......................................................................... 800
Shader Storage Buffer State. ................................................................. 801
Sync Object State . ............................................................................... 802
Hints..................................................................................................... 803
Compute Dispatch State ...................................................................... 803
Implementation-Dependent Values . ................................................... 804
Tessellation Shader Implementation-Dependent Limits..................... 810
Geometry Shader Implementation-Dependent Limits . ...................... 813
Fragment Shader Implementation-Dependent Limits. ....................... 815
Implementation-Dependent Compute Shader Limits. ....................... 816
Implementation-Dependent Shader Limits . ....................................... 818
Implementation-Dependent Debug Output State . ............................. 823
Implementation-Dependent Values . ................................................... 824
Internal Format-Dependent Values ..................................................... 826
Implementation-Dependent Transform Feedback Limits . ................. 826
Framebuffer-Dependent Values ........................................................... 827
Miscellaneous . ..................................................................................... 827
E. Homogeneous Coordinates and Transformation Matrices . ....................829
Homogeneous Coordinates...................................................................... 830
Transforming Vertices . ............................................................................ 830
Transforming Normals . ........................................................................... 831
Transformation Matrices . ........................................................................ 831
Translation. .......................................................................................... 832
Scaling . ................................................................................................ 832
Rotation . .............................................................................................. 832
Perspective Projection . ........................................................................ 834
Orthographic Projection ...................................................................... 834
Contents
xix
剩余985页未读,继续阅读
2011-07-18 上传
2013-07-08 上传
459 浏览量
LuoDeng008
- 粉丝: 3
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Angular实现MarcHayek简历展示应用教程
- Crossbow Spot最新更新 - 获取Chrome扩展新闻
- 量子管道网络优化与Python实现
- Debian系统中APT缓存维护工具的使用方法与实践
- Python模块AccessControl的Windows64位安装文件介绍
- 掌握最新*** Fisher资讯,使用Google Chrome扩展
- Ember应用程序开发流程与环境配置指南
- EZPCOpenSDK_v5.1.2_build***版本更新详情
- Postcode-Finder:利用JavaScript和Google Geocode API实现
- AWS商业交易监控器:航线行为分析与营销策略制定
- AccessControl-4.0b6压缩包详细使用教程
- Python编程实践与技巧汇总
- 使用Sikuli和Python打造颜色求解器项目
- .Net基础视频教程:掌握GDI绘图技术
- 深入理解数据结构与JavaScript实践项目
- 双子座在线裁判系统:提高编程竞赛效率
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功