Monday, November 29, 2010

A Tip for Finishing Chapters

It's always fun to start writing a chapter, especially if it is on a particularly interesting topic. Finishing the chapter can be a bit harder - sounds like a software project, right?

Finishing involves lots of details: rewording, double checking equations, actually doing TODOs (or sometimes just removing them), etc. After reading and writing so much about a topic, I want to move on to the next chapter - but I can't, not until I finish what I started.

A tip that helps me finish a chapter is I tell people when I'm going to finish it. In particular, I email potential reviewers asking them if they are interested in reviewing it, and telling them when I expect to be done. I have to finish it now; I can't ask these kind people to do me a favor, and not follow through.

This tip doesn't work magic, but it helps keep me on track. I can't expect to write 30 pages overnight just because I told someone I would. But if I'm 2/3 through a chapter, I can predict how long it will take to finish at a reasonable pace, and tell reviewers to help ensure I keep that pace.

Wednesday, November 24, 2010

OpenGlobe on Linux

We develop the example code for our book using Windows, but we realize not all readers use Windows. The good news for them is, over the past few days, we got the vast majority of our code to build and run on Linux using Mono. Here's a screen shot of one example from the globe rendering chapter:


We tested using Ubuntu 10.04, which comes prepackaged with MonoDevelop 2.2 and Mono 2.4.4. Our code builds cleanly with no warnings, and, thankfully, all of our unit tests pass:


(Yes, we actually write unit tests for the book code.) We need to investigate our examples that use a third party Shapefile reader a bit more, but we may wind up writing our own Shapefile reader when the manuscript is done.

I have to say that I am quite impressed with Mono, MonoDevelop, OpenTK, and NVIDIA's Linux drivers. Porting to Linux was even easier than I hoped.

We also plan to test on Mac when Apple releases OpenGL 3.3 drivers.

Sunday, November 21, 2010

Vertex Transform Precision

I just finished writing a chapter on a rendering artifact that many people don't even know exists until they try to use massive world coordinates, and suddenly objects start to bounce or jitter as shown in this video:



Eliminating jitter is important for high precision rendering in virtual globes, and in massive-world games, like flight simulators. When world coordinates are large, yet users can zoom in very close to objects, floating point round-off errors manifest themselves as jitter.

This chapter is on techniques for eliminating jitter. Major topics include:
  • Why exactly jitter artifacts occur.
  • Eliminating jitter by rendering relative to center, i.e., using a floating origin [code].
  • Rendering relative to eye.
    • A slow CPU implementation that I only recommend for certain cases [code].
    • A fast GPU implementation we use in Insight3D [code], an even more precise GPU implementation [code], and a technique I've called Precision LOD [code].
  • Lots of details on the trade-offs between approaches.
If you love (or hate) jitter like I do, also read our coworker's article, which served as the primary reference for this chapter. Also see the DSFUN90 Fortran library, which contains routines for performing double-single arithmetic, i.e., emulating doubles in software.

Tuesday, November 16, 2010

A K Peters Catalog, Amazon, and More

I just received a hard copy of A K Peter's 2010-2011 catalog in the mail. Exciting. What's even more exciting is our book is listed - with an ISBN and all!

To add to the excitement, I just found our book on Amazon. It is also on the CRC Press website. (A K Peters is now part of CRC Press.)

If you visit the Amazon or CRC Press page, you may wonder why the title is 3D Engine Design for Virtual Globes, not Virtual Globe and Terrain Rendering, which is listed in A K Peter's catalog and our blog. They are actually the same book (check the ISBN).

In the original book proposal, I suggested the title 3D Engine Design for Virtual Globes. After a few months of writing, I suggested a title change to Virtual Globe and Terrain Rendering since there is more content on rendering algorithms than engine design, and I wanted to stress our coverage of terrain. The title still isn't final though. Once we firm it up, we'll let everyone know. Of course, the content remains unchanged.

I also wanted to supplement the description of our book in the AK Peter's catalog. I am listed as the only author, but I assure you, Kevin is the coauthor. The catalog must have went to press before Kevin came on board. Our book is listed as approximately 350 pages. We actually already surpassed that, and Kevin and I will still be writing furiously for another six weeks. The page count could climb as high as 450 in our draft, but once it goes through copyediting, layout, etc., I can see it becoming shorter as figures are organized, fonts are selected, etc.

Finally, we plan on posting some sample content in February or March, after the manuscript goes through copyediting. In the meantime, we'll continue writing posts on chapters as we finish them.

Tuesday, November 2, 2010

Twitter

Short version: I'm on twitter now: pjcozzi.

Longer version:

I remember when I first learned what a blog was back in 2000. I was an intern at Intel, and stumbled across Joel's now famous blog. The first post I read was The Guerrilla Guide to Interviewing. After that I was hooked, and followed Joel almost religiously until 2006 or so. I kept following after that, but not as frequently (maybe grad school had something to do with it). At the start of 2008, AGI launched a blog for Insight3D, and I wrote my first blog post. I also started reading dozens of graphics blogs, many of which are in our blogroll.

Since then, I've gotten use to the idea of writing blogs to share technical ideas or products news, so it was natural to launch this blog for our book. During all this blogging, I somehow managed to ignore twitter. Clearly, I was missing out, so I'm on twitter now: pjcozzi. All I need to do now is make a LinkedIn page and I'll be completely connected! Maybe once the manuscript is done...