Monday, June 14, 2010

Announcing OpenGL ES 2.0 for iOS 4

Okay, it's finally time for me to announce Super Secret Project B, which is a new book I'm writing on OpenGL ES 2.0 for iPhone, iPad, and iPod touch.

Yes, I know I said I wouldn't be writing any books in 2010, but the nice folks at the Pragmatic Programmers approached me after I made that statement with an economically feasible way for me to write a book this year. I couldn't say no.

My original plan had been to take my OpenGL ES from the Ground Up blog posts, supplement them, and turn them into a book with step-by-step projects to reinforce the points of each posts. My week at WWDC has caused me to change that approach. I went to all the OpenGL ES sessions and spent a fair amount of time bending the ear of Allan Schaffer, Apple's Graphics and Games Evangelist, as well as a number of Apple engineers who work on or with OpenGL. After a lot of hard thought, I came to the conclusion that the approach needed to change. Although modern hardware supports the fixed pipeline, Apple has stopped making phones that require OpenGL ES 1.1. The iPhone 3GS, iPhone 4, and iPad all not only support OpenGL ES 2.0, but they all require it if you want to take full advantage of the hardware.

OpenGL ES from the Ground Up, however, focused on the OpenGL ES 1.1 fixed pipeline.

Since OpenGL ES doesn't maintain backward compatibility the way workstation OpenGL does, much of the material from the fixed pipeline, such as lights, the model view and projection matrix, and the stock functions for submitting vertex, texture, and normal data are all gone from OpenGL ES 2.0. Instead, you have to handle all that work manually when you write your shaders. Shaders add some complexity to the process, but give you a tremendous amount of power and the ability to write more efficient OpenGL code.

In the Desktop world, it still makes sense to learn immediate mode first, then regular fixed pipeline, and then finally the programmable pipeline, because workstation OpenGL maintains nearly 100% backwards compatibility across releases, and you can get up and running quickly. On Workstation OpenGL ES, you can even mix and match the different modes, accessing the model view matrix and lights from your shaders. That's not the case with OpenGL ES, so spending a few hundred pages teaching things that won't be applicable to the programmable pipeline seemed like a poor use of time, both mine, and my readers'.

But, for the new programmer, the programmable pipeline is really hard to grok. I've been banging my head this past week looking for a way to present that rather complex topic in a way that people without prior graphics or OpenGL ES experience will be able to understand.

Thanks to a lot of people willing to talk with me, I think I've come up with an approach that will work, and I'm really excited about it. So, if you find OpenGL ES confusing, especially if you find the programmable pipeline and shaders confusing, look out for OpenGL ES 2.0 for iOS4. I don't have a release date yet, but I will post here when I have updated information about the production schedule.


Rich said...

YAY!!! I am really looking forward to this book! The Beginning iPhone books helped me a lot, as did your OpenGL ES tutorials.

imabuddha said...

Wow, I look forward to reading this book, hopefully later this year. Go Jeff, GO! :)

Gryzor said...

One of the things that every OpenGL (and ES) and maybe DirectX too fails to help with (especially those book aimed at new programmers in that field) is to give the student a practical example. Drawing cubes and spheres is something that one can possibly find by googling; If you’re going to make a game (or something that needs OpenGL) you need to see the whole OpenGL picture in action. Otherwise any book is nothing more than a collection of samples and tutorials.

The whole picture, we need to see the whole picture. Not the “RotateThisCube” method inside a button added in XCode… that’s not a real world example.

Other than that, good luck and looking forwards taking a look at your book. In fact, make it PDF too! :)

Greg Pyles said...


Fantastic news. I really like the Pragmatic Press publishing system and I also love your writing style. Looks like a great combo!

Ken Pespisa said...

Looking forward to reading this book!

NickLudlam said...

Fantastic, this really makes me happy. I'm going through the "OpenGL ES 2.0 Programming Guide" book at the moment, and I'd love to have another so I can compare and flip between the two.

I'm at a point where I feel I've got enough out of CoreGraphics+CoreAnimation to make the leap. How soon do you think it'll be before there's a Work In Progress that some of us can check out?

aman said...

i dont think i couldve gotten onto open gl at all without your blog. it's always been a great help. can't wait for the book. best of luck!

Jeff LaMarche said...


I understand your concerns, but it's also true that people need to walk before they run. If the first program you give somebody is a Half-Life model with 3,000 vertices, the complexity of the data is going to get in the way of learning.

I do plan on getting into how to load models from files. Ideally, I'd like to get into skeletal animation by the end of the book, but I'm not sure I'm going to have enough pages availablel.

Daniel said...

I am really looking forward to read your book. I have been working with opengles 1 since my time at the university (or better desktop opengl without shaders) and find it, like you say, really hard to apreciate shaders. Because, you have more work to do to get to a point where you see the first results and you have to do everything on your own what is already given to you for free in the fixed-function pipeline.
But really the main question that is in my head since i have been trying to apreciate opengles 2.0 is: "What is the recommended way to construct your model-view transformation?" since glRotate/Scale.... etc are gone? Should i do them in the regular code or the shaders? if i do them in the shaders, how do i accomodate for different objects that need different rotations/translations/...?
Maybe someone can answer that question for me. Or i simply what for the book :-)


The Bar said...

I'm also looking forward to reading this book.
It is really a privilege to read these blog and this book will certainly be a great tool.
Thank you Jeff for changing your mind!

Jeff LaMarche said...


We'll cover that. In general, matrix multiplications are using floating point values and the GPU is better at them than the CPU, so you usually do them in the shader. It's also easier, since GLSL understands the * operator to mean matrix multiplication when using vec or mat datatypes.

There are times when doing matrix multiplication in your application code makes sense, but I default to the shader.


a random John said...


As someone who has done a lot of work with the 1.1 stuff and none with 2.0 and shaders I am really looking forward to this.

Ricky said...

Woah, can't wait!

iMan said...

As your beginning iphone developpment book combined with the next one made me almost an iphone developper (my first app is about to be available), I am really excited about this plan B. Thx again and very good look for this project.
Sorry for my english by the way.
Iman from Paris.

David Birdsall said...

Whoo hoo! Smashing stuff!

aaron said...

This is very exciting Jeff! I will definitely be buying a copy.

TerryG said...

AWESOME!! I enjoyed your OpenGL ES tutorial posts a lot as it bring practical examples, with just enough math, to arouse the reader's interest to find out more on their own. I certainly hope your book will better than other textbooks - anyone will fall asleep by page 2 in a 500-page textbook.
Way to go Jeff!

Edgar Schmidt said...

Wow. These are awesome news. I've always been curious about OpenGL and this book may be just what I needed. Thanks Jeff and good luck. You and the people from Pragmatic Library sounds like an incredible combo!

Patrick Alessi said...


I'm curious to know why you are doing this book for Pragmatic and not Apress.

I'm really looking forward to it. My next project will definitely be Open GL based and I already have tons of questions that I'm sure that your book will answer.

Good luck!


Jeff LaMarche said...


There's really no story other than what I said. Prags worked with me to help me find a way to making writing a book this year economically feasible in a way that Apress wasn't able to do. My contractual obligations to Apress were completed, so there was no reason for me not to consider other options.

I'm still on good terms with Apress and there hasn't been any kind of "falling out" if you're looking for dirt. :) It was the only option for me to write the book I wanted to this year and I decided to take it.


Morten said...

Hmm. This means that I can't use your book to develop for my 2nd generation iPod. Another reason to get a iPad when they're available in Denmark...

Vittorio said...

i was really looking for a book on opengles! it's great to hear that one is coming from you! :)

Arron said...

I'm looking forward to this book too. Although I'm already competent with ES2.0, I wouldn't mind taking a read as I always find your books and blogs top-notch.

I'm also looking forward to see how you present the maths, what with the matrix stack and associated manipulative functions being removed.

Patrick Alessi said...


Thanks for the response, I know that my query was kind of personal. I wasn't looking for dirt, just a little insight, and as usual, you delivered with honesty.

I truly value your opinion. As I am just beginning in the authorship realm, I am trying to pick up any industry tidbits anywhere that I can.

Thanks again.


Sean Doyle said...

One thing that would be great for your book would be a section on the efficiency of shaders. In my code I have a number of small changes that change the iPad's fps from 60 to 10 - and it's not completely obvious to me how to proceed. Is it the number of texture accesses or one of the computations in the shader? Laying out these tradeoffs would be a great chapter :-).

Jeff LaMarche said...


That would be a great chapter. Unfortunately, those things can be somewhat hardware dependent. Probably better to talk about some of the tradeoffs and the decisions you can make to adjust for imbalances between GPU and CPU usage and things you can do to avoid frame fill issues.


kaplandj said...

That's awesome. Congrats. I was thinking during the WWDC a book like this was needed.

Joe said...

Awesome! You're guaranteed a sale here. I hope you can kick some butt and get this baby out soon, there's most definitely a need for a book like this. Thanks for all you do Jeff.

PJ Cabrera said...

That's great news, Jeff! Congrats!

This is definitely one book I'm buying as soon as it's available. I have been a Pragmatic Programmers Beta book customer for a few years. Hopefully you'll do the pre-release Beta thing. :-)

Karib said...

This is really great news Jeff!
I learn iPhone programming from your books Beginning iPhone 3 Development, More iPhone 3 Development, as well as your OpenGL ES tutorial series. Currently I am developing a game in OpenGL ES 1.1 (targeted to be at AppStore by end of July 2010) and wish to learn more on OpenGL ES 2.0. So, I am really looking forward for this book.

Ben said...

Your books are really great and I'm buying this one the day it comes out. Keep us posted!!

mrcalonso said...


I've written comments in other posts of your blog because some time ago I came across your OpenGL ES tutorial and I couldn't download the XCode template in which it is based because the server seems unreachable. I'm really interested in following your tutorial, please, can you advice me on how to get the template?
Thanks in advance.

Geek PC Service said...

Jeff, because of reading your Open GL tutorial as well as some other books, I was able to make an App called 3D monkey and put it on the App Store. Prior to that I had no experience in Open GL at all.

I want to thank you so much for share your knowledge with us. You are the best!! Looking forward to your new book!!

Pavel said...

Our Java developers are experts in BlackBerry® Java Development Environment including the deep understanding of tools and APIs. Professional BlackBerry mobile application development expertise is essential to utilize the APIs to build effective wireless applications.
java software company | software development company | java web development | blackberry application development | iphone application development | android application development | java outsourcing | it outsourcing services |

SEO Services Consultants said...

Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck! Web Design Company