Are there huge differences in OpenGL 3.x vs 2.x? Is it waste of time learning OpenGL 2.x or are they both following the same concept? I think i read somewhere that 2.x was state based and that 3.x was not, is that correct?
6 Answers
Be careful. OpenGL 3 deprecates a lot of functions, especially those of the early days of OpenGL. If you start with outdated tutorials (like most of NeHe), you will most probably become accustomed an outdated style of OpenGL 2.
There is no fixed function pipeline in OpenGL 3 (if you don't use the backward compatibility features). You have to use shaders. There is no glBegin/glEnd anymore. You have to use vertex buffers. Both are already available in OpenGL 2, but most tutorials start with glBegin/glEnd and setting OpenGL color properties. This is a very important difference.
OpenGL 2 provides countless ways to put something on the screen, each of which is covered in at least one popular tutorial. OpenGL 3 drops many of them, including the "beginners' subset" of OpenGL 2 (fixed function glBegin/glEnd). So if you want to target OpenGL 3 in the long term, go for it right from the start. There's nothing more demotivating than being stuck in a dead end.
-
3OpenGL 3 doesn't drop anything. Deprecation means that it will be dropped in the future, not that it has been dropped. So long as one uses a full context, everything you're worrying about is still there. I seriously doubt drivers will drop support for the fixed function pipeline for a very long time, considering how much existing software uses it. Aug 16, 2009 at 16:39
-
12With OpenGL 3, in meant the whole 3.x family, and the recently released 3.2 actually drops deprecated functions. See "What's New in OpenGL 3.2", opengl.org/documentation/current_version : "OpenGL 3.2 and the companion OpenGL Shading Language 1.50 add many new features, while simultaneously simplifying the API and shading language by removing legacy fixed-functionality interfaces deprecated in OpenGL 3.0." Aug 16, 2009 at 19:56
-
Thanx Malte This is what i was worried about. And even if something is still there i want to learn the best way of doing things and the glBegin/End stuff does not seem to be that. So do you know where to find any opengl 3.x tutorials that does not start with the deperecated stuff? Aug 17, 2009 at 16:41
-
I afraid I don't. However, I can recommend the great OpenGL community at opengl.org/discussion_boards/ubbthreads.php . Probably some people in the beginners' forum know more about 3.x learning resources. And keep a copy of the official specification handy. Although it doesn't replace a tutorial, its well written and invaluable for corner cases. Aug 17, 2009 at 16:59
They're almost entirely backwards compatible, so anything you learn with an older version is going to apply to the later versions just fine. If you have to 'aim' somewhere in particular, 2.0 is probably a good choice. If you look at the OpenGL Wikipedia page, you can see what was added to the various versions, and decide for yourself which features you think you'll need.
-
1Man, people keep down voting me. Suck it up. I'll stand by this advice, particularly when there still isn't anyone whose popped up with GL 3 specific resources. You can learn shaders just fine working with 2.x, and if the method by which you feed geometry to GL even a small part of your task's difficulty, I wish I were in your shoes. Jul 12, 2010 at 16:32
I am reading through "Learning Modern 3D Graphics Programming", and while I don't have hardware to actually use OpenGL 3 yet, it's helping me get the concepts straight in my mind such that I should be able to ditch 1.1-style and move to 3 once I do have hardware to work with.
I think the modern shader only style is the future of OpenGL and real-time 3D graphics. I would suggest to start with OpenGL 3 right away. On the other hand the old-style deprecated OpenGL is easier to learn and it is easier to do simple things, without understanding the whole API.
But no matter if you skip the old-style fixed-function or not or if you use Direct3D or OpenGL, it is important that you also understand the principles and inner workings of a graphics pipeline, as I often (not always) see people, who have questions about OpenGL and why their code does not work and they seem to have no idea about computer graphics and what the respective OpenGL functions really do and mean.
EDIT: Also, have a look at this question for some book recommendations, depeding on you decision.
I find this tutorial very easy to follow and use and it is for OpenGL 3 http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html. Other tutorials you can find useful :
Learn whatever has the most learning materials written about it. NeHe's tutorials are a good place to start.
I did a little OpenGL work a few months ago, and while I don't remember the version I was programming to, I can tell you that it's the concepts that are the most important. This is especially true when you're just beginning and not dealing with shaders and whatnot.
(See Malte Clasen's answer.)
-
24I consider this advice dangerous: Not dealing with shaders results in learning the deprecated fixed function pipeline. The subset you apparently began with is not available in OpenGL 3 anymore. Aug 16, 2009 at 12:39
-
2I agree , OpenGL has changed vastly since Nehe Tutorials. And if you really want to take advantage of hardware acceleration , which most likely you will be insane to want to use OpenGL and not want to do this since there are tons more easy libraries out there to learn, Nehe will be of little use to you.– KilonFeb 7, 2012 at 10:14