10

What should I learn? OpenGL 4.1 or OpenGL ES 2.0?

I will be developing desktop applications using Qt but I may start developing mobile applications in a few months, too. I don't know anything about 3D, 3D math, etc and I'd rather spend 100 bucks in a good book than 1 week digging websites and going through trial and error.

One problem I see with OpenGL 4.1 is as far as I know there is no book yet (the most recent ones are for OpenGL 3.3 or 4.0), while there are books on OpenGL ES 2.0.

On the other hand, from my naive point of view, OpenGL 4.1 seems like OpenGL ES 2.0 + additions, so it looks like it would be easier/better to first learn OpenGL ES 2.0, then go for the shader language, etc

Please, don't tell me to use NeHe (it's generally agreed it's full of bad/old practices), the Durian tutorial, etc.

Thanks

zxspectrum
  • 101
  • 1
  • 3
  • 1
    OpenGL 4 and OpenGL 3 are both modern OpenGL and not the old fixed function OpenGL. So if you learn OpenGL 3 then you can absolutely code with OpenGL 4 , the main concepts to learn are `Vertex Buffer Objects , Vertex Array Objects(i.e VBO and VAO)` what are those and how to use them. – Sayan Bhattacharjee Apr 13 '16 at 15:13

3 Answers3

9

Yes, definitely start with OpenGL ES 2.0. In fact, I would say start with WebGL (which is almost like OpenGL ES 2.0). The public wiki over here is a good place to start. The nice thing about WebGL is that you don't have to deal with things like compiling/linking and you avoid a lot of boilerplate code to setup a lot of stuff. So you get to focus on the actual drawing (which really is the fun bit :) ). If you have an OpenGL ES 2.0 book, that should still map over well to WebGL.

Plus there are a lot of demos in the repository which you can run immediately (and click your browser's 'View Source' to jump right into the code). Start with the simple ones like: image-texture-test, Colored Box, Textured Box

Those examples, together with your OpenGL ES 2.0 book, should get you started right away. Have fun!

EDIT: I should probably also point out that if you do decide to go the OpenGL 4.1 route, you probably don't need to wait for an OpenGL 4.1 book. An OpenGL 3.3 or 4.0 book would do just fine.

Shezan Baig
  • 1,474
  • 1
  • 14
  • 16
  • also note that right now webGL is only available on beta versions of most browsers. So if you need to deploy applications soon, you would need to make a desktop version. however, if you're just *learning*, it's a great way to start – Shezan Baig Jan 27 '11 at 12:12
2

OpenGL versions generally add new functionalities to previous versions, so I'd say that learning OpenGL 4.1 is in fact learning OpenGL 3.0, as the base is the same, especially if you're beginning 3d programming.

OpenGL ES 2.0 is a kind of subset of OpenGL 3.x.

With these 'facts' in mind, I'd say that learning OpenGL 3+ or OpenGL ES 2+ is about the same, with differences in details.

Note that depending on your desktop platform (OS, graphics card), you may not have access to an OpenGL 3 implementation.

An implementation of OpenGL ES 2 on desktop may also not be available.

Shezan Baig suggestion to startin with WebGL may help you with this, as it delegates the OpenGL init. problem to the browser - some even implement WebGL over DirectX to improve its availability.

My suggestion is that, while you learn, you focus on 3d principles, algorithms, and maths. These are the hardest to get right. Implementation 'details' don't vary much with OpenGL (ES or not) or DirectX, or whatever.

More precisely, I'd suggest that you start in the programming language you're most familiar with. I'd go with OpenGL 1.x/2.x in this language : these 'old' versions of GL contain lot of helper functions (glBegin/glVertex/glEnd ; glMultMatrix ; etc.) that are 'deprecated' in 3.x+. Using these, you'll be more 'productive' for testing algorithms.

There are many things in 3d programming, you can find reference books that have become freely available, and select what information is interesting for your use-case.

rotoglup
  • 5,223
  • 25
  • 37
0

Yes use GLES2.

1) Its portable.

2) Even for the PC follow the GLES2 way of doing things. (Unless your advanced and need GL3/4 features).

3) You want to use shaders period and GLES2 is good for learning the proper way.

Keep in mind OpenGL sucks on windows. The drivers are usually crap. Take the netbook, it support hlsl 2.0 but doesn't support GLSL shaders and only runs GL-1.3

zezba9000
  • 3,247
  • 1
  • 29
  • 51
  • 1
    The "drivers are crap" point is not true in general. What "sucks", are Intel drivers, and netbooks are, most commonly, supplied with Intel GPUs. On the other side, AMD and NVidia both having good drivers. And usually this is true with disregard to OS. – Hi-Angel Nov 27 '16 at 16:54
  • No from my experience OpenGL drivers on Windows usually suck vs D3D (when it comes to features and sometimes performance at the time of the comment). The only case this isn't true is Nvidia. Also note that post is from 2011 and represents GPUs for that time and older. In the context of now things may have changed. – zezba9000 Nov 28 '16 at 22:10