WebGL: Up and Running

Author: Tony Parisi
Publisher: O'Reilly
Pages: 230
ISBN: 978-1449323578
Audience: JavaScript programmers
Rating: 4.5
Reviewer: Mike James

 

Can you learn WebGL without getting involved in the very basic nuts and bolts like shaders and so on?

 

The big problem with WebGL is that it is very low level. If you are expecting to get involved with cameras and lights then think again. WebGL expects you to set up shaders, which are fairly complex programs in a C-like dialect to control how surfaces are rendered. This makes getting started with WebGL a slow and technical process.

Many programmers don't want or need to get into the powerful but difficult area of custom shaders - they just want to define and render 3D objects and create scenes that can be animated and used in games, simulations and so on. The problem is how to get them into WebGL?

This book takes the approach of augmenting WebGL with a 3D graphics engine - Three.js. What this means is that you work with 3D graphics in terms of meshes, cameras and lighting and so avoid the whole issue of shaders, which are provided for you by the engine. The only problem with this approach is if you actually want to master the low-level details of WebGL. Even if you do, starting off with a 3D graphics engine and finding out about shaders later on is still a good way into a complex subject.

However, it is important to realize that if you want an approach to WebGL that isn't based on Three.js you need a different book.

Banner

This said, the book does start off with an overview of WebGL and a simple program to draw a square. This is almost used as a motivation for adopting a 3D engine, as the next chapter introduces Three.js with a program that does the same thing in 30 lines as opposed to the original 150.

Next we move on to rendering a textured cube, something that usually takes a lot longer to reach taking the unaided route.

Chapter 3 uses a simple simulation example to introduce wider ideas on how to create meshes and textures. It also deals with particle systems and introduces custom shaders, but mostly concentrating on Three.js. From here we move on to animation in Chapter 4, again covering some basic principles, but quickly moving to Tween.js - a library that makes it all easy.

Next, Chapter 5 deals with hit detection and user interaction using Three.js. Chapter 6 is on integrating 2D and 3D graphics. Chapters 7 and 8 bring the book to a close, looking at WebGL in productions settings and creating a game.

This is a very short book and often the code is left to do the explaining.  This is not to say that the author doesn't explain  some basic concepts, but there is too much to get through in any detail in a book this size. You will either have to go and find out about some aspects of 3D or be lucky enough to know theory or practice already. As a result this book is great for programmers who have worked with a 3D system before but less so for the 100% complete beginner. And of course there is no point at all in approaching it unless you are fluent in JavaScript and HTML.

As long as you are happy with using Three.js and can accept a fairly compact and advanced approach to 3D graphics, this is a good introduction to graphics based on WebGL and it should get you to the point where you can create your own game or simulation.

Banner


Android in Practice

Author:Charlie Collins, Michael Galpin, Matthias Kaeppler
Publisher: Manning
Pages: 648
ISBN:978-1935182924
Aimed at: Intermediate programmers
Rating: 4.5
Pros: No beginners stuff.
Cons: No beginners stuff
Reviewed by: Ian Elliot

There are a lot of Android books on the market, so can a book tha [ ... ]



Beginning C for Arduino

Author: Jack Purdum
Publisher: Apress
Pages: 262
ISBN: 978-1430247760
Audience: Arduino beginners with no programming background
Rating: 3
Reviewer: Harry Fairhead

Working with the Arduino is usually seen as a hardware problem, but what about the software? This book aims to educate you about the C langua [ ... ]


More Reviews

Last Updated ( Tuesday, 09 October 2012 )
 
 

   
RSS feed of book reviews only
I Programmer Book Reviews
RSS feed of all content
I Programmer Book Reviews
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.