Revisiting the block worlds stuff
Accidental Noise Library Perlin cube random
Since ANL is just a Lua framework, with no in-built graphical capabilities, visualizing such a beast as a cube world isn't straightforward. The example script constructs the noise function, maps it to a voxel array, then iteratively constructs meshes for each of the block types using the Volume functionality, built atop PolyVox. It then dumps the meshes to .OBJ format files. The script generates chunks of the function, specified by chunkx and chunkz coordinates, so the world is essentially infinite (at least to the limits of double precision).
The function isn't sophisticated. It shows strata layering using a distorted vertical gradient, ore deposits, caves with the lower levels filled with magma, a solid bedrock layer, etc... There is no large-scale variation in the distortion function, such as you might want to use if you are generating different kinds of biomes and geography; it just uses a simple fBm fractal with some slight vertical axis dampening to reduce the frothy distortion that can result in floating islands of terrain. Here are a couple shots of it in action:
I don't do much with this sort of generation. I don't really have any interest in building a Minecraft clone, for example. My interest is purely academic, a fascination with procedural world-building in general. Every time I tinker with this kind of thing, I am reminded how my library is actually kind of slow. This example script does a lot of stupid shit with copying and recopying buffers, iterating voxel arrays multiple times, not cacheing some values, etc... It could be faster, but even if I squeezed it as tight as I could it would still be somewhat slow.
I've always been a concepts guy. I have ideas for things I want to tinker with, I build a tool or a prototype to demonstrate it, I move on. I've spent a good bit of time on ANL, mungeing things around, re-organizing, etc... but I've never been very good at optimization, and so ANL has never really been tightened up. But lately, I've been thinking about how I can make things faster.
To start with, it seems like learning about SSE might be a good place to go. This sort of function wrangling is pretty computation-heavy (especially when dealing with the higher orders of noise; ANL does up to 6D noise, which can be slow as balls) so I'm thinking that between implementing many of the computations using SSE intrinsics and trying to take advantage of multiple cores, I might be able to squeeze some better juice out of this thing. I don't know how much time I'll be able to devote to it for now, but I'll probably at least start reading a few sources to learn the ins and outs of SSE to see if it's something I could pull off.