EARTH WEEK
Go paperless and save 40% on eligible eBooks, 70% on video now through April 26. Shop the sale.
Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
OpenGL® ES™ is the industry’s leading software interface and graphics library for rendering sophisticated 3D graphics on handheld and embedded devices. The newest version, OpenGL ES 3.0, makes it possible to create stunning visuals for new games and apps, without compromising device performance or battery life.In the OpenGL® ES™ 3.0 Programming Guide, Second Edition, the authors cover the entire API and Shading Language. They carefully introduce OpenGL ES 3.0 features such as shadow mapping, instancing, multiple render targets, uniform buffer objects, texture compression, program binaries, and transform feedback.
Through detailed, downloadable C-based code examples, you’ll learn how to set up and program every aspect of the graphics pipeline. Step by step, you’ll move from introductory techniques all the way to advanced per-pixel lighting and particle systems. Throughout, you’ll find cutting-edge tips for optimizing performance, maximizing efficiency with both the API and hardware, and fully leveraging OpenGL ES 3.0 in a wide spectrum of applications.
All code has been built and tested on iOS 7, Android 4.3, Windows (OpenGL ES 3.0 Emulation), and Ubuntu Linux, and the authors demonstrate how to build OpenGL ES code for each platform.
Coverage includes
This edition of the book includes a color insert of the OpenGL ES 3.0 API and OpenGL ES Shading Language 3.0 Reference Cards created by Khronos. The reference cards contain a complete list of all of the functions in OpenGL ES 3.0 along with all of the types, operators, qualifiers, built-ins, and functions in the OpenGL ES Shading Language.
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
Chapter 1: Introduction to OpenGL ES 3.0 1
OpenGL ES 3.0 3
What’s New in OpenGL ES 3.0 11
OpenGL ES 3.0 and Backward Compatibility 17
EGL 19
EGL Command Syntax 20
OpenGL ES Command Syntax 21
Error Handling 22
Basic State Management 23
Further Reading 25
Chapter 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
Chapter 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