In today's developer journal, I will be talking of what I've been working this past month: an improved algorithm for the planetary terrain engine. Why yet-another terrain engine update ? Which results did we obtain ? Find more in this journal, as well as a bunch of new pretty pics !
Why another planetary engine update ?
It's no secret that we've updated the planet engine a couple of times in the past years. Each iteration has seen various improvements, but many problems were left to be addressed at a future time. We decided to address those problems now, since the Kickstarter is coming in a few months and we're planning to release a tech demo to hype it. The interactive tech demo will mostly focus on the planet engine, which I'm sure a lot of people are eagier to test after waiting that many years.. therefore, our tech must be as pretty as possible in order to keep expectations high.
But what are those "problems" I'm talking about ? Well, they can be placed into two categories: performance and quality.
Performance
The new terrain algorithm that we're using is both much more simple, code-wise ( making it easier to configure and maintain / debug ), and runs a lot faster than before. There is less dependance on the CPU, meaning that we're now able to reach the theoretical throughput of geometry processed by a video card ( when it's not fill-rate limited of course, ie. when it's not limited by the amount of shader work.. ). That makes it much more future-proof, and able to use the all potential of the most powerful video cards out here.
Last time I benchmarked our terrain engine, it was topping at 350-400 millions triangles per second, on my Radeon HD 6870. And it isn't even using patch instancing, which we cannot use due to the spherical nature of our surfaces.
Overall, our new implementation is in average x2.5 times faster than our old terrain engine (
the one we showed in the tech demo 2010 video).
Quality
Another motivation for changing our algorithm, but not the least, was to fix popping artifacts. The tech demo 2010 was litterally full of those. These happen when a terrain patch gets sub-divided (as the camera zooms in closer to the terrain), therefore suddenly more geometry appears, and the texture gets replaced by another. We now use geomorphing, which means that we morph the geometry between the various level-of-detail levels, and we also blend textures together so that terrain features smoohtly appear, instead of popping "in your face".
In addition to geomorphing, we've also added support for normal mapping for the texture layers (grass, rock, etc..), which improves the lighting a lot in some cases.
Finally, some fractal noise has been added to displace the texture layers. It makes a lot of transitions look more natural.
The art is placeholder. Normal maps were generated from derivating grayscales, so they're not very good. We also have plans in the future to address the tiling patterns you see when a single texture is repeated a lot, but that will have to wait a bit.
None of the pictures in this article have shadows. This is another thing I'm going to reimplement and add back soon. More on that in a future dev journal..
Screenshots
You can click on those pictures to see them in HD. I guess they'd make for some nice wallpapers if you want
Flavien