RenderingPipeline

from geometry to pixels

Learning OpenGL

Back in the days when I started with OpenGL the question where to start was often answered in the same way: Get a copy of the Redbook and/or look at the NeHe Tutorials. Since then OpenGL has moved on but these ressources not so much. The Redbook covers also more modern OpenGL but still starts with the outdated immediate and does not tell you what to do and what better not to do anymore – it just presents both ways. Nehe marked the old tutorials as ‘legacy’ and seem to prepare new one, which is a good thing.

So when I get asked today what good resources there are for beginners wanting to learn OpenGL it’s harder to answer that than ever. But diving into modern OpenGL has become a bit more complicated: You need shaders, you have to work with transformation matrices, geometry gets defined in arrays/buffers… I can see the benefit of presenting the immediate mode first together with the fixed-function pipeline, it’s simpler to learn. It is also a waste of time as this is not helpful for any modern real world OpenGL application. If you want to do mobile OpenGL ES apps, WebGL in your browser or modern OpenGL on MacOS X, you can’t even use the old fixed functionality – it’s not a performance limitation, glBegin is just not there!

So, if you want to learn OpenGL, bite the bullet and avoid all tutorials and books that want to tell you that glBegin() is good idea.

For absolute beginners, I have found two very good online tutorials:

In case you like dead trees, try the very good OpenGL ES 2.0 Programming Guide by Aaftab Munshi et al. OpenGL ES is a bit different from desktop GL, but it forces you to use more modern concepts. What you learn there can be adapted quite easily to desktop GL.

Also a very good beginners book is OpenGL 4.0 Shading Language Cookbook by David Wolff. It only covers the shading language of OpenGL and some glue-code to set up shaders but as OpenGL gets more and more programmable this really covers a lot of GL. A huge plus of this book is that it contains practical solutions for common problems (like lighting, basic texturing etc). It is a good companion to a more general OpenGL tutorial or book.

WebGL made it easy to deploy OpenGL samples, so grab a WebGL capable browser and have a look at ShaderToy by Inigo Quilez. This app lets you play around (=code) fragment shaders in your browser and instantly check the results. Definitely a good way of losing the fear of those little programs.

Having a copy of the OpenGL specs is often handy, but these are not good for teaching you what to do, they are only good in telling you what exactly a function does and which side-effects it can have.

Problems with all the math or just general concepts of 3D graphics? The book Real-Time Rendering by Tomas Akenine-Möller is a very good graphics textbook. It has also a good website with further information.

If you know other good resources for beginners, drop me a comment.

 

, , , , ,

5 thoughts on “Learning OpenGL
  • Mathieu says:

    Thank you! I realised that the nehe tutorials are somewhat deprecated and I’ve been searching like crazy for an up-to-date tutorial.

  • Nandy says:

    Hi I have been trying to work the tutorial by Jason L. McKesson but my graphics card supports only opengl 3.1 and GLSL 1.3. I have made some changes in framework.cpp but the it does not run. Please suggest the changes that I’ll have to make

    • Robert says:

      Hello Nandy,
      as I don’t know what you changed or what problems you currently still have, it would be better if you would contact Jason with all the details directly or ask them in the OpenGL forums at opengl.org.

  • fenbf says:

    I’ve recently written an article about learning about modern OpenGL. I focused on books, but I tried to include also web sites as well.

    Learning Modern OpenGL

    Hopefully it has some value to you

  • shadowofthecolossus says:

    For absolute beginners:
    http://learnopengl.com/

Leave a Reply

Your email address will not be published. Required fields are marked *

*