5
\$\begingroup\$

I am currently learning OpenGL from here. That website teaches OpenGl 3.3 with GLSL 3.3 and says that it is best to learn those because they are well supported and that older versions work in a less efficient way.

So far, this has been going well, but, when I tried to get my OpenGl programs to run on my laptop with Intel HD Graphics 3000, I ran into issues with the lack of GLSL 3.3 support (glGetShaderiv() and such claim that GLSL 3.3 is unavailable. When I ignore these errors, anything beyond the background color isn't rendered).

I am learning OpenGl in order to create a video game for which my target market will contain many older non-gaming computers (in addition to users with brand-new GTX 1080s). It wouldn't surprise me if a few users were still on Windows XP. It is essential that I make sure that everyone can run my game without buying extra hardware. It is equally essential that it looks good on hardware that can support it. What single, non-deprecated graphics API is available on all hardware (using software emulation if needed) along with Windows, Mac, and Linux?

If no single such API is available, what can I do to ensure that my game will work properly everywhere while also taking advantage of new features when available without learning multiple APIs? I would strongly prefer to stay close to the hardware by avoiding higher level APIs such as Ogre3D. If to do this I need to learn multiple APIs, then, what are those and why hasn't the industry standardized this by creating an API then releasing drivers for old hardware?

Some possible solutions are:

  • A well-enough-performing software implementation of OpenGL 3.3 along with GLSL 3.3
  • A OpenGL 3.3 implementation that uses OpenGL 1.0 in the background that can be easily swapped out automatically at runtime if newer versions aren't directly available.
  • A simple to use older version of GLSL that allows me to load separate shaders as needed.
\$\endgroup\$
  • 3
    \$\begingroup\$ While we usually do not allow "What technology to use" questions, I believe this question is sufficiently narrow to allow it. \$\endgroup\$ – Philipp Aug 12 '16 at 12:40
  • 1
    \$\begingroup\$ Get a new laptop. Even 3.3 is quite outdated, and going back even further will put your code into a massively obsolete state before you even release it. \$\endgroup\$ – Yudrist Aug 12 '16 at 15:25
6
\$\begingroup\$

What can I do to ensure that everyone can run my OpenGL game?

Nothing.

What single, non-deprecated graphics API is available on all hardware (using software emulation if needed) along with Windows, Mac, and Linux?

There's no such API.

...why hasn't the industry standardized this by creating an API then releasing drivers for old hardware?

The industry is competitive and graphics hardware evolves. In the particular case of graphics hardware, it's evolution is quite different to that of CPUs. An API that is suitable for graphics hardware of 10 years ago is completely unsuitable for graphics hardware of today.

A well-enough-performing software implementation of OpenGL 3.3 along with GLSL 3.3

There's no such thing.


These are probably not the answers you wanted to hear, but they are a truth you're going to have to accept: wanting to support all users on all hardware with all operating systems is an unrealistic objective - doubly so if you're just learning.


Despite all of this there are a number of options open to you:

Pick a minimum OpenGL version that's lower than 3.3

The older Intel HD graphics (HD 2000, HD 3000) support OpenGL 3.1, which will get you most of the same functionality as OpenGL 3.3.

Use OpenGL 3.3 Anyway

Realistically, if you're only learning now you're at least a year or two away from releasing. By the time you release many of your target users will have upgraded their hardware, so the chances of someone not having support for 3.3 are lower.

Use Direct3D instead

Driver support from the vendors is much better (you would have D3D11 on the HD 2000/3000) but of course you're limiting yourself to Windows only.

Use an engine like Unity or Unreal instead

These have already done all of the hard work of supporting multiple APIs and multiple OSs for you, so you can focus on just creating your game.

Change your objectives and accept not being able to support everybody

As I said earlier, you have an unrealistic objective here. You're learning OpenGL, you're making your first game, but yet you want to support everybody on all hardware and all OSs. That's just not going to happen. You're going to give yourself a significantly higher change of succeeding if you narrow your scope.

Even if you choose one of the other options, you should give this serious consideration anyway.

\$\endgroup\$
2
\$\begingroup\$

How about OpenGL 2.0/2.1? It would cover machines up to 2008/2010 that are running Intel processor with Integrated Graphics and I really think it would be sufficient.

Unless you already know exact end user group and you know that they have hardware from before that time (like in some poorer regions of the world). But OpenGL is still a way to go if you need long-term, cross-platform capabilities. OpenGL 1.4 would cover machines approximately up to 2004 (again, with Intel IG).

To make use of newer users hardware, you could if-else or #ifdef your code and make it running shaders and all those recent goodies if HW supports it. For older HW you would roll back to old, fixed-function pipeline and display less-satisfactory graphics.

Running 3.x+ OpenGL with compatibility profile might be way to go, as it allows usage of old functions.

List of Intel GPUs with API versions they support: LINK

Correlation table of OpenGL and GLSL versions: LINK

\$\endgroup\$
  • \$\begingroup\$ When you say that specific OpenGL versions are covered on machines from a specific year, does that include non-gaming computers (ie. integrated graphics) or is it just in reference to the discrete GPUs available at the time? \$\endgroup\$ – john01dav Aug 12 '16 at 13:49
  • \$\begingroup\$ Integrated ones. Here you can check Intel IG capabilities: en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units \$\endgroup\$ – Mars Aug 12 '16 at 13:55
  • \$\begingroup\$ Thanks for that link, it is very helpful. Should I expect that a (Intel) GPU that supports OpenGL x.x should support GLSL x.x as well? My laptop claims to support OpenGL 3.3, but, it fails with GLSL 3.3 (or really any sort of GLSL 3). \$\endgroup\$ – john01dav Aug 12 '16 at 14:27
  • \$\begingroup\$ It should not fail, but I think you are trying to use invalid versions (as you state "any sort of GLSL 3" while there is only one). Here you have table with correlation between OpenGL and GLSL versions: en.wikipedia.org/wiki/OpenGL_Shading_Language#Versions They start to match from OpenGL 3.3 onwards. \$\endgroup\$ – Mars Aug 12 '16 at 15:04
1
\$\begingroup\$

No. Forget about those who don't upgrade their setups in years. It's just dumb to drastically reduce product quality in favor of them (Because your game's availability is not your game's desirability). Better stick with modern OpenGL and focus on developing a good game. Later you could backport it, if older hardware would be enough to and if you will still want to.

\$\endgroup\$
  • 1
    \$\begingroup\$ Much of my target market lacks the means to upgrade their systems. \$\endgroup\$ – john01dav Aug 15 '16 at 0:06
  • \$\begingroup\$ Stick with legacy APIs then. Even if they are slower than modern, you will have to deal with them as there is no other option on legacy hardware. Also i should mention GLSL extensions. Sometimes on hardware that is not fully compatible with concrete version of GLSL still could be available extensions providing some of functionality, which could be sufficient for your purposes. \$\endgroup\$ – K117 Aug 15 '16 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.