Monday, October 7, 2013

Terrain and Biomes and Flora oh my.

So I dusted off the terrain / biome system to hook it up to the voxel terrain system, since it makes a lot more sense to model very large landmasses in a way people can understand.  Density functions by parts isn't a bad thing, but even if you expose this with a UI flow graph -- who the fuck is going to understand it that also wants to use a flow graph chart?  Exactly.

Better to allow for 'big picture' visualization of what those damn things do I say.  Take for example this simple gem on how to generate large landmasses... Clamp your density by masks of large water bodies and scale by smaller ones.  Simple and effective.  Rock composition is the variable that effects water erosion the most.  It happens in nature everywhere that's why you get the grand canyon to the salt flats.  Forget elevation as the main factor.

In fact you can completely ignore the physics and go for a purely artistic version of a bay like below.  Only using three of the density function operators no less for a playground for artists to start hacking away.  Each KaDensity function takes a list of parameters and returns a density.  They're pretty self-explanatory:

KaDensityNoiseSimplex2d : octaves, frequency, lacunarity, gain
KaDensitySaturate : density
KaDensityMul : density_A, density_B

Here each stage is generated via simplex noise and saturated to threshold the values, and then combined to produce composite images.  Don't have to teach artists about physics or generate all the voxel terrain for them to visualize while dialing it in...  make continent iteration quicker.  This mask alone has a large effect on the Terrain and Biomes as you can see.  From here you can pass this to VoxelSector density samplers and get your 3d terrain as a GPU visualization and / or CPU mesh from isosurface extraction as seen previously on the blog.  BTW I have found the ideal width of a river is ~1km so these pixels are about 1km^2 while typically I would generate VoxelSectors at about 1/4km^3 to give a sense of scale.  That makes these preview windows about 512x512km while the camera in game tends to only go to a view distance of 12km.  From here you can feed back masks into each other such as for Fanua mask generator.  :)

Generating Water Mask
Terrain + Biomes Visualization

Flora Visualization

No comments: