Save 40% on books and eBooks + 70% on videos now through May 31*—use code PROGRAM. Shop now.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
MOBI The eBook format compatible with the Amazon Kindle and Amazon Kindle applications.
PDF The popular standard, used most often with the free Adobe® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
Also available in other formats.
Register your product to gain access to bonus material or receive a coupon.
Get Started Fast with Modern OpenGL ES Graphics Programming for iPhone, iPod touch, and iPad
OpenGL ES technology underlies the user interface and graphical capabilities of Apple’s iPhone, iPod touch, and iPad–as well as devices ranging from video-game consoles and aircraft-cockpit displays to non-Apple smartphones. In this friendly, thorough introduction, Erik M. Buck shows how to make the most of Open GL ES in Apple’s iOS environment.
This highly anticipated title focuses on modern, efficient approaches that use the newest versions of OpenGL ES, helping you avoid the irrelevant, obsolete, and misleading techniques that litter the Internet. Buck embraces Objective-C and Cocoa Touch, showing how to leverage Apple’s powerful, elegant GLKit framework to maximize your productivity, achieve tight platform integration, and deliver exceptionally polished apps.
If you’ve written C or C++ code and know object-oriented programming basics, this title brings together everything you need to fully master OpenGL ES graphics for iOS–including downloadable examples specifically designed to jumpstart your own projects.
• Understanding core OpenGL ES computer graphics concepts and iOS graphics architecture
• Integrating Cocoa Touch with OpenGL ES to leverage the power of Apple’s platform
• Creating textures from start to finish: opacity, blending, multi-texturing, and compression
• Simulating ambient, diffuse, and specular light
• Using transformations to render 3D geometric objects from any point of view
• Animating scenes by controlling time through application logic
• Partitioning data to draw expansive outdoor scenes with rolling terrain
• Detecting and handling user interaction with 3D geometry
• Implementing special effects ranging from skyboxes to particles and billboards
• Systematically optimizing graphics performance
• Understanding the essential linear algebra concepts used in computer graphics
• Designing and constructing a complete simulation that incorporates everything you’ve learned
1 Using Modern Mobile Graphics Hardware 1
What Is 3D Rendering? 2
Supplying the Graphics Processor with Data 4
The OpenGL ES Context 9
The Geometry of a 3D Scene 9
2 Making the Hardware Work for You 19
Drawing a Core Animation Layer with OpenGL ES 19
Combining Cocoa Touch with OpenGL ES 22
The OpenGLES_Ch2_1 Example 27
Deep Dive: How Does GLKView Work? 42
Extrapolating from GLKit 51
3 Textures 59
What Is a Texture? 59
The OpenGLES_Ch3_1 Example 65
Deep Dive: How Does GLKTextureLoader Work? 69
The OpenGLES_Ch3_3 Example 76
Opacity, Blending, and Multi-Texturing 77
Texture Compression 84
4 Shedding Some Light 87
Ambient, Diffuse, and Specular Light 88
Calculating How Much Light Hits Each Triangle 90
Using GLKit Lighting 95
The OpenGLES_Ch4_1 Example 97
Bake Lighting into Textures 104
Fragment Operations 105
5 Changing Your Point of View 107
The Depth Render Buffer 107
The OpenGLES_Ch5_1 and OpenGLES_Ch5_2 Examples 109
Deep Dive: Adding a Depth Buffer Without GLKKit 115
Transformation Cookbook 129
Perspective and the Viewing Frustum 130
6 Animation 133
Motion Within a Scene: The OpenGLES_Ch6_1 Example 134
Animating Vertex Data 140
Animating Colors and Lights: The OpenGLES_Ch6_3 Example 148
Animating Textures 153
7 Loading and Using Models 159
Modeling Tools and Formats 160
Reading modelplist Files 165
The OpenGLES_Ch7_1 Example 168
Advanced Models 172
8 Special Effects 183
Deep Dive: How Does GLKSkyboxEffect Work? 186
9 Optimization 217
Render as Little as Possible 218
Don’t Guess: Profile 232
Minimize Buffer Copying 234
Minimize State Changes 235
10 Terrain and Picking 237
Terrain Implementation 237
Adding Models 249
OpenGL ES Camera 253
11 Math Cheat Sheet 277
Decoding a Matrix 279
Surviving Graphics Math 297
12 Putting It All Together 303
Everything All the Time 306
Device Motion 323