I come to you because I got several questions about OpenGL learning.
I work on Mac OSX Mavericks with the 4.1 OpenGL version.
I would like to buy OpenGL Superbible 6th Edition (http://www.openglsuperbible.com/). But I try to build some samples and I notice that numerous of samples doesn’t work and the author use his own framework.
My aim is to learn OpenGL in its last version and to convert easily my work to OpenGL ES/WebGL.
I don’t know if the best idea is to learn OpenGL directly or to use a framework like openFrameworks.
The Superbible provide a large number of samples and explanations, maybe you have some alternatives. I look the openFrameworks tutorials, the red book and the openFrameworks wiki.
I’m confused because of the different OpenGL/GLSL versions use in the tutorials or the numerous library use like GLUT, GLEW, etc… Someone to clarify?
in my opinion the most modern versions of openGL are not really thought to be used directly but instead are an api to make frameworks using it, that’s why the latest openGL books use some kind of minimal framework.
most of the time all you need is something that will let you setup some matrices to set the camera or some kind of perspective through which to look at the world you are rendering and some higher level classes or functions to setup openGL objects easily
openFrameworks supports openGL 3.2 through the programmable renderer and although you can still use old style openGL with calls like ofTranslate/Rotate/Scale… you can also setup everything from scratch using your own shaders… and still have some utility classes to make your life easier like math classes to represent vectors, matrices, cameras, nodes and wrappers for the most used openGL objects like vbos, shaders, fbos…
the syntax among openGL and GLES/WebGL are still slightly different even in the latest versions so you won’t be able to use your code directly for GLES/WebGL but apart from the shaders everything in OF has support for both openGL and GLES
OpenGL/ES implementation is low level and doesn’t have high level classes like mesh, animation, texture, camera, etc… When you write all the code by yourself, you mostly need to implement these high level classes to manage your scenes. That’s why, it is generally better to use an api/framework which contains all necessary tools when working on OpenGL/ES.
Another problem nowadays, is porting the applications accross different environments. Ready-made apis/frameworks make the porting job simpler. That’s another big reason of using an api/framework.
One of the biggest advantages of openFrameworks is; that it gives you all the helper tools, but you can still use your own regular C++ and OpenGL/ES codes whenever you prefer it. So when you work on openFrameworks, you learn openFrameworks, C++ and OpenGL/ES simultaneously.
As an aside,
GL_ARB_ES2_compatibility is an interesting extension made available to core profile apps in OS X Mavericks. WWDC session 507 has more detail, but I thought I’d mention it case it were helpful.
Thanks for your answers.
@Rancs With your approach, openFrameworks seems to be a good solution for practice. Thanks.
@pizthewiz I understand that the extension help to port OpenGL ES 2.0 code to OpenGL 3.X, doesn’t ? Is it better to develop in OpenGL ES so?
@arturo But specifically about GLSL, you need to choose a version or to decline in multiple versions. Why do not i need to choose a specific version ?
every version of openGL works with it’s corresponding version of GLSL so if you are using version 3.2 (like OF does when using the programmable renderer) you need to stick to GLSL 1.50
No better or worse, I just mentioned the extension as you expressed some interest in GLES/WebGL.