Jump to content
  • Advertisement
Sign in to follow this  
Tigro

OpenGL A good plan for learning OpenGL

This topic is 2049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This year at my Uni, we're starting a course of OpenGL. The professor gave us full freedom as to what library we use along with it and what version of OpenGL we use for our projects but the lectures will be centered around FreeGLUT and OpenGL 2.1. Could anybody more accustomed to OpenGL suggest me whether I should stick to such couple or choose something different?

 

I have absolutely no experience with OpenGL, if that matters. Also, as for the language I don't have any specific preferences. If I were to point one or two I like the most, I'd probably say C++ and Python. Of course I tried googling it and asking around but couldn't find anything - I just heard that FreeGLUT is quite basic and there are more convenient and more rewarding library to learn like SFML, GML and SDL. Also, apparently 2.1 is quite old version of OpenGL and the newer ones - based solely on shaders or so I've heard - are the standard which should be used...

 

Being quite confused on the matter, I kindly ask for your opinions. Which version should I learn if that's my start with OpenGL? What library to go with it?

Edited by Tigro

Share this post


Link to post
Share on other sites
Advertisement

The issue here is that while I could recommend you OpenGL 3+, it won't help you with the course since the API changed quite a bit from OpenGL 2 to OpenGL 3 (and above).

 

FreeGLUT isn't an engine, far from it. Its just a library to set up some things, create the window, swap buffers, I think it has some geometry utility functions too, but that's it. No "engine" there.

Share this post


Link to post
Share on other sites

Sorry, of course I messed up - meant "library" where "engine" stood. Edited just now.

 

Thank you for your post. I guess I wouldn't mind the API changing since the prof clearly stated he isn't interested in the version we're using as long as it solves the problems he'll throw at us and the projects we'll make to pass the course. Having said that, do you think it'd be more rewarding to go with the newer versions?

Share this post


Link to post
Share on other sites

Thank you for your post. I guess I wouldn't mind the API changing since the prof clearly stated he isn't interested in the version we're using as long as it solves the problems he'll throw at us and the projects we'll make to pass the course. Having said that, do you think it'd be more rewarding to go with the newer versions?


Given that newer versions more closely resemble (or are even outright compatible with) GL|ES, which is the variant of GL used predominantly in the industry, I'd say yes. Even if you are more interested in "full GL" platforms like OSX or Linux, the newer GL is more applicable to what you'll need to know in a real games job.

Share this post


Link to post
Share on other sites

Sorry, of course I messed up - meant "library" where "engine" stood. Edited just now.

 

Thank you for your post. I guess I wouldn't mind the API changing since the prof clearly stated he isn't interested in the version we're using as long as it solves the problems he'll throw at us and the projects we'll make to pass the course. Having said that, do you think it'd be more rewarding to go with the newer versions?

Ohh, I misread, I thought it was "freedom as long as you used OGL 2.1 and FreeGLUT" :D

 

More rewarding? Well yes. 2.x is old, very old. Newer API calls are different, newer GLSL is different, etc.

 

You'll understand quite a bit more of how graphics work going the OpenGL 3+ core profile route. Drawing your first perspective projected triangle will be pretty hard, but think that drawing 500 thousand more after that first one will be much easier.

 

To be fair, your professor might teach a more modern "style" of OpenGL 2.1, with shaders and such, so the differences won't be that great, but he might teach the "fixed function pipeline", and in that case the differences will be pretty big.

 

If you want to get started, I suggest http://www.arcsynthesis.org/gltut/

 

I suggest OpenGL 3 because from what I've seen, OpenGL 4 features get more specific use case oriented, so you will hit walls for things that you might not even know how to do.

Share this post


Link to post
Share on other sites

Thank you all for your replies. It seems it should be the best to start with the newer instances, then. However, could you please also tell me how do they compare to each other as long as difficulty goes? Is learning the newer versions considerably harder? Less intuitive? Is the whole shaders-only attitude (I heard that's how you code in GL 3+?) harder to grasp in the beginning?

Share this post


Link to post
Share on other sites

The shaders-only approach means that you need to write a certain amount of supporting infrastructure, and think a bit more about how you're going to structure your data and how that structure relates to your overall design, than you would with the old fixed pipeline mode.

 

With modern OpenGL you'll be thinking along the lines of:

  • What shaders you need.
  • How to load them.
  • How to set things up for uniforms and attributes.
  • How to manage uniform updates.
  • How to best structure your vertex data.
  • Dividing it up by update frequency.
  • How to keep as much data as possible static by moving calculations to the GPU.
  • How to efficiently manage dynamic buffer object updates.
  • Etc etc etc.

The reality is that this is a lot more work over and above old-school GL1.1, where you only had a single resource type (textures) to worry about.  Using immediate mode and the fixed pipeline is the equivalent of a "sugar rush" with OpenGL - you can get results fast and can become all excited, but ultimately it's bad for you and will make you feel ill.  It's still hard to argue against making a few glBegin/glVertex/glEnd calls as a fast and flexible way of getting something on the screen in a hurry and without needing to plan ahead much (or at all) though.

Share this post


Link to post
Share on other sites

Thank you all for your replies. It seems it should be the best to start with the newer instances, then. However, could you please also tell me how do they compare to each other as long as difficulty goes? Is learning the newer versions considerably harder? Less intuitive? Is the whole shaders-only attitude (I heard that's how you code in GL 3+?) harder to grasp in the beginning?

 

I would say it is quite a bit harder to begin with, but once everything snaps in place, the reward is so much greater.  Working with shaders is so much more flexible, than using the fixed pipeline, and gives you a powerful tool to do offload your CPU so that most of the work can be done on the GPU.  When you understand how shaders work, you will also see the beauty of it too.

 

3TATUK2 provided lots of good links that would make things a lot easier to learn too.  Open GL Superbible is not a bad book to have either.

 

If I would give you an advice, I would follow what everybody else here is telling you, to go with Open GL Core, forward compatibility.  (On Mac, you have no other choice, if you are using any version higher than 2.1.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!