Periodically I will write a short description of what I've been doing on my book. Watch as it gets written!
May 3rd, 2003
The Big News is that I'm switching publishers. I've terminated my contract with Addison-Wesley and I'm putting together a new contract with a new publisher that I think will be more helpful in getting this book into your hands ASAP.
I asked visitors to my book page to take a poll about whether or not the book should be finished as DirectX 8.1 or should be updated to 9.0. The results were generally 60% favoring the book being updated for DirectX 9.0. So if I had to go only by the feelings of potential consumers, then I would probably finish the book as DirectX 8.1 and make a 9.0 update as a second edition.
However, the consumers are only part of the business equation -- there is also the book buyers, the people who buy the books for the distribution chains and stores. These people know the book business but they don't know anything about computer graphics. The book buyers are going to look at my book compared to some other book and say "9 is more recent than 8" and they will probably pass on buying my book for distribution. So, although the opinion is approximately split among developers, the opinion among book buyers definately favors a DirectX 9.0 version as the first edition.
The first edition will actually cover the new material in what is currently called the "DirectX SDK Update" that is in beta. I can't talk specifically about what new material will be in the update until the beta is finished and the update is available, but this will make my book the most current and complete book that you could possibly buy. Of course, as the SDK continues to be updated new editions of the book will be prepared to track those changes. With graphics hardware and APIs evolving as rapidly as they are, I had always planned this as a necessary part of writing this book.
I have gone through my existing manuscript and made note of the changes required for DirectX 9.0. Not much in the existing manuscript had to be changed, just updating the API symbol names mostly and adding a paragraph here and there. I've heard lots of people comment that my book will be obsolete as soon as the next version of DirectX was released. With the release of DirectX 9.0, we got to put that assertion to the test and I'm happy to report that the assertion falls flat on its face. New releases of DirectX haven't changed the concepts behind the 3D graphics pipeline, they have only added new features to extend the capabilities of the graphics pipeline.
Updating to DirectX 9.0 means that new material will have to be written for the book. I'm currently thinking that this will amount to new chapters on the high level shading language and the animation controller objects added to D3DX. The rest of the new features of DirectX 9.0 Graphics will be folded into the existing chapters.
April 25th, 2003
I tried switching this thing to a real blog site, but since they had bugs with their blog implementation, I gave up on it. I was hoping that having this thing on a real blog site would make it easier for me to update, prompting me to write more often. Oh well.
October 28th, 2002
Whew! Part IV of the book on D3DX is now complete, with the chapter on meshes having just been released for review. The mesh objects are one area that has sparked many questions from in the newsgroups and mailing lists. I probably wrote 10 different test programs myself to make sure that I understood how everything worked. The result is probably the most comprehensive treatment of the D3DX mesh classes anywhere.
October 4th, 2002
I just finished the chapter on D3DX helper objects and released it for review today. I also got some feedback from a reviewer who is well versed in vertex shaders:
"I just finished reading your vertex shader chapter. That's the best text of vertex shader I've read so far for its accuracy and approachability."
Now that is the kind of feedback from a reviewer that keeps me going!
I'm in the home stretch now and I'll be finishing the manuscript and then things will transition to the production phase. Its starting to get really exciting!
September 27th, 2002
Yee-Haaa! I just released four new chapters to my reviewers, including the chapter on vertex shaders. If I have been lax in updating this diary lately, its because I've been busy working on the book.
At this year's SIGGRAPH, it dawned on me exactly why this book project has been such a huge undertaking. It is essentially a retelling of the past 25+ years of computer graphics API programming in a single volume. This is no small amount of material to cover! We still do the same things we did 25 years ago: we draw points, lines and triangles, we have a view frustum, we perform clipping. Every year since we've added more and more features to the typical graphics programming API: fog, line patterning, triangle hatching, Z buffers, stencil buffers, texturing, multitexturing, antialiasing and now pixel and vertex shader programs.
Direct3D also brings with it a utility library called D3DX that also covers a large amount of functionality: concrete classes for colors, vectors, matrices, planes and quaternions, COM object helpers for matrix stacks, font rendering, sprite rendering, rendering to secondary surfaces, rendering to environment maps, implementing effects with scalable techniques, triangle meshes, progressive meshes, simplification meshes, and skinned meshes. In addition to all of that, there is the X File API for reading and writing scene hierarchies to persistant storage and the ever present issues of installation, debugging and performance.For those of you who have been impatiently waiting for this book to arrive on the shelf, just imagine what an experience its been for me! During the process of writing this book, I've logged hundreds of documentation bugs, more than a few bugs on my card's driver and even a couple of bugs on REFRAST, the reference rasterizer from Microsoft. I've scoured over every inch of documentation and sample code that comes with the SDK. I've engaged in numerous discussions with other application programmers, the engineers at Microsoft and developer relations staff at various hardware vendors. In addition to all of that I've probably written over 100 test programs that explored undocumented or poorly documented corners of the API and libraries to bring you the most accurate and complete picture possible of this huge volume of information.
The meaning of all this is simple: my suffering benefits you! When you learn from my book, you'll be learning from a source that is more accurate than the SDK itself! 'nuff said!
July 15th, 2002
I haven't posted anything here for a while, so here's an update. I'm still working hard on the manuscript and things are coming together in a big picture sense. Next week I'll be attending SIGGRAPH 2002. I hope to have a draft copy of the manuscript on display at the Addison-Wesley booth in the exhibition hall and I will be attending the Direct3D Birds-of-a-Feather meeting:
Direct3D BOF (Birds of a Feather)
May 24th, 2002
Whew! I just released Chapter 11: Basic Texturing to my reviewers. This chapter explains the texture resources and the basic concepts of single-stage texturing. At 65 pages with a rather elaborate sample program (it already helped one coder find their mipmap-related texturing bug in a few minutes!), this is one of the longest chapters in the book so far, if not the longest. If you've ever tried to write a book, you know that getting 2 pages per day is not bad!
In addition to the sample program I send with the book, I usually end up writing numerous small programs that explore the dark nooks and crannies of Direct3D to give the reader the best explanation possible. I end up finding bugs in the docs (less and less these days, but they are still lurking in the corners), bugs in my driver (which I report so you don't have to), and on very rare occasions I find a bug in REFRAST. My pain is your pain, dear readers!
Now its on to Chapter 12: Advanced Texturing which will cover environment mapping, bump mapping, shadow maps, and multistage texture techniques. Another long chapter! Originally I had all this in a single chapter and it was just oo long, so it was split into two chapters. When chapter 12 is finished, that will wrap up the fixed-function portion of the pipeline in my manuscript and I'll move on to showing how the same effects can be achieved with vertex and pixel shaders.
April 22nd, 2002
Taxes and Chapter 11.... no, I'm not going bankrupt, I just happen to be writing Chapter 11 at this time of year :-). This is my chapter on texturing, which covers quite a bit of functionality. However, once this chapter is done with, I'll have completed the portion of the book on the fixed-function pipeline, and then I'll be moving onto shaders and other application concerns to wrap up.
April 9th, 2002
A new sample, rt_Rasterize, has been released to accompany the chapter on rasterization. I'm just finishing up this chapter and releasing it to reviewers.
March 29th, 2002
The chapter on lighting has been released to reviewers and other chapters have had some flesh put on their bones. The draft manuscript is now clocking in at ~450 pages and counting. In my typical thorough fashion, going over lighting in Direct3D revealed some dark undocumented corners for which I ferreted out the necessary information from Microsoft through the MVP program. You benefit from my pain and suffering! :-)
Eric DeBrosse has completed porting most of the samples to Visual Basic 6. VB doesn't have an "AppWizard" to generate the boilerplate code for a Direct3D application, nor does it have a set of sample framework classes for handling the standard stuff like exclusive/windowed mode toggling and so-on. However, Eric is creating a reusable chunk of VB code that serves the same purpose. Way to go, Eric! We plan on including that code on the CD-ROM with a modified version of the "application apprentice" VBScript I wrote that generates a new VB project from a template. (We don't need the apprentice anymore for C++ code as the DX8.1 AppWizard takes care of that.)
March 13th, 2002
I'm wrapping up the chapter on lighting and shading and fleshing out some of the other chapters to come. Fellow DirectX MVP Eric DeBrosse is porting my sample code to Visual Basic 6 for inclusion on the CD-ROM. Thanks, Eric!
March 4th, 2002
Well its been a while since I wrote anything here, but I've been
hard at work writing sample code and manuscript. I've just released
January 4th, 2002
Whew! Its been a while since I wrote anything here. Real-life unfortunately intrudes upon my personal plans. Writing this book is purely a labor of love for me, but it doesn't pay the bills. (Friends who have written books tell me that it is not very lucrative compared to how much time you spend on it, but that it is good for your career and personal sense of satisfaction.) During the summer, when I was getting most of my progress under my belt, I was on leave from my full-time job to work on the book. Then I went back to my full-time job and progress on the book wasn't even worth reporting here. Writing a book like this is a full-time job all on its own!
Now I am back to working on my book full-time and will be wrapping up the manuscript in the next few months. If I'm lucky, the printed book might be ready for the Game Developer's Conference in March. A more conservative estimate would say that the printed book will be available in time for SIGGRAPH 2002 and that it might be available for pre-ordering from the publisher at GDC.
I'm off to SIGGRAPH once again. That means a brief hiatus from working on the manuscript to get a breather. I've been working pretty hard on the book -- apart from a little hiking for an hour, its what I've been doing all day every day! SIGGRAPH always recharges my batteries and energizes me once more, its great fun!
Chapters 4 (2D Applications) and 5 (Modeling) are finished! I've sent them out for review. I'm working with my publisher for a promotion during SIGGRAPH. We might make full-size pipeline posters to promote the book, or maybe just some flyers. Look for it at SIGGRAPH 2001 at the bookseller's booths! I'm really liking the way this is coming together, with each relevant method of the device introduced as they are needed. I think this is going to lead to a very clear and logical organization of all ~100 methods on the device. Now onto Chapters 6 (vertex transformations) and 7 (Viewing).
Whew! I've been so absorbed in the "book writing zone" that I forgot to come here and update this diary! Chapters 1-3 are finished -- Introduction, Direct3D and Direct3D Devices -- and have been issued to reviewers for comment. Now on to the last chapter of Part I, 2D Applications before moving onto vertex processing in Part II.
In every project, there is a phase in the beginning where you build some tools for repetitive tasks to make the rest of the project easier. The folks on comp.text.tex have been helping me out here and there as I build tools to help me deal with some of the more interesting formatting issues in a programming book. The only reason I am able to tackle some of the more difficult issues easily is because of the work done by others before me that they have graciously contributed for other authors to use.
Creating these tools for the first few chapters will let me cruise through the later chapters as more of the same without having to digress into handling a formatting issue instead of writing the text. I think I probably write each section of material two or three times, revising the explanations each time so that they read a little easier and fit better into the larger context of the book.
This week I've been working on some of the mechanics of putting the manuscript together. This involves working out a procedure for the generation of figures for the book as well as including source code listings in the book. Its been good to get back into the meat of working on the manuscript.
For the figures I'm drafting them in Visio 2000. Originally I had tried out Corel Draw, but it took me forever and a day just to get a few simple boxes with text and arrows. In Visio, this was very easy to do because Visio is designed more for creating technical diagrams, while Corel Draw is designed more for illustration. The differences may seem subtle and inconsequential, until you sit down and work with the tools a bit. The illustration packages are very powerful and sophisticated in terms of the images they can create, but that power and sophistication requires training to use easily. Visio, while not being as precise, is far simpler to use in creating my figures. I save them as encapsulated PostScript for inclusion into the manuscript proper.
For the source code listings, I've worked out a way that I can include the source code directly from a working Visual C++ project. A common complaint about programming books is that the code doesn't work when typed in literally from the book. To avoid any divergence between working code and what's in the manuscript, I include the source code listings directly from the .cpp file into the manuscript with line numbers. This lets me refer to pieces of the code listing by specific lines as in "lines 34-50 enumerate available devices", allowing for reasonable discussion of a possibly lengthy code listing.
I am negotiating with Microsoft, nVidia and ATI for inclusion of materials they've produced on the CD-ROM accompanying the book. The DirectX 8.1 SDK comes from Microsoft. nVidia has produced a wonderful effects browser and other advanced samples in their "DX8 SDK" -- saving me the trouble of writing them. ATI also has a nice collection of samples and a program for visualizing the multistage texture setups. All of this software is freely available for download at their respective web sites. While I've obtained informal assurances that I can include this material with my CD-ROM, that's not enough for a publisher. So, I've started the ball rolling on getting "official legal permission" to include their material on the CD-ROM.
I met with a local reviewer and gave him a snapshot of my material so that we can work closely to gether on feedback. Another local reviewer at my old employer -- Evans & Sutherland -- is also going to work with me on reviewing my book. Having local reviewers is so nice. Many people have offered to review my book by email, but so far noone has responded at all with review comments for particular material I've sent out. I can only hope that "no news is good news" and they're not saying much because I've said it right. Still, its nice to meet over coffee with someone who has a marked up printout of your manuscript.
This week we had a short digression into making an installation for the CD-ROM accompanying the book. I am using Windows Installer for the install program, which I like. I am not using any of the commercially available authoring tools because I think they stink. You can avail yourself of the fruits of my labor by looking at my Windows Installer tools page.
I finished up the ID3DXSprite sample. Reverse engineering the transformation order for ID3DXSprite::Draw wasn't particularly fun. Transformation matrix related bugs are always so hard to debug because you can be completely wrong and look 85% correct!
I downloaded and installed DX8.1 beta1 SDK. Mmmmm.... beta. The documentation has changed quite a bit, so I'm going to spend some time comparing the two. I compared code functionality by diffing the header files since the documentation can have bugs. I will easily be able to incorporate the additional features and information from DX8.1 into my book.
I'm talking with a local artist I know about designing some skinned mesh characters in Maya for the CD-ROM. I don't have experience in Maya and can't afford the software just to see the file exporter, but he can do that easily. I'm hoping we'll be able to design a cool skinned mesh character or two that can be used with the SkinnedMesh SDK sample. People have requested more .x files containing skinned characters from Microsoft, so maybe this will help.
I'm working on a .x file explorer program. I've written it as a WTL project and coded up the tree view portion that reflects the structure of the .x file. This is my first 'real' WTL application. You can download WTL, Windows Template Library, in the Platform SDK from MSDN. WTL is under the "Source" feature in the custom setup dialog.