Wow, this is addictive! Over the past two days I roughly quadrupled the performance of the terrain engine. I also cleaned up some of the threading and moved normal generation to the threads, so now there are almost no hitches in the framerate while traversing the terrains. In fact, the terrain engine is almost to the point that I think fairly high-speed flyovers should be possible in spaceships. That'll be nice, instead of having to heavily restrict atmospheric speeds just for technical reasons.
I'm having loads of fun exploring new and ever-more-complicated terrain functions!
Note: the level of detail shown in this screenshot is probably not realistically feasible for games. The terrain function is insanely large, and takes too much time to compute for high-speed traversal to be possible. However, it may still be possible to walk the terrain without running into problems.