MotoGP: mind the gap

Originally posted to Shawn Hargreaves Blog on MSDN, Thursday, June 4, 2009

I keep thinking I'm done writing about MotoGP, but then more topics occur to me.

And then I think, is this just self indulgent rambling through the meadows of nostalgia? "Here's a tall tale from back when I was a lad, when computers were still programmed in binary and Tony Blair was popular..." But people seem to be enjoying this series, so I guess you'll have to bear with me a while longer.

Now where was I?

MotoGP tracks were split into sectors using a kd-tree (similar to an octree). Each sector was tessellated at three levels of detail, so we could draw the nearby environment with nice smooth curves but use fewer triangles for more distant pieces.

When you join pieces of environment that are tessellated differently, there will be cracks where they do not exactly meet up. This is a common problem in terrain rendering, often solved by adding fringes or stitching in extra triangles to fill the holes.

We chose an easier solution. Our content build process simply detected which edges were shared by patches from more than one sector, and always tessellated those edges at maximum detail, even when creating the medium or low detail geometry. This freed the game code to draw each sector at whatever detail level it liked, and everything was guaranteed to join up without requiring special runtime logic. Sure, this added a few extra triangles to our low detail geometry, but the vast majority of patch edges did not lie on sector boundaries, so the cost was insignificant.

Takeaway: moving work from game engine to content build process = good stuff.

Blog index   -   Back to my homepage