What version of opengl should i learn?

Started by
15 comments, last by jfirjebshw 9 years, 2 months ago

You don't have to write custom shaders for OpenGL 3. Or 4.

Thanks to the Compatibility Profile, you can keep writing old fixed-function code.

Some drivers will only let you use new features if you're on the Core (non-Compatibility) Profile, but since profiles didn't even exist until GL 3.1, you should be safe. The differences between GL 2.1 and GL 3.0 and (relatively) minor features. It's the jump to 3.2+ and 4.1+ that are the big game changers. You ideally should write Core-friendly code these days, but you certainly don't have to.

I can't. In my linux distro


I'll just leave that quote there. tongue.png

Don't blame linux/Gnu, it's intel's fault!

note: saw a couple of your's presentations in youtube(one of the reasons I came here asking what opengl to use(and still have the same dobut)), very informative.

Advertisement

Plus given that shader-based graphics is always getting larger, it's probably best to get learning that!

Actually i know nothing about graphics with opengl but I've heard that with opengl 3 you have to write your own shaders. What about that, is it that difficult? Are there any alternatives to doing that?

Given the statement that you made I would worry about graphics API later and learn the fundamentals of computer graphics first. Learning OpenGL is not going to teach you computer graphics you would be essentially learning an API ( oversimplification on my behalf ). Do not get stuck the endless find tutorial->copy/cut and paste->post on a forum when the code does not work rut. This way with the fundamentals behind you will be a little more informed as to what route to take API wise and at that point you may see that when it comes to a graphics API its wholly a matter or personal taste..

For opengl 3.3, I found this series of tutorials one of the better ones to cover most of the things to get you started. Basic shaders are covered, and he explains how they work rather well, but there's not much depth to it, and you'll likely want to dig into them a bit more on your own in addition to the tutorial. But, the series walks you through modern opengl step by step, and it's fairly straight forward to follow along (I recommend not skipping anything, as it may seem like you won't need it, and then you'll kick yourself later ;P). I still find myself going back to this series on a pretty regular basis to brush up on certain things.

On a side note, with a lot of on-board intel graphics, you can still get 3.3 compatibility on linux. You'll need to update/install various mesa utilities (the intel driver update tool for linux works wonders as well). It took a bit, but I eventually got a chromebook(with XUbuntu install, and onboard intel graphics) supporting opengl 3.3. Not knowing your exact intel model, I couldn't say for sure, but perhaps spend some time digging in to how to get them running. I only recommend this because the differences between modern opengl and pre 3.3 are pretty large, and you'll find yourself completely relearning everything rather soon.

Beginner here <- please take any opinions with grain of salt

You should absolutely try to get OpenGL 3.3 support running as suggested by Misantes. In my opinion, if it doesn't work out, that would even be a valid reason to use Windows (at least for the GL development, you can always do a side-by-side install).

Moving from 3.3 to 4.x means that you maybe don't use all possible features yet, but moving from 3.0 to 3.3 means that some of your stuff that already works, will break.

OpenGL 3.0 and 3.3 differ not only in a few useful features being added, but also in a small but noticeable difference in shader syntax, which will force you to re-learn and re-write all shaders once you finally move on. Thus, it is better to learn and use the "correct" (that is, modern) way right away.

Also, be sure to avoid learning the deprecated functionality (which also means if you are tempted to buy the "Red Book", do not buy the one relating to versions 3.x since that one will teach you a lot of stuff that you don't need to know and really don't want to know).

Although it is "legal", and as a beginner tempting, to use the deprecated functionality (and a nVidia presentation even suggests to use compatibility profiles) it is most probably not a good idea for anything but the most basic applications. Yes, having to bind buffers and shaders is a lot more work to get started at all compared to glBegin... but it's really just a one-time thing to get over at the beginning.

There were a few threads already of people saying they only get OGL3.0 on Linux, but when they changed their program to ask for core profile they mostly could get 3.3, because MESA doesn't support compatibility profile.
See first few lines there: http://www.mesa3d.org/relnotes/10.4.4.html

For a final productive version of a game opengl 3.3+ is the best way to go, but i would still start using opengl 2.1.

The reason for that is simple, opengl 3.3+ does not allow direct drawing at all - you are forced to use vertex buffers and shaders to get something on the screen.

With opengl 2.1 you can draw directly on the screen, really helpful for debug visualizations and prototyping. No need for shaders, no need for buffers to prototype a game idea.

You can always upgrade to 3.3+ :-)

The only thing which i dont recommend to use it to use the built-in matrix stuff from opengl 1.1 like glTranslate, glRotate etc.

Just use a math library, compute your matrix stuff with that and load that matrix in with glLoadMatrix. Thats the only thing which should be avoided, to have it easier to port it later to 3.3+.

I can't. In my linux distro the best i can get is opengl 3.0

Yes, you can. Intel mesa drivers are just like any other package, update the repo and see if there is a new version, if there is, update it.

Mesa supports OpenGL 3.3 on all Intel GPUs down to Sandy Bridge ones, whereas on Windows for SB you get 3.1 at most mind you, so Intel is actually being very nice about it.

Then again you might be reading glxinfo wrong, or you should change distros that ship with any recent version of Mesa (10.3, 10.4, etc), hell, even Debian testing got those.

EDIT: NVM with the rest of the quoting, editor still fucks it up.

"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


Yes, you can. Intel mesa drivers are just like any other package, update the repo and see if there is a new version, if there is, update it.



Mesa supports OpenGL 3.3 on all Intel GPUs down to Sandy Bridge ones, whereas on Windows for SB you get 3.1 at most mind you, so Intel is actually being very nice about it.



Then again you might be reading glxinfo wrong, or you should change distros that ship with any recent version of Mesa (10.3, 10.4, etc), hell, even Debian testing got those.


glxinfo:

OpenGL version string: 3.0 Mesa 10.1.3
OpenGL shading language version string: 1.30

I'll get a nvidia card and install the propietary drivers, this way, i'll be able to use opengl 4.4. As someone sugested I thought about installing windows, but I'm not leaving my development envoriment just to use opengl. I'll end up having windows execs when all i want are linux ones.

Thanks all for the info, I'll have a look at shaders and start using opengl 4.3(with opengl red book)

This topic is closed to new replies.

Advertisement