Book of the Week: OpenGL ES Programming Guide
09 Sep 2013
The OpenGL ES 2.0 Programming Guide tells you how to write OpenGL for embedded devices such as Android smartphones and the Apple iOS devices. OpenGL ES 2.0 is a subset of OpenGL that is designed to work on embedded systems with higher constraints than desktop applications. They trimmed a lot of the fat and removed multiple ways to do things. I’ve used the previous fixed pipeline in OpenGL 1.x to create 3D graphics for games and data visualization, but programmable pipeline is totally new to me. This book was a great introduction to help me get started. I recommend reading the guide through one time and then going back and to try implementing things. You need to get a sense of all the pieces before you can put it together. Mathematical Background Before programming OpenGL applications, you need to have mathematical computer graphics background. Fundamentals of Computer Graphics and 3D Computer Graphics: A Mathematical Introduction are good places to start. Linear algebra provides mathematical foundation on how the geometry is manipulated. I also recommend reading the sections about quaternions if you’re serious about rotations. Fixed Pipeline vs Programmable **I need to forget that the fixed pipeline ever existed. If I were to teach a class on this, I would totally ignore the fixed pipeline. The early graphics cards were highly specific circuits designed to process 3D graphics information. As time passed, GPUs became more general-purpose highly parallel processing data crunching devices.CUDA leverages GPUs for general purpose computing to cure diseases for scientific computing. In the programmable world, each processor loads a shader program, which determines how geometry and other information will be manipulated to create the final image. As an example in the book, the fixed pipeline is implemented as a shader. There isn’t much work required to replicate the fixed pipeline if you still want to operate in that mindset. Programming for embedded systems can be trickier, because you are more likely to hit constraints you don’t know about. One thing is that some devices only support complied binary shaders and each binary is different for each vendor/device, so there is no portability between them.