Thanks for all the comments.
Some explanations:
I split the whole scene which is to be generated into smaller tiles (typically 64*64*64), this saves memory (the memory used for creation stays constant, no matter how big your scene will be) and its easier to use several threads to speed things up (but every thread must has its own temporary memory for generation, so this could be a big problem, you can solve that if you use smaller tiles (which are slower though)).
So next is to create the density map for one part, these are double the size of the part (128*128*128) to prevent visible edges between the parts caused by wrong normals and occlusion term. Creating one takes around 50ms. Actually this map are 128 floating points textures which are filled with a shader, and then copied back to an array (faster then doing everything on the cpu). The densitymap specify which parts of the scene is rock (positive values) or air (negative values).
I'm using 4 64*64*64pixel noise 3d textures (filled with rand()s) which gets combined at several different frequencies and amplitudes to form the scene, but you can also encode your own worlds in the shader like planets, or a helix or...
On this map i run the marching cube algorithmus which creates the polygons. Normals and ambient occlusion term gets also calculated. This takes 500ms-2sec (depending on how many polygons needs to be created and if ambient occlusion is calculated)
After this there is also the possibility to generate several LOD meshes.
Can you bake the ambient occlusion into the texture?
No, it is saved per vertex at the moment and i don't want to unwrap this meshes.
how do you generate seamless uv coordinates? is this some kind of unwrapping or do you use a procedural approach?
Its samples the texture 3 times (with XY, YZ, XZ world coordinates) and blend these according to the surface normal.
60fps means ~500k textured polygons on my PC, which i think is enough for a decent terrain
.
Some numbers:
Memoryconsumption
1 thread: 350mb
2 threads: 570mb
4 threads: 900mb
Creation time of the babel tower:
1 thread: 16 sec
2 threads: 10,9 sec
4 threads: 10,7 sec
i think i will release a sample demo with the tower level (i like that one), but first i will try i could get some nice clouds around it and i must find a way to get collision with these meshs (any idea?)
http://swollen-eyeballs.org/terrain/babel_00.jpghttp://swollen-eyeballs.org/terrain/babel_01.jpghttp://swollen-eyeballs.org/terrain/babel_02.jpg