2014 - What OpenGL versions should I target?

As someone who is currently learning the basics of the programmable pipeline, i.e 2.0 to 3.2, and given that my computer only supports up to version 3.2, which range of OpenGL versions should I target? I was thinking of targeting OpenGL 2.0 minimum, however I realise that it’s getting very old now by todays standards. I’ve looked around and found similar questions that are 2-3 years old, most of which suggest targeting a maximum of 3.3, which would have made sense back then. Times have changed though and the most recent version is 4.4, so which version(s) should I target? Should I go as far as aiming to target 4.0?

2.0 may be old, but it’s the basis for OpenGL ES, which is still the primary choice for the vast majority of devices (iOS, WebGL, Android, etc).

I would just stick to GL 2.0 using as little deprecated code as you can, unless you are particularly interested in modern graphics programming (AAA titles and the like).

I try to ensure to ensure compatibility with OpenGL 2.1 (I can’t remember what it is in the .1 that I wanted but there was probably something important). You miss out on some shader stuff - always possible to do without, VAOs -I’ve heard nothing but (OK actually little but) bad things about VAOs and FBOs. FBOs are useful. Very useful. If I break compatibility it is always for FBOs never for anything else.

I find that a lot of people still use older computers which don’t support 3.0+. If you take a look at games like Minecraft - I can run Minecraft on a 2.1 compliant driver. I don’t know what version it actually requires but clearly they’ve decided to support at least down to 2.1. But in the end I think you just have to look at what features you need. If your game needs these features then probably older graphics cards aren’t going to be up to playing the game even if they did support the features / find a work around. There is a reason vendors stop updating their drivers to the latest versions. The cards can’t handle it.

In short go as low as you feel you can but I suggest that that will probably be 2.1.

And @Davedes makes a good point too. Although OpenGLES 2.0 does have some 3.0+ features like FBOs, automatic mipmap generation and the like. Nice to know someone agrees with me.

There are a few things to consider in my opinion:

  1. the release date (maybe a year or more from now)
  2. your target audience (developers?)
  3. this being your first opengl project

All these 3 things mean you can pretty much target the high end - take your development machine as the minimum hardware you’re going to support, because:

  1. by the time you release your game, such hardware will be common
  2. it isn’t always bad to simply ignore the low end of the market
  3. with limited experience, this first project will eventually be superseded by your next, or treated as a techdemo anyway

Don’t plan for release and other machines, cut corners everywhere your can, and make an enjoyable game on your machine. Once it works, and it’s in the showcase/featured section, you’ll have enough experience to cut out OpenGL features to support lower end machines.

quew8 - FBOs and shaders are supported in > 90% of drivers. Any device that doesn’t support them probably won’t be fast enough to play your game, anyways.

Some other 3.0 core features are also really common in older devices, like VAOs.

Target OpenGL 3. According to the current Steam Hardware Survey, OpenGL 3 is supported by 96.35% of all users. In contrast to DirectX 10 and 11, OGL3 works on Windows XP, so I’ve included those 16.06%.

The problem is, that people think 3.0 means 3.x.

Which is unfortunate for me because my laptop only supports up to 3.0, and some of the games I want to play require GLSL 140.

So update your drivers?

Mojang (Minecraft) also released hardware statistics for their users a while back, posted about it here.

I code on a cheap (was £349 when I bought it, ha) 4 year old laptop. OpenGL 3.2 was relatively new (1-2 years old) back then.

Interesting stats. Since the general opinion seems to be 2.0 to 3.x, I’m thinking of targeting OpenGL 3.2 and then working on backward compatibility if necessary. However, 20% of drivers supporting 4.0+ was more than I thought.

@davedes. That’s what I’m saying. In fact I’ve noticed that trend too which started me off making a pluggable back end for my utils package. So FBOs, shaders and PBOs could be implemented in core or one of the older extensions. Now I have a completely abstracted OpenGL interface with back ends for android and desktop PCs. Talk about escalation.

I still target OpenGL 1.2, I don’t encourage planned obsolescence. My game has ugly graphics, end users owning very low end hardware wouldn’t understand why it would require OpenGL 2.