top of page

PROCEDURAL BIOME BLENDING (UNITY)

PERSONAL PROJECT

During the COVID-19 lockdown I kept myself busy working on a custom terrain generator that would include biomes and biome blending. The terrain is calculated using Unity's built in Perlin Noise function, as well as a layer of Noise used to calculate a "biome map". The terrain is split up into slices and assigned a biome from the map, the algorithm then checks it's neighbours for any slices with a different biome. If there is a different biome adjacent then the algorithm will lerp the height map gradually towards the different biome.

 

I started this project pre-lockdown and used it to help me expand my knowledge of Unity as I had only started using it at the beginning of 2020. I took this opportunity to also learn more about procedural techniques as I find it particularly interesting.

FEATURES I IMPLEMENTED

BIOME BLENDING

Each slice of terrain is split into 4 sections, when loaded these slices will check their neighbours and blend if a neighbouring slice is a different biome. The slice can lerp to smoothly transition to the new biome, but special cases must be made for any slice in a corner (a slice that has neighbouring slices of different biomes).

​

Splitting the slice into 4 sections allows a slice to smoothly blend between different biomes on opposite sides if needed.

​

CUSTOM NOISE VALUES

In the menu you can change the busyness (frequency), maximum height (amplitude), and level of detail (octaves, aka Fractional Brownian motion) of the noise. These values are biome independent and you can generate a terrain map with up to 4 different biomes!

​

DYNAMIC LOADING

The terrain generation is infinite, so slices are loaded dynamically based on player position. As the player moves around slices will be loaded based on a load range.

​

TERRAIN SERIALISATION

Upon exiting the scene the current terrain noise values are saved to an XML file, and the terrain meshes are serialised into a byte array, and then stored in a binary file. This means you can explore the terrain, leave the program, and then load back up your terrain without having to re-calculate any of the terrain that has already been calculated.

​

MULTI-THREADED CALCULATION

Each terrain slice is split up into 4 quadrants, and each quadrant is calculated simultaneously when the slice is needed to be calculated.

bottom of page