Game Developer Personal homepage: Personal blog: Morten has posted 4 posts at DZone. View Full User Profile

WebGL: Up and Running

  • submit to reddit
Published by: O'Reilly Media
ISBN: 144932357X

Reviewer Ratings




Buy it now

One Minute Bottom Line

“WebGL: Up and running” is an excellent introduction to WebGL with good examples and a nice overview of the technology. For most of the book the JavaScript library Three.JS is used to simplify the examples. This gets you up and running fast, but also means that you will get more familiar with Three.JS than with WebGL itself.


WebGL is one of the hottest new technologies of the Web and it brings hardware accelerated computer graphics into your browser without needing to install any plugin. This unleashes the power of your graphics card and makes your browser able to render advanced 2D and 3D graphics with a high framerate. Since most computations are performed on the graphics card, the graphics capabilities of WebGL powered browsers are almost identical to games and other graphics heavy applications. Today over 65% of all desktop users have already a browser with full WebGL support and the next generation of tables and mobile phones will also be shipped with full WebGL support.

“WebGL: Up and Running” is a great introduction to intermediate JavaScript developers who wants to try out the new possibilities for creating fast 3D graphics in the browser. The book requires that you are familiar with JavaScript and that you are comfortable with using different JavaScript libraries. The book makes extensively use of a lot of different libraries that either expands or simplifies WebGL or mixes WebGL with other browser technologies.
WebGL also attracts a different type of programmer; graphics programmers with a background in C/C++ who wants to use WebGL to show off their skills and try out this new API. I think the C/C++ programmers would find the book too high-level, since the book uses a lot of abstraction to make things easy for the programmers.

In the first chapter the ideas and principles behind WebGL are introduced. This includes a quick run through all the concepts, abstractions and math used in 3D programming. This is the only chapter that uses pure WebGL – the rest of the book WebGL are used indirectly by using the JavaScript library Three.JS. Using such abstraction makes a lot of sense, since it allows the book to focus on creating cool and creative applications instead of dealing with the tedious details of the API. On the other hand it is also the biggest problem of the book; the title of the book is “WebGL: Up and running” – this may give the impression that the book is about the actual WebGL API. I believe that a better title for the book would have been something like “Three.JS up and running”. The author does wisely point out that Three.JS is not the only abstraction layer you can put on top of WebGL – there exists a range of alternatives each with their pros and cons.

After the introduction to WebGL and Three.js, the book describes graphics including meshes, materials, textures and lights. Then it explains how to interact with a WebGL program and how WebGL can be mixed with other HTML technologies. Finally it gives some insights of important details to be aware of when using WebGL for an actual application. The last chapter takes you through a full game creation – all the way from a rough prototype to a full functional game.

The real strength of the book comes the many examples the author goes through. The author shares his experience and gives a lot of useful tips when working with WebGL. Most important of all, this book is written with a lot of enthusiasm, which makes it enjoyable to read. When reading the book it inspired me to try out several new ideas that I wouldn’t have through of otherwise. The book also introduces many JavaScript libraries, often Three.JS related; this includes the author’s own Sim.js library.

The books works well as an introduction to WebGL, but if you want to be serious about WebGL development you would need some more theory to understand all the details fully. Another advanced topic only briefly discussed in the book is shader programming using GLSL.
Published at DZone with permission of its author, Morten Nobel-Jørgensen.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)