28

I'm a beginner with OpenGL ES 2.0 and I'm looking for a good book/resource that will help me with my learning. I've found several books:

  • OpenGL® ES 2.0 Programming Guide
  • iPhone 3D Programming: Developing Graphical Applications with OpenGL ES

but reading the Amazon reviews I saw that they either assume previous knowledge with OpenGL or are not written specifically for iOS. (I know OpenGL should be easy to port, but I'm looking for a book/resource with examples in C, not C++, that talks about OpenGL in the iOS context)

I also found this and it really helped me getting a grasp on the basic concepts, but unfortunately, they cover OpenGL ES 1.1 and are only describing the basics.

Any help would be appreciated!

Rad'Val
  • 8,895
  • 9
  • 62
  • 92
  • 2
    For the one that voted to close: how is this off topic? I'm not asking advice on a cooking book. Do you care to explain? – Rad'Val Dec 12 '11 at 23:51

4 Answers4

62

It's a lot easier to find OpenGL ES 2.0 material for iOS (or any OS, really) than it used to be a year or so ago.

For something written from a pure iOS perspective, it's hard to beat Jeff LaMarche's chapters from his unpublished book, which start here. You linked to his OpenGL ES 1.1 tutorials, which are also great, but he didn't place his newer 2.0 material on that list.

iPhone 3D Programming by Philip Rideout is a great book that covers both OpenGL ES 1.1 and 2.0. It does not assume that you know OpenGL ES, and he does explain a good bit of the math and other fundamentals required to understand what he's talking about. He gets into some pretty advanced techniques towards the end. However, all of his code is in C++, rather than Objective-C, so that may be a little disconcerting for someone used to Cocoa development. Still, the core C API for OpenGL ES is the same, so it's easy to see what's going on.

If you're looking for particular effects, the OpenGL Shading Language book is still one of the primary resources you can refer to. While written for desktop OpenGL, most of the shading language and shaders presented there translate directly across to OpenGL ES 2.0, with only a little modification required.

The books ShaderX6, ShaderX7, GPU Pro, and GPU Pro 2 also have sections devoted to OpenGL ES 2.0, which provide some rendering and tuning hints that you won't find elsewhere. Those are more advanced (and expensive) books, though.

If you're just getting started with OpenGL ES 2.0, it might not be a bad idea to start using GLKit (available only on iOS 5.0), which simplifies some of the normal setup chores around your render buffers and simple shader-based effects. Apple's WWDC 2011 videos have some good material on this, but their 2009 and 2010 videos (if you can find them, some are available at apple archive) provide a lot more introductory material around OpenGL ES 2.0.

Finally, as Andy mentions, I taught a class on the subject as part of my course on iTunes U, which you can download for free here. The course notes for that class can be found here or downloaded as a VoodooPad file here. I warn you that I go a little technical quite fast in the OpenGL ES 2.0 session, so you may want to watch the 1.1 session from the previous semester here. I also talk a little bit about what I've done with OpenGL ES 2.0 in this article about my open source application (whose source code can be grabbed from here, if you'd like to play with a functional OpenGL ES 2.0 iOS application).

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • 2
    Thank you for this very detailed answer Brad! I can't believe I missed Jeff LaMarche's chapters on OpenGL ES 2.0. Thanks again! – Rad'Val Dec 14 '11 at 14:14
  • Hi Brad, Is there an update to your course for ios 5+, arc, etc? – Dave Kliman Feb 09 '12 at 17:31
  • @DaveKliman - Unfortunately, no. I don't currently have the time to teach the class again. However, I found that very little changed in the way that I taught the class between iPhone OS 3.0 and iOS 4.0, so I don't imagine that things would be dramatically different if I were to revisit this now with iOS 5.0. I will be giving a talk at CocoaConf on ARC, so I'll probably accompany that with a detailed article on the subject. I'm not sure if the video for that will be made available. – Brad Larson Feb 09 '12 at 17:41
  • that would be cool... I'm saving your stuff for when i finish cs193p. I have been getting used to internally filtering all the retain/release/dealoc stuff though... i hope to not ever have to use that.. – Dave Kliman Feb 09 '12 at 20:56
  • @brad I was watching one of your lectures today and you used something like CGReleaseContext. Does ARC take care of all of those now or do I still have to use them? The documentation seems to imply I CAN use that, but do I HAVE to? – Dave Kliman Feb 29 '12 at 03:31
  • 1
    @DaveKliman - Yes, you still have to. Core Foundation objects (ones managed through CFRetain and CFRelease) are not handled by ARC. Neither are raw memory ranges that you use malloc() and the like to create. I talk a little more about this here: http://stackoverflow.com/a/6388601/19679 , and you should read Mike Ash's description of the bridging aspects of this: http://www.mikeash.com/pyblog/friday-qa-2011-09-30-automatic-reference-counting.html because that can get tricky in certain situations. – Brad Larson Feb 29 '12 at 16:40
  • @BradLarson: Sir, your link to Jeff LaMarche book, is no longer valid. Any idea about this? Googling didnt help. Ended up on other blogs referring to same outdated link(as well as links in source code of GPUImage points to the old blog). – saurabheights May 08 '17 at 08:17
  • @saurabheights - Best I can do is grab the Wayback Machine link for that, since I think Jeff took down his whole blog. – Brad Larson May 09 '17 at 00:22
  • @BradLarson: Thank you for introducing Wayback machine. I will update the link as well in the answer. Edit: - Looks like you have already updated the link. – saurabheights May 09 '17 at 02:51
5

I would highly recommend Brad Larson's session on OpenGl ES 2.0 from iTunes U. It's pretty in depth, I found it very helpful. You can find it here.

Andy B
  • 515
  • 2
  • 5
  • 15
0

I read the books you listed, the first especially is great - but it only went a very short way for GL ES (I already knew desktop GL, and I still had to fill in a lot of "gaps").

I've written a series of blog posts on doing ES 2 "correctly" on iOS - i.e. only using the modern GL commands, using Apple's GLKit as much as possible to save time / reduce typing, avoidingin pitfalls / gotchas from the Apple-specific hardware (PVR chips), etc.

Index here: http://t-machine.org/index.php/2013/08/29/glkit-to-the-max-opengl-es-2-0-for-ios-part-1-features/

Adam
  • 32,900
  • 16
  • 126
  • 153
0

For Leaning very basic of open GL for iOs I would suggest to have a look at this http://antonholmquist.com/blog/opengl-es-2-0-ios-tutorial-getting-started/. This gives the basic idea of vertex and fragment shaders. After going through this a beginner can go through other tutorials which explains the detailed concepts of openGL.