I’ve been extending the Voxel wrapping framework from the previous post or two into a more fully fledged procedural terrain system. I wanted to get a reasonable sense of scale and distance, but I didn’t want to cripple the framework with too much crazy LOD code. Inititally I did implement a LOD scheme , where the chunked voxelcubes that make up the terrain stepped to covering 2x the volume at a specific distance (lowering the resolution by half). This inevitably led to some degree of popping, where the geometry suddenly realigns to a finer mesh as you approach. What I realised is that on a traditional 2d heightmap terrain this sort of LOD can work well, since essentially the popping only happens vertically (ie a hill becomes slightly flatter or angular as it gets further away). On a full 3d terrain the popping happens in all dimensions. Its much more noticeable to see a floating island suddenly deform at all its edges.
In the end I decided to use a brute force mesh and implement some fogging and a sensible skybox to merge the distant polys into the horizon. This works well enough and maintains the fidelty of any floaty rock formations. As I was working on this I checked a number of other terrain engines in open world games and realised that, in many cases, low poly terrain can easily be given more scale and detail with simple grass scattering. Ive now implemented this within the procedural generation routine. There are some issues specific to a full 3d terrain as grass is basically projected from the sky onto the generated terrain mesh. So a floating island will stop grass growing beneath it at the moment. However it works well enough for now and certainly improves the sense of scale and variation.
The grass meshes use a shader I wrote that perturbes their upper vertices with a sine function to imitate wind. Each vertex point is sampled as an offset, so they dont all wave in unison, but you can control strength and ocscillation speed. Ultimately Id quite like to get the mesh to part around the player, but its not important for now. Also, to speed up rendering, once they grass meshes are located I combine them all into a single mesh for improved drawcalls. Its a similar method to how I will be doing scenery (and how it worked in the earlier prototypes) but there are lots more grass meshes than you would have trees. Anyway the existing procedural texturing shaders are still wroking fine in the terrain, and I’ve been experimenting with a ange of colors and gradient effects. As usual there are more images on my flickr stream.