Jump to content

OpenGL 3.3+ Tutorials

Peer Reviewed by Glass_Knife, slicer4ever, Waterlimon

OpenGL Tutorials Shaders GPU
OpenGL 3.3+ Tutorials from the very basics to more advanced concepts. The minimum version of OpenGL used is 3.3, where all of the deprecated stuff has been removed, so the knowledge you learn is forward compatible

4: Adsense

Megabte Softworks OpenGL 3.3+ Tutorials

Hello Guys! My name is Michal Bubnar and I'm maintaining a series of modern OpenGL tutorials. The minimum version of OpenGL used is 3.3, where all of the deprecated stuff has been removed, so the knowledge you learn is forward compatible. At the time of writing this post, there are 24 tutorials, more to come. These tutorials are completely free :)

List of tutorials so far

01.) Creating OpenGL 3.3 Window - teaches you how to create window with OpenGL 3.3 context
02.) First Triangle - in this tutorial, first triangle (and quad :) ) is render
03.) Shaders Are Coming - the most basic shader, that does color interpolation and replaces old glColor3ub function
04.) Going 3D With Transformations - now we go to the 3D space and do some basic rotations and translations
05.) Indexed Drawing - teaches indexed drawing mode - rendering made by indexing vertices
06.) Textures - texture mapping basics and explanation of most commonly texture filterings (bilinear, trilinear, mipmap etc.)
07.) Blending Basics - creation of transparent objects, discussing having fully opaque and transparent objects on the scene at the same time
08.) Simple Lighting - really simple lighting model, that uses only diffuse part of the light, so that the triangles that face light direction are illuminated more than the triangles facing the opposite direction according to cosine law
09.) Fonts And Ortho Projection - teaches you how to use 2D fonts using FreeType library and also discusses orthographics projection
10.) Skybox - make the scene nicer by adding some skies around! Skybox (sometimes called skydome) is really the oldest and easiest way to achieve this
11.) Multitexturing - mapping two or more textures at once
12.) Fog Outside - fog is always a nice effect. This tutoria. teaches you how to make a fog using shaders
13.) Point Lights - adding type of light, that has a position and some color (like bulb or flaming torch) can really improve the appearance and feeling of the scene
14.) Geometry Shaders - new shader type, taht generates additional geometry. This tutorial subdivides incoming triangles and makes three new triangles. All is done in geometry shader on GPU.
15.) OBJ Model Loader - tutorial, that loads OBJ model file types. This tutorial is later replaced by more robust 20th tutorial - model loading using Assimp. But you can learn how does obj file looks like
16.) Rendering To A Texture - offline rendering, where the result is a texture with your rendered stuff. If you were to program a security camera in 3D game, you could use this to render scene from camera's view and then show the result on some display in 3D game
17.) Spotlight - have you ever played Doom 3? In this tutorial there is a really simple, yet powerful flashlight model using shaders, that looks really nice
18.) 3D Picking Pt. 1 - picking method using color indexing
19.) 3D Picking Pt. 2 - picking method using ray casting
20.) Assimp Model Loading - loading of 3D models using Assimp library, which is freeware and can handle almost every modern model format
21.) Multilayered Terrain - create a nice terrain with multiple textures blended together and some paths and pavements craved into the terrain
22.) Specular Lighting - specular part of light depends on the position of camera and creates a nice, shining effect on metallic objects. You can control this by setting material properties
23.) Particle System - learn how to program a particle system, that runs entirely on GPU using transform feedback
24.) Animation Pt. 1 - Keyframe MD2 - very basics of computer animation, that uses keyframe animation. Old good MD2 file format, which has been used in games like Quake II was using exactly this method for animations, so it's a good starting point


I hope you will find these tutorials useful, as I invested pretty much time into writing them and articles. If it helps some of you, I'll be only glad :)

Article Update Log

22 Jul 2014: Initial release

About the Author(s)

I am just another OpenGL enthusiast out there, who got introduced to OpenGL 10 years ago. I've been playing around with it since then. And I want to share bits of my knowledge and provide them in a systematic way by making step-by-step tutorials.


GDOL (Gamedev.net Open License)


Jul 25 2014 11:58 PM

Just wanted to say thanks for all your work! I'll definitely be spending some time with these :)

Jul 26 2014 05:10 AM

Good job on the tutorials. Back when I started experimenting with OpenGL I used several of your articles to get stuff working on my screen ;)

Liked your relaxed way of teaching all the concepts, making it an easy read. 

Jul 26 2014 05:29 AM

Great tutorials, especially for OGL beginners like me. Thank you very much 8-)

Jul 26 2014 11:54 AM

Congratulations for your graduation Michal!


Your tutorials are prime quality, and were a lot of help for me when I started learning about OpenGL. And they continued to be even after becoming more experienced: the font rendering one had a lot of useful information about FreeType, for example, even though I knew how to set up projections and such.


BTW, I have a question for you in regards to future tutorial content (or you can think of this as a requestion/suggestion for an upcoming tutorial): now that you've released your particle tutorial, and even based your graduation thesis on particles, do you plan on doing one more advanced type of particles, like ribbons and beams? They're like the most awesome particle types, and yet you cannot find a SINGLE tutorial on them, or even a clue about where and how you should start. I plan on starting to work on my own particle implementation once I'm done with SSAO, so I might be able to come up with something on my own once I have more experience with GPU soft particles, but it'd be helpful if there was at least a demo code, if not a tutorial, that'd help immensely.


Congratulations again, and keep up the good work!

Jul 27 2014 02:05 AM

Thank you all very much for your kind feedback :)


And luorax - I have in my mind plans for making tutorials generally on effects. By effects I mean things like how to create a realistic looking lightning bolt, exactly as you said BEAMS, then some cool explosions and so on. I know that there isn't a single compiled tutorial for this kind of thing, and that's sad. But I can hint you where to find the knowledge - I would look to some released codes from ID software, like Return To Castle Woflenstein (there's Tesla Gun, creating a pretty nice lightning), or Doom 3 (Beam can be found somewhere by the Grabber gun, Grabber is Doom 3's expansion Ressurection Of Evil). I would draw an inspiration from there.


But I will do it in the future. Currently, my next tutorial is going to be bump mapping and then shadows. These things still belong to pretty basics and after that, I will have all the basics required for a decent looking graphics covered.


However, these tutorials are only like my hobby, so I don't dedicate all my time to them. But I really enjoy doing them and if that could earn me living somehow, I would definitely like to write such stuff everyday :)

Jul 28 2014 08:19 AM

Hi, nice to see students from our university retaining interest in OpenGL. Keep up the good work.


However, the tutorials seem to be a bit older, and I suggest you do a revision of the older tutorials. More specifically, tutorial no. 3 introduces shaders, but just informs the user that a shader could not be compiled (no errors are shown). Retrieving a shader info log in the case that happens should be mandatory and people should be taught to do that from the beginning.


The same goes for the font tutorial. Creating a separate texture for each character is probably the worst possible way you could do it.


Both of these you created a few years back, so don't think that I'm saying your tutorials are bad. I am just trying to increase the quality of your work.

Jul 28 2014 08:42 AM

Yep, texture atlasing would be good... maybe as a 2nd font tutorial. The simple "shelf" algorithm would work fine for this, but still adds quite a bit of complexity. You'd have to make a first pass to calculate row heights etc.

Jul 28 2014 09:00 AM

That's true - older tutorials are a bit outdated and they definitely need a little revision. There are still some mistakes reported older tutorials, that I haven't revised yet, so there is still a lot of work to do. But if people out there read comments, they should figure a better way anyways.


Some tutorials (namely font tutorial) are really uneffective. Instead of just upgrading Font Tutorial number 9 I will rather create a tutorial called something like Freetype Fonts: Reloaded :D I mean, anytime someone suggests a major upgrade to tutorial (in case of fonts it's one big texture with all letters), I'd rather remake whole tutorial instead. This tutorial may have some antialiasing as well :)


I will try to keep up the good work, and I must say I am no OpenGL guru, I learn many things on the fly, while writing tutorials. So sometimes I find / someone suggests in comments a better way to do something, but if these tutorials can be upgraded with community contribution, I will gladly do it :)

Jul 28 2014 08:28 PM

I recently posted a video tutorial on my website showing how I implemented a Batch Render Manager in OpenGL.  I haven't found any good references to compare against, so I'd love to see how other people handle batch rendering in OpenGL.

Jul 29 2014 12:34 AM

Hi Marek, I know your webpage btw. :) You should maybe post an article about it, so that no one misses it (it might get lost here inside the comments plus I think it's pretty useful thing to do), but what I wanted to say is that some time ago I was playing with my own Batch Renderer class. It had exact same functions like old OpenGL (glVertex3f, glTexCoord2f etc.) ant internally it stored stuff in a vector.


First version was just buffering data into vector and when user called glEnd(), the data got uploaded and rendered. However, constant uploading of all buffers was a little slow, so then I was just thinking of creating separate buffers for every glBegin() and glEnd() pair, and as long as the data inside are not changed (by doing checksum for example), I didn't want to reupload. However, the I never programmed the latter part :D

Jul 31 2014 06:39 AM

You should maybe post an article about it, so that no one misses it (it might get lost here inside the comments plus I think it's pretty useful thing to do)


Hmmm, that is a good idea.  If I write an article on how I do my batch rendering then perhaps people will see it and suggest better ways to do it.


Thanks, I'll start writing something up this weekend.

Mar 04 2016 04:19 AM



Your article is very useful to me!   Question:  How do I detect what version of OpenGL is actually installed on my computer?  I see some software for this, but I am leery of downloading any of them for concern about malware. If you could help me there, then I will be able to start learning OpenGL real soon  ( :

Note: GameDev.net moderates article comments.