Resurrected Entertainment

Zen of Graphics Programming (2nd Edition)

September 11, 2009

Zen of Graphics ProgrammingThere are certain books on my shelf which I will never give up. I donate many to the library but some have a staying power I don’t often see and tend to covet when I do. Michael Abrash’s aforementioned text is one of those books. It’s  a technical book cover to cover, there are a lot of hairy details which are fun to read about and you would be hard pressed to find code listings your mother could understand (unless she too is a programmer, lucky you!).

The book was written in 1996  for a whopping retail price of $62.99 (CAN). That was a lot of money for a young man who was entering his second year of university. Like many people, I bought the book during a time when browsing the table of contents on the Internet was simply not an option. Most of the time, I couldn’t even look inside a physical copy because my book store simply didn’t stock the books I was interested in buying. I often needed to special order these texts using a behind the scenes method, that is, if I was lucky enough to find a distributor in their corporate directory. I fondly remember spelling out the book titles carefully since the nice women working behind the counter didn’t have a clue what I was talking about. Most of the time they must have thought I was speaking a foreign tounge because they would often ask me to repeat it, or reply seconds later with a vaguely stunned expression.

What I needed to rely on, was the opinions and recommendations of graphics and games programmers who posted comments through various Usenet news groups, BBS systems, and the very rare in face to face conversations. This particular book was published by The Coriolis Group and featured a wealth of information on programming computer graphics using an Intel microprocessor and a video card sporting multiple video modes, including compatibility with the elusive and fabled Mode X.

Being a book on graphics programming in 1990’s, it centers around producing efficient drawing code. It tackles the more basic primitives and how to decompose the traditional rendering algorithms into something which could execute very quickly, and then review that optimized code progressively to try and squeeze out even more cycles from your overworked CPU. One of the best features of the book, is that it’s mostly a book on algorithmic optimization, instead of code optimization, which is why it has staying power even today. For those interested in the past-time of code reduction, the author has written another book called The Zen of Assembly Language which is freely available as a digital download (or was the last time I looked).

Three dimensional computer graphics was a popular topic at the time and still is to this day, although advances in this area of computer science have rendered (pun intended) some of the earlier topics almost obsolete. Of interest to those studying the rendering pipelines used by classic games like Doom and Quake are topics around the interpretation and optimization of BSP trees. BSP is a fancy acronym standing for Binary Space Partitions, which is another fancy way of describing how to carve up space into optimal chunks, and then placing those chunks into a data structure like a binary tree. The reason Doom ran as fast as it did was not because the developers wrote some of their modules in assembly language, it was because the BSP compilers produced an optimally pruned set of data. Less data to process, meant more cycles to render those beautiful walls, ceilings and stairs we have all come to love and adore.

I find this book to be especially useful, however, when you need to return to the fundamentals. With the advent of small, portable devices, programmers working on these products have needed to return to their roots, or if they are new in the industry, to open their minds and think about the construction of 2D & 3D engines in a way they never thought of before. Most of the engines used by nubile programmers entering the field of computer graphics will be wrappers around this functionality; abstracting the core mechanics and shielding the developer from the tedious and structural bits of the engine.

Indeed, this is probably for the best, most of the time, if productivity is what your company needs. It never hurts to return to your roots every now and then, and let your mind flourish in an area rarely experienced by most technical professionals.

No Responses to “Zen of Graphics Programming (2nd Edition)”

Care to comment?