But using CPU (not GPU). I'm stuck at generating the procedural terrain. I just can't
figure out how make a 3D texture the way it looks in the article (fig. 1-10). Am I missing something big here? Here is the code:

Why should there be no caves and overhangs when using 3 octaves? You're using 3D noise, so there will generally be caves and overhangs even with 1 octave. Also, to my eyes the biggest problem with the screenshots you show looks like just not enough resolution in the polygonization.
–
Nathan ReedJul 23 '12 at 17:52

Ok, here's another screenshot, same code but with nz=20 instead of 10 (a bit thicker). There's enough resolution, it's just that lacuranity is set very high (a typo, should be 5). If it's lower (1.5), the problem is even more obvious (right pic). link
–
kafkaJul 23 '12 at 19:47

1 Answer
1

In the article, the base density function is float density = -ws.y; This means that at high altitudes, the density will definitely >= 0 producing completely air, and at low altitudes density < 1 producing solid land.

From your screenshot, it looks like you just generated a solid block of uniformly 50% dense terrain instead of the gradient the article used.

Excellent, it works like a charm. noise should be initialized to -y and the step[] variables should be 1.0 or actually shouldn't be there. Also lacunarity in the density function is not necessary.
–
kafkaJul 24 '12 at 12:42

Also the 7th and 8th values in the freq[] array are miscalculated and should be 0.06 and 0.03.
–
kafkaJul 24 '12 at 13:22