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.

2 comments:

  1. If you're going to publish a book containing information about large world coordinates, you should at least mention fixed point as a potential solution as well. Tom Forsyth has a great post about it : http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[A%20matter%20of%20precision]]

    ReplyDelete
  2. Thanks for the link. I've read lots of Tom Forsyth's stuff but I don't recall seeing this. I added a reference to it and a bit of discussion.

    We do cover an encoding scheme for representing a double using two floats (which allows emulating a higher precision subtraction on a 32-bit GPU). It is basically a fixed-point representation using the fractional bits of two floats and is discussed in more detail here:

    Precisions, Precisions

    Both articles actually make similar arguments about the fixed-point precision relative to the size of Earth and the distant to other planets.

    Thanks again for the link.

    Patrick

    ReplyDelete

Note: Only a member of this blog may post a comment.