4
\$\begingroup\$

I was reading about OpenGL, and found out the Red Book is a great book for me to read to learn. I then read that even though they have 3.x and 4.x versions, I should still stick to 2.x so I don't create an artificial limit on who can play my game (older computers with older but powerful graphics cards would not be able to run 3.x and 4.x GL software).

So where do I start? I'm lost. Which book? I have no problem reading the 2.x version of the Red Book, which I believe is this one: http://www.amazon.com/OpenGL-Programming-Guide-Official-Learning/dp/0321335732/ref=sr_1_2?ie=UTF8&qid=1290869828&sr=8-2 but I won't know whats deprecated :(

cry for help

\$\endgroup\$
6
  • 1
    \$\begingroup\$ This is practically the same question as this: gamedev.stackexchange.com/questions/1606/… \$\endgroup\$
    – Tetrad
    Commented Nov 27, 2010 at 15:00
  • \$\begingroup\$ Simple google result that would help: developer.nvidia.com/object/opengl_driver.html \$\endgroup\$
    – Tetrad
    Commented Nov 27, 2010 at 15:01
  • \$\begingroup\$ And -1 to you if I could, Tetrad. I didn't ask if it was pointless learning OpenGL 2.x, 3.x or 4.x. I asked WHICH book I should use as the best reference. \$\endgroup\$ Commented Nov 27, 2010 at 16:03
  • 1
    \$\begingroup\$ shadowprotocol, then your question is worded totally wrongly. The title indicates whether to choose GL 2.x-4.x, whereas you're meaning books. \$\endgroup\$ Commented Nov 27, 2010 at 18:14
  • \$\begingroup\$ @Duck: If so, it's a dupe of another question: gamedev.stackexchange.com/q/1128 \$\endgroup\$
    – greyfade
    Commented Nov 27, 2010 at 22:07

2 Answers 2

3
\$\begingroup\$

http://www.amazon.com/OpenGL-SuperBible-Comprehensive-Tutorial-Reference/dp/0321712617/ref=sr_1_1?ie=UTF8&s=books&qid=1290941052&sr=8-1

With shaders, it's possible to use OpenGL 2.1 without the fixed function pipeline that is deprecated in versions 3.x and later.

\$\endgroup\$
14
\$\begingroup\$

I have used OpenGL 2 for many years, and I have just recently learned the basics of OpenGL 3. Having learned both, I would recommend without a doubt that you learn OpenGL 2 first. And I wouldn't even say "avoid using functions which are deprecated in OpenGL 3", because pretty much everything is deprecated in OpenGL 3. Basically, OpenGL 3 is ridiculously hard for a newbie to learn, so you should first learn OpenGL 2 and then read up on what it takes to get OpenGL 3 working.

In OpenGL 2, there are two modes of sending mesh data to the GPU -- "immediate mode" (glBegin, glVertex, glEnd) and "retained mode" (vertex buffers and so on). And then there are two ways to have your meshes displayed -- "fixed functionality" (the graphics card will automatically transform your vertices into the correct place on the screen, perform simple lighting calculations, etc) or "custom shaders" (you must write all the transformation and lighting calculations yourself in a language called GLSL).

So whenever you use OpenGL 2, you must make those two orthogonal choices: immediate vs retained, and fixed functionality vs custom shaders. Immediate is easier than retained, and fixed is easier than shaders. But the immediate mode is awful for performance (as you must send the full mesh data to the GPU every single frame), and the fixed functionality will not work for any effects you might have seen in the last 8 years or so, like bump mapping and phong shading. So both immediate mode and fixed functionality have been removed from OpenGL 3.

That's why I recommend you learn OpenGL 2 first. Maybe try immediate mode with fixed functionality. Then go up to retained mode (use vertex buffers). Then try writing a custom vertex and fragment shader in GLSL. Only once you have mastered all of that will you be able to even think about not using any of the deprecated functions (since in OpenGL 3, you must always use retained mode and write your own shaders). Finally, you will be able to switch over to OpenGL 3.

If you are actually releasing a game, OpenGL 2 is fine and will be supported for many years. But there is still a good reason to be using retained mode (speed) and custom shaders (better lighting and cool effects).

\$\endgroup\$
2
  • 2
    \$\begingroup\$ Great summary of the changes to OpenGL3 \$\endgroup\$
    – Ken
    Commented Sep 19, 2011 at 20:50
  • \$\begingroup\$ Which online tutorials can you recommend, specifically? \$\endgroup\$ Commented Dec 14, 2012 at 4:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .