I'm using https://github.com/Zylann/godot_voxel for script-wise generation of terrain. My current approach is to sample a noise function given an X-Z coordinate (and do various transformations or whatever) to spit out an integer value of the surface height. anything below or equal to that value is set to generate as various blocks, anything above is set to air, and chunks that have no blocks intersecting generate as entirely air chunks with a special fill function (which is computationally faster to fill an entire chunk with one type)
The idea is to detect, as soon as possible, if a chunk would contain any blocks at all, and turn it into a surface chunk that does more fine checks to generate or an air chunk that simply fills with air and loads immediately.
My idea is to loop through the bottom 256 blocks and if at least 1 has a valid noise, generate as a surface chunk, but this is quite inflexible and quite likely slow compared to a more clever approach that i'm not thinking of.
Anyone have any ideas / experience with this?