Anton's OpenGL 4 Tutorials

Hi! I really enjoyed learning the latest OpenGL shader programming, but it's actually not easy to get into. I've had quite a lot of teaching experience in different places and enjoy breaking down the difficult concepts and helping people with the various common problems that trip you up with the API. I host some my tutorials here, which I add to now and again. I have also written a much larger book of OpenGL tutorials, which you can get on Amazon and Itch.io.


  1. E-Book
  2. On-line Tutorials
  3. Useful References
  4. Source Code

Anton's OpenGL 4 Tutorials - E-Book

TopicsTable of Contents
FormatsMOBI (Kindle + Amazon's on-line reader), EPub (most devices + desktop apps)
Page Count454 approx. (varies with device)
Word Count111,000
Source Code40 demonstration programmes with Makefiles for Windows, Linux, OS X
IllustrationsFull-colour hand-drawn diagrams and screen-captures
Edition4 (all future updates are free)
ErrataErrata and Change Log
Notable ForTroubleshooting, tips and tricks chapters, tested on students, cheapest OpenGL book by far.
Anton's OpenGL 4 Tutorials
Amazon Kindle Store

I write most of this material in my free time, generated by lots of coffee, so it's priced such that one copy sold gives me exactly the price of a coffee at the Science Gallery next door! If you'd like to donate me a coffee, and speed up future work, I would not complain. If you'd like to request I publish on a different platform, or think that it would be worthwhile making a print version, let me know.

On-Line Tutorials


Here you'll find the basic concepts to get you started, and you can see if you like my teaching style or not.

"Hello Triangle" easy. 2 hours. Minimal code to draw a triangle using simple shaders and vertex buffers.
Extended Initialisation easy. 2 hours. Specifying OpenGL version, configuring the display, getting driver information, extension handling with GLEW, and adding a frames-per-second counter.
Shaders moderate. 2 hours. Shaders determine the style of rendering.
Vertex Buffer Objects easy. 2 hours. Vertex buffer objects hold the mesh data to render on the graphics hardware. We add a vertex buffer with colours to our triangle and show vertex-fragment interpolation.

Selected Tutorials

By popular demand, here are some selected favourite tutorials.

Ray-Based Picking moderate. a couple of hours. Cast rays from mouse pointer to various primitive "bounding" shapes.
Cube Maps: Sky Boxes and Environment Mapping moderate. 1 day. Look at using GL cube maps for sky boxes, and environment-mapping reflection and refraction effects.

New and Experimental Tutorials

I have a repository of experimental demos where occasionally one turns into a nice tutorial. If you have any requests by all means send them to me!

Morph Target Animation moderate. 4 hours Using interpolation between animation "targets". AKA "blend shapes".
WebGL Starter easy. 2 hours Moving into WebGL.

Useful References

Source Code

All of the source code required can be found in snippets in the tutorials. I go to great pains not to refer to any custom code framework, and use minimal third-party libraries. Sometimes just having a working project to compare against is a relief. You can find a repository of demo code for my book on GitHub.

SDL2 Fork

Dr Aidan Delaney at the University of Brighton has made an SDL2-based fork of the source code for graphics in the Computer Science (Games) BSc (Hons) programme. SDL2 replaces GLFW3 as the main helper library in this fork.


If you spot an error, omission, or typo, please let me know! I occasionally write about small, experimental, work on my blog. I consciousness-dump and re-tweet various graphics, game development and programming thing on Twitter.

Dr Anton Gerdelan