Michael Abrash's Black Book For Download
Decado writes "I found out from gamasutra that Michael Abrash and Dr.Dobbs Journal have made Abrash's now out of print "Graphics Programming Black Book" available for free download here. Written at about the time he was finished on Quake it was one of the most readable and informative books on graphics programming. Abrash begins each chapter with a real life anecdote to the problem he is solving and you can't help but think he is a cool guy. Though fairly dated now it is still a great read and his approach to optimisation still holds true today."
If the "Black Book" being released is the same as the dead-tree edition I am checking right now, it includes the Zen of Code Optimization. In fact, it is a collection of Zen of Code Optimization, Zen of Graphics Programming, all the Dr. Dobbs and other magazine columns, and some extra Quake-related articles. 1342 pages full of hardcore goodness.
There's two ways to look at this. A good programmer shouldn't need to resort to assembly in nearly all cases since a good algorithm and software design will do the trick. Hand-optimized assembly is difficult to maintain.
Learning to spot optimizable spots in assembly is probably not a good application of time, since a profiler will happily tell you where in your code you should consider optimizing.
There's a similar algorithm by Wu (IIRC) for drawing anti-aliased lines. You figure out how far you are from the 'true' line and use that as a ratio between source and target colors for your pixel and ( 1 - that ) for the source and target colors of the next pixel up. Once you get further than 1/2 pixel from the line offset by a pixel and start over.
There's a similar one for circles. I implemented them both for Windows and they are sweet and elegant. The Wu paper is on SIGGRAPH, but you need to pay for it. I found a short summary on an ftp site somewhere. E-mail me if you are interested and I can dig up the doc (it's a little too long to post here).
Rick
You are in a maze of twisty little passages, all alike.
If you ignore the fact the some of the information is dated you'll find that this provides and excellent approach to optimization (which can be used in various design environments) and great anecdotes, much in the same way that The Mythical Man Month does.
http://www.bluesnews.com/abrash/
This really is the best graphics book I have looked through. I borrowed it from a former game programmer at work. Of course I still cant get him to lend me his "Graphic Gems" books. Apparently those are even MORE coveted. Still The Black Book should be on every game and graphics programmers bookshelf at all times! Personally I found this most useful when looking at it side by side with the Athalon optimization docs from AMD.
Now if only more of these great books would make their way to a free online format. Sure there are many great works of fiction to be downloaded from Project Gutenburg, but the number of actually reference books in the online domain is pitifully small. (Note I said BOOKS, not very long documentation.)
You are only young once, but you can stay immature indefinitely.
Plus, if you ever plan on developing one of those new and exciting technologies it is probably best to learn how to write optimized assembly.
Ryan T. Sammartino
Ryan T. Sammartino
"Ancora imparo"
Bresenhan's algorithm is a fast, simple (jaggy)line-drawing algorithm. Basically, you figure out the longer dimension and step along it pixel by pixel, keeping track of how far off you are getting from the logical line (the "error"); when you're more than half a pixel out, you move one pixel along the shorter dimension.
The clever bit is finding ways to keep track of the error without using division.
While line drawing is fairly trivial, often accelerated, and usually handled by libraries, it's also good for figuring out paths of moving sprites and many other tasks similar to line drawing.
Read about it in the Black Book and immerse yourself in the coolness.
--
I have a treasured old copy of "Zen of Graphics Programming", which was the book that introduced me to such beauties as Bresenham's algorithm and dirty rectangle animation. This guy will get your enthusiasm up for graphics the way Knuth teaches a love of elegant, efficient data structures and algorithms.
Somehow, I never got around to buying the Black Book, though. I read his articles on the Quake engine though, and they're as relevant today as they were the day they were printed (not that low-level engine design is relevant to a huge audience, but at the least it's a good workout for your brain). Definitely worth the bother to download and read.
Let's try not to all download at the same time, ok? They'll still be there a month from now. They really should have put up a clear notice giving permission to make mirrors; demand is sure to be as crushing as the shipping accident that decapitated me.
--