WebGL Beginner’s Guide

by: Diego Cantor and Brandon Jones
Dive head first into 3D web application development using WebGL and JavaScript.

Download the source code:

You can download all the code examples from Bitbucket:



Please let me know if you find any bugs. The code viewer works on Firefox (It does not work correctly on Chrome or Safari due to a bug in prettify.js).


Chapter 1 – Getting Started with WebGL

Chapter 2 – Rendering Geometry

Chapter 3 – Lights!

Chapter 4 – Camera

Chapter 5 – Action

Chapter 6 – Colors, Depth Testing, and Alpha Blending

Chapter 7 – Textures

Chapter 8 – Picking

Chapter 9 – Putting It All Together

Chapter 10 – Advanced Techniques

Work In Progress

Dear Reader,

I am currently reviewing and updating the code examples of the WebGL Beginnner’s guide. The specification has evolved since I write the book and so has the implementation in the different browsers.

I have noticed that some examples present WebGL warnings and a few will not run across all browsers. Rest assured I will take care of updating them ASAP.

Also, there (is) was a bug in the file codeview.js that impedes the source code to show nicely formatted in Chrome. I think I found the problem and (I will be updating that file soon) it is fixed now!



Get your copy