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."
Do you remember the Illegal prime a couple days ago? It was submitted by Phil Carmody (the person who found the prime in the first place) days before it appeared on slashdot and was rejected.
Oh, and that damn pdf reader for unix keeps crashing on my solaris box. pppffft.
Which one? Try gv... it antialiases the fonts and has never crashed for me.
Yeah, it's the New Jersey method ("Worse is Better")... make something with a decent base design, nice and simple, get it working 90% and release it, hoping that the remaining bugs will get fixed sometime later. Remarkably, this method, however flawed, has proven to be quite adequate for a majority of the world's computing needs so far, as attested to by the enormous popularity of Unix and Microsoft systems. "Working tools now are better than perfect tools later." Unix pulls it off with an unexpected grace, due in a large part to the fact that its programs are usually small and relatively easy to debug and have had many years to mature, and some big design wins in the flexibility of the system ("everything is a file", "plain text is a universal interface").
Actually, the Redmond method is a bit different ("Good enough is Best"), copy something, anything that looks good and can check off a buzzword list of features, get it done good enough to compile and run a little then ship it off to your world class marketing department to grab market share as soon as possible. Fix bugs later if the customers actually need a better program as a reason to switch from your competitor's (they rarely need a good reason though).
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.
2001-03-20 17:00:47 Graphics Programming Black Book now online at Dr. Dobb's Journal (articles,programming) (rejected)
Who takes the bribes here? Give me some names...
Seriously, though, Abrash is a god, and if you are at all interested in programming fast and furious graphics applications, he is definitely one of the best reads out there. There's just so much good solid foundation knowledge you can gain from his books that will help you not only create better graphics and games programs, but also better apps in general. Just going through some of the problem solving steps that he takes when discussing his stuff can make you into a smarter developer. Go get your coffee, curl up with a good computer in front of the fireplace and start reading this fantastic piece of work.
--
+1 Insightful, -1 Troll. What can I say, I'm an Insightful Troll.
The algorithm can be easily obtained by writing the obvious iterative algorithm in floating point, then separating the fractional part from the integer part, and finally multiplying the fractional part by the length of the longer dimension (times 2 if you're using midpoint-Bresenham) to turn it into an integer.
sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
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.
vaguely related: damn I wish somebody would "back port" the "//" comment notation from C++ to C
It's already happened. It's in GNU C (the language that gcc compiles) and in C99 (for which there is no compiler, but gcc comes closest).
Here's another tip: Turn word wrap on in your editor and never have to deal with hardwrapping comments again. Just a /* (paragraphs of comments) */ with no hard returns except between paragraphs.
Will I retire or break 10K?
Oh boy, the PDF vs. HTML war. When it comes to reading things on screen, I'm firmly in the HTML camp. The PDF viewer is unstable on my box, it always defaults to page flipping mode, and antialiased fonts are ugly unless you blow them up. Then you have to scroll sideways. Yuck.
That said, it's perfectly understandable why this is PDF. It was a book, remember? For work that is destined for the offset press, PDF, PostScript, or something else that forces an exact size is ideal. For work that is destined for the screen, HTML is better. What's needed is a free tool to convert PDF to HTML that is a decent approximation of the PDF.
I've seen documentation that was originally TeX and was converted to HTML, and it looked pretty decent. I haven't actually viewed TeX documents, but if it is a page layout like PDF, and *it* can accomplish this, I see no reason why PDF can't.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
http://www.bluesnews.com/abrash/
I would love to be one of those guys who can eyeball compiler-generated assembly and quickly identify parts that can be optimized. Since I can still easily bring the fastest machine to its knees in terms of processing I think optimizing techniques and assembly are far from obsolete.
No, Thursday's out. How about never - is never good for you?
I consider myself very good at understanding what's going on in the computer and then using that model to extrapolate back to what part of my code is buggy. I'll agree that the in-depth step-by-step debugging is a seductive time suck, but using the debugger to get a stack trace on where a non-trivial program core dumped has been insanely useful to me. That single bit of information, which requires almost no effort to produce (and only slightly more effort if we increase the likelyhood of it pointing at the true culprit by compiling with ElectricFence or a similar utility), is usually enough to make my mental model churn out a solution to the problem.
Hu? How is reading PDF painfull? Does reading smooth anti aliased fonts hurt your eyes? Admitedly I havn't downloaded this file yet so maybe it has oddities that make it hard to read in PDF. However PDF is a great way to distribute documentation. Unlike HTML it is a standard standard. That is every PDF viewer read every PDF like every other PDF viewer. The same cannot be said about HTML. Just try reading a the same html formatted documentation in IE vs Netscape 4 vs Netscape 3 vs konkeror vs ...well you get the idea.
:)
PDF is a god-send of a documentation file format. Its cross platform (cpu/os), cross viewer (xpdf, acrobat 3, acrobat 4, etc), has scaleable fonts, anti aliasing, never has print problems, and EASY to make for even the most assinine of computer users.
There is only ONE dissadvantage of PDF's, and that is you need to edit the source document and re-distill to change them.
Keep HTML in web pages, I'll keep my PDFs for documentation, thank you very much
You are only young once, but you can stay immature indefinitely.
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.
I disagree, there are plenty of things that can be improved through assembly language, and through careful optimization of code. Especially with new instruction set enhancements such as MMX, 3DNow!, SSE and SSE2. Lest anyone reading here forget, Michael Abrash, already an accomplished developer, worked with id Software when they were working on the original DOS-based Quake. He talked about more than just graphics optimization, he talked about actually making the code DO less by arranging data intelligently. (Clearly something that can benefit developers to this day-- things like not rendering non-visible polygons are ideas that I got from Abrash's written works, and he has a whole treasure trove of good tips and ideas that can still be applied to todays work.)
Definately worth a good read, along with his 'Zen of Code Optimization'.
All I know about Bush is I had a good job when Clinton was president.
A hands-on Direct3D book from someone directly responsible for turning D3D into something great from the shitheap that was D3D 3 would be cool though.
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.
--
Would anyone here be interested in "open-sourcing" this title? If so, maybe I/we can work on lobbying Coriolis (the publisher) to do so. I have no further financial interest in it, and Coriolis obviously doesn't - so if you like this idea, please reply.
Thanx... -Mike C.
(PS- *please* don't reply if you want to debate the merits of NT vs. *nix, or Oracle vs. other DBMS's. My purpose here is to contribute something that might be useful, not get into a flame war.)