OpenGL at the Ranch

or, "Hey Rocco, watch me pull a rabbit out of my hat!"

By Mark Dalrymple on November 10, 2006.
The Big Nerd Ranch has recently introduced an OpenGL Class. I travelled to Atlanta in September of 2006 for the first running of the class. It's been a couple of months since I returned home, and I'm still impressed.

First a disclaimer - I've written a book with the Big Nerd Ranch folks and Teach a Class There on a contractor basis. But I honestly believe in the Ranch Way, and think the OpenGL class is worthy peer in the Big Nerd Pantheon.

OK, on with the specifics.

Over the years I've attempted to learn OpenGL. I've read books (the Red Book, skimmed the Blue Book, read a number of mass-market OpenGL books, picked up some college text books), visited websites, but I never really learned OpenGL the way I've learned Cocoa or the traditional Unix API. If I don't have an immediate need like a project deadline, a weekend competition like Iron Coder, or a well-constructed course curriculum, the stuff I read goes into the trivia bin in my brain, but doesn't manifest itself as synthesized knowledge I can actually use.

So when I heard the Ranch was putting on an OpenGL course, I was really excited. Here's my chance to really put a new notch on my API belt.

The Facilities

Creature comforts are always important. The Big Nerd Ranch facility near Atlanta is located in a rural area outside of town (Here's a Google Earth KML file for the route from the airport to the Ranch). The facility is Historic Banning Mills, who do weddings, B & B things, retreats, and similar things on weekends, and during the week host stuff like the Big Nerd Ranch and corporate retreats. At the Ranch you get a nice spacious room with a Jacuzzi tub. There's also walking and hiking trails, an olympic-sized swimming pool (weather permitting), and miniature golf if you are so inclined. There is an internet connection in the class room, and TVs.

Outside of that, there's not much to do except eat, sleep, and learn. It's a very good environment for sustained concentration. The food is plentiful and very tasty. You don't go away from a Big Nerd Ranch class hungry. Be sure to bring some baggy clothes.

I enjoy going to the Ranch to "escape the world" and to totally geek out. Speaking of geeking out, half of the fun of a Big Nerd Ranch class is getting to know the other geekazoids you're spending a week with. In the first class we had a British Physician who climbs Everest (really), a composer, a 3D modeller, an orthodontist, a jazz drummer, several others, and I play musical instruments and make balloon animals. All very interesting people, also typical of a Ranch class - a wide, wide range of areas of knowledge and areas of interest. Mealtime conversation is never dull.

The Class

And then there's the class itself. Our instructor was Rocco Rowling. Rocco uses OpenGL for his day job writing data visualization software, and his night gig of writing award-winning mac computer games. He knows OpenGL cold. He also knows it from both sides of the aisle - simulation/visualization, and computer games. So if you're a hobbiest wanting to write the Next Great First-Person Eater Game, or you work for some Spooky Government Agency, Rocco has experience to draw upon to answer your questions. We had a lot of questions, and he knew the answers either knew off the top of his head, figured it out after a couple of minutes of cogitation, or knew where to find it, and found it.

Rocco is also a really nice guy - definitely not the kind of person that constantly tells you how smart he is. He's also an excellent instructor. The lectures were easy to follow, and he improvised things on the fly to help explain concepts. We were having problems visualizing some coordinate transforms to translate and rotate some cubes into the OpenGL camera's view. Rocco went upstairs snagged some pool cues and pool balls, and used them to demonstrate the concepts.

The typical Big Nerd Ranch course is divided into 20-25 different sections. Each section has about 20-30 minutes of lecture ("no longer than an episode of Friends" is the general guideline given by Aaron Hillegass, the principal big nerd), and then 30-90 minutes to work on the exercise. For the OpenGL class, the exercises were primarily "type stuff from the course notes and see cool stuff on the screen", along with challenges in case you got done with the primary exercises. One of my favorite challenges was putting a sphere inside of a transparent stained-glass box, and set the whole thing rotating. That one pulled together a lot of concepts from the sections that preceded it.

The course materials included the infamous OpenGL Red Book, as well as a 420 page set of course notes. Most of the class time was spent inside of the course notes, referring to the Red Book (and man pages) for specific information. The course notes include all of the slides right next to explanatory text and the exercises. The notes also make a nice reference.

A huge amount of OpenGL API is covered. The first exercise is the obligatory shaded rectangle in 2D, and our last exercise involved writing vertex and fragment shader programs that execute in the GPU. Along the way we met most everything in between, such as textures, colors, materials, normals, loading model files, optimization of static and dynamic data, mouse clicking on objects, fonts and text, and on and on.

One of the big strengths of a course like this, being with an expert, is learning what you don't need to know. There's a lot of stuff in the Red Book that's there for historical reasons, but are not terribly relevant for modern OpenGL programming. Rocco would tell us "you'll see this in the Red Book. You can skip over it. Do XYZ instead."

Rocco covers the generic OpenGL API available on other platforms, but also interjects a lot of OS X specific information. We got experience early-on with the OpenGL Profiler, with specific techniques involving quicktime movies and Core Video, grabbing the desktop image, as well as details on finding the performance sweet-spot for the platform.

If you're not on OS X, you won't be left out. All of the exercises are constructed so that you can follow the exercises on whatever platform or C-like language (C/C++/Objective-C) you choose. You may have to write a little driver program to do whatever platform-specific setup is necessary, but Rocco has things set up so that Mondays exercises can be done very generically, and then helps you construct program scaffolding that evening for you to use for the rest of the week.

The Bottom Line

As you can probably tell, I really enjoyed the class, and got a lot out of it. But is it worth $3500, plus travel to Atlanta? It depends, of course.

I program Macs for a living, and knowledge of OpenGL is becoming more useful as more of the rendering duties of the OS are getting offloaded to video cards. Plus I happen to work for a groovy place that believes in continuing education for its developers. I must say that it was one of the easiest trip expense reports I ever filed. Because room and board for the week is included in the price of the class, I only had to expense the class, the airfare, and some feedage at the airport on flying days.

Were I still a full-time contractor, I would have come to this class, a no-brainer. This cost was less than a week's billable time, and it would certainly take me more than a week to get myself jumpstarted on OpenGL learning it all on my own. Plus, a week at the Ranch is certainly much less stressful than trying to learn something like this on-the-job at a client gig (not that I've ever learned unfamiliar new stuff on a gig). And don't forget that includes a week with a jacuzzi tub in a positively beautiful setting, with lots and lots of really good food. If you need to get up to speed on OpenGL quickly, this is certainly the way to go.

borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book