Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


A good plan for learning OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Tigro   Members   -  Reputation: 128

Like
1Likes
Like

Posted 06 March 2014 - 03:36 PM

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, 06 March 2014 - 03:48 PM.


Sponsor:

#2 TheChubu   Crossbones+   -  Reputation: 4733

Like
4Likes
Like

Posted 06 March 2014 - 03:46 PM

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.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#3 Tigro   Members   -  Reputation: 128

Like
1Likes
Like

Posted 06 March 2014 - 03:50 PM

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?



#4 SeanMiddleditch   Members   -  Reputation: 7083

Like
3Likes
Like

Posted 06 March 2014 - 03:57 PM

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.

#5 Glass_Knife   Moderators   -  Reputation: 4980

Like
5Likes
Like

Posted 06 March 2014 - 04:39 PM

from Michael Abrash's classic Graphics Programming Black Book

 

In the early 1970s, as the first hand-held calculators were hitting the market, I knew 

a fellow named Irwin. He was a good student, and was planning to be an engineer. 

Being an engineer back then meant knowing how to use a slide rule, and Irwin could 

jockey a slipstick with the best of them. In fact, he was so good that he challenged a 

fellow with a calculator to a duel-and won, becoming a local legend in the process. 

When you get right down to it, though, Irwin was spitting into the wind. In a few 

short years his hard-earned slipstick skills would be worthless, and the entire disci- 

pline would be essentially wiped from the face of the earth. What’s more, anyone 

with half a brain could see that changeover coming, Irwin had basically wasted the 

considerable effort and time he had spent optimizing his soon-to-be-obsolete skills.

 

So, if you agree with this, then time spent on the older OpenGL fixed pipeline is "spitting in the wind."  :-)


I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#6 TheChubu   Crossbones+   -  Reputation: 4733

Like
2Likes
Like

Posted 06 March 2014 - 04:44 PM

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.


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#7 3TATUK2   Members   -  Reputation: 730

Like
0Likes
Like

Posted 07 March 2014 - 03:30 PM

http://ogldev.atspace.co.uk/
http://www.opengl-tutorial.org/
http://lazyfoo.net/tutorials/OpenGL/
http://open.gl/
http://antongerdelan.net/opengl/
http://www.mbsoftworks.sk/index.php?page=tutorials&series=1
http://www.rastertek.com/tutgl40.html
http://www.lighthouse3d.com/tutorials/glsl-core-tutorial/
http://www.ozone3d.net/tutorials/



#8 Tigro   Members   -  Reputation: 128

Like
0Likes
Like

Posted 07 March 2014 - 03:56 PM

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?



#9 mhagain   Crossbones+   -  Reputation: 8268

Like
2Likes
Like

Posted 07 March 2014 - 04:40 PM

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.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#10 aregee   Members   -  Reputation: 1026

Like
0Likes
Like

Posted 07 March 2014 - 08:15 PM

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.)



#11 timothyjlaird   Members   -  Reputation: 404

Like
0Likes
Like

Posted 07 March 2014 - 11:35 PM

You said any 'version' of OpenGL...does that make OpenGL ES2 an option? If so I would recommend WebGL. Not as full featured as OpenGL but it has been a good learning tool to get me started. Easy to show off your work too since it'll run in most browsers (only exception is IE and Android browsers are hit/miss). I've been able to use Google Drive for hosting which is free (although you have to jump through a few hoops to make it work). All you need for WebGL is coding knowledge of Javascript/GLSLES/OPENGLES API calls and a bare minimum of HTML5.

 

This guy did a really good tutorial job...

http://learningwebgl.com/blog/?page_id=1217

 

Good book and some JS libraries to get you started. His library handles most of the matrix stuff for you...

https://sites.google.com/site/webglbook/

 

Good luck.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS