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.
It's nothing special. Quadtree-based with multithreaded, CPU-side generation (no framerate stutter, not quite as fast as GPU, but high-precision). Effective resolution is 262144 x 262144, rendered using 33x33 nodes with maximum depth value of 13. Extremely detailed when zoomed in (exceeds resolution of height function). Super-fast high-altitude flybys are still pretty rough, as the threaded queues get clogged. Still working on solutions for rapid regeneration. No crack-patching (yet). Basic, but beautiful.
Finally, a terrain that is, without a doubt, better than the ones I made in Esenthel so long ago when I didn't know a thing about graphics programming.
23kb executable. Procedural is the future.
Added some quick and dirty colors. Also pushed the quality to 1024x1024, just to see how it would look. Turns out to look amazingly-detailed...too bad it takes about a minute to generate (this is still CPU-side).
When I say quick and dirty, I mean it. Height colormap + perlin dirt map computed per pixel. Ouch. 5 KB pixelshader. Bigger ouch. But that's the beauty of prototyping! You don't have to be efficient about it. Took all of 5 minutes to write the shader for this.
The last image is only a 512 grid, for reference. The others are 1024.
Not surprisingly, I'm still doing work on procedural terrains every now and then. I decided to play with them on the CPU for a change tonight, just to experiment with new combinations of functions. Definitely surprised by the results!
Hopefully I'll get a chance to move this onto the GPU soon and cook up some sort of LOD scheme to start exploring these beauties!