Moving from OpenGL 1.x to shaders and modern OpenGL - any tutorials?

Like in topic. I want to move from OpenGL 1 to modern OpenGL and learn shaders, so I am searching for tutorials. Does anybody know any tutorials which can help me?

I have currently tried https://github.com/mattdesl/lwjgl-basics/wiki, but it does not explain almost anything related to modern OpenGL rendering and is focusing on shaders.

The “programmable pipeline” refers to the dependency on shaders to do anything (fog, lights, etc). If you understand shaders, then you will have a much easier time understanding how the entire pipeline comes together.

Typical next steps would be to learn about matrices, VBOs, FBOs, and how to compile your own shaders. If you are working in 2D, then it basically involves re-writing the LibGDX or lwjgl-basics API (ShaderProgram, SpriteBatch, FrameBuffer etc). There are plenty of C/C++ that will go into more detail on these subjects, mostly regarding 3D:

http://www.opengl-tutorial.org/
http://www.arcsynthesis.org/gltut/ (Java ports here)
http://open.gl/
http://tomdalling.com/blog/category/modern-opengl/

There are also plenty of 3.2+ tutorials on the LWJGL wiki. These won’t enforce object-oriented practices (like using a Texture or ShaderProgram class to minimize duplication) but they will get the point across.
http://www.lwjgl.org/wiki/index.php?title=Main_Page

All of these tutorials require “core profile” and new versions of GLSL. They won’t work on a lot of older computers and won’t translate to GL ES (i.e. iOS, WebGL or Android). However, they will help you understand the pipeline, and after that you can work on learning ES-specific techniques.

So… If I have my own OpenGL 1.1 sprite loader and displayer, the only change I should add is shaders support, I am excluding half of potential players if I will move to OpenGL 3.0>?

If you decide to use a minimum version of OpenGL in the 3.x range, then yes, you will be eliminating possible customers. However, it’s their fault for trying to play games on an old computer, haha.

My tutorials are compatible with GL 2.0+ (my computer doesn’t support 3+). The shader code (i.e. #version 120 or less) will work with 2.0 as well as ES (Android, iOS, WebGL).

If your goal is to use a more efficient sprite renderer which supports shaders, then I would suggest just using lwjgl-basics as a 3rd party library in your game. If you are really crazy and keen to re-invent the wheel by dealing with all of the lovely GL boilerplate, you can look through the API source code as a reference. It’s as minimal as you can get:

The best solution is obviously to use LibGDX as your GL wrapper (instead of LWJGL), which will allow you to support a variety of devices. But for whatever reason, some people are afraid to use 3rd party libraries… ::slight_smile: