10 Things nobody tells the OpenGL noob
I’ve been curious about diving into some real Graphics stuff, as far as I remember from last few years. And because I didn’t get any related education at my college or from anyone I knew, I just had to somehow rely on my destiny and the Internet, or both.
From my experience as a self taught OpenGL programmer, I’ve made a list of things for anyone else backpacking into the wild and adventurous world of graphics.
Read a lot: The whole OpenGL thing is like a big cotton ball that you have to unroll, read as much as you can, there are plenty of experienced people out there ranting about different aspects of graphics programming, try to read them all, even if you don’t understand it now, you will someday. The Redbook should be your first book: I think thats all is there to say, I actually read 3 books before getting hold of The Redbook. It’s must for all OpenGL noobs, and it’s even suggested on the official OpenGL website. If you think you’re interested in coding for mobile platforms and this book is for desktop only, you’re making the same mistake I made. This book has lots of simple sample code that would make it easier for you to digest the thing one at a time. Open GL ES is the advanced level: If you’re like me coming from mobile platform, don’t try to rush to ES. Just like you can’t play Mario level 1-4 before dying in 1-1 a couple of times, you can’t play around with ES without the fundamentals. Always remember that the ES is an advanced level and after a while you would love to jump back to simple GLUT based programming on your desktop for drawing polygons and modelview transformations, so get a strong hold of it. It takes time: Even if you’ve a fair amount of experience with a Saxophone, you can not just pick up the guitar and expect to play like Jimi Hendrix in few days. OpenGL is a huge API, and it takes a lot of time to master the art. You can render few interesting things if you are a fast learner, but building big things take lot of practical experience. And the bigger your code grows the more complicated it will become, and the bigger the code, more knowledge of the fundaments you’ll need. Be patient and learn. Practice: Always remember the only shortcut to mastering something is by practicing it as much as you can, every great programmer out there one day started just like you and me. Try writing small programs that achieve little things like drawing an specific shape, or playing around with a specific effect. The bottom line is write small, write too many before you start with your first big one. Experiment: I could’ve easily merged this point with the one above it, but the greatest thing with OpenGL is there are plenty of effects to be achieved, its like building a dream sequence, often I start coding with drawing a simple circle but after few hours its the entire galaxy. Don’t hold yourself with the code you’ve just read in the book or blog, try to experiments with things, you are probably going to find more than expected. Don’t hesitate to refractor the code upside down. Refresh your mathematics: One of the big part of OpenGL is mathematics, refresh all that you learned in school or college, algebra, geometry. All your mathematics is going to come to life! Don’t give up: If you start you coding session with something particular in your head, just don’t give up until you get the result, always remember its an API after all, it’s not like you need to know a particular thing before trying out something else. I often find jumping around and trying out several things to build whatever is in my head as one of the best learning sessions. Build something interesting as a side project: Whenever you start swimming around the OpenGL pool, keep a project in your head, it could be a small movie or a replica of your fav. game, or the layout of your neighborhood, keep one big thing on your side and try to keep refining it with things as you learn, that way you will have something to show off to your friends every sometime. Don’t die in isolation: Worse thing that can happen to you is, midway you might get stuck on something you can’t get over and that can kill your enthusiasm of learning, particularly if you’ve nobody experienced around you. The solution is to get involved, there are plenty of experienced people out there, follow them on twitter and read their blogs, read discussions on forums like stackoverflow, and read all the possible answers to the questions, everything is helpful, and don’t hesitate to ask even the dumbest thing. Being curious is a good thing.