I've been scouring the internet for hours looking for a solution to blending biomes that have different amplitudes and frequencies together to create a seamless world. A recurring theme I'm seeing is that they have solved it by using linear or bilinear interpolation. I'm having trouble finding an implementation that would work for me.
Currently each biome is the same noise function but with adjusted frequencies and amplitudes to create variation. The problem is that it would result in "seams" between biomes, for example the plains and a mountains biome.
I think I understand how linear interpolation works. I have functions for it as well, but I'm confused as how to implement it. The game is essentially a 2D Minecraft type game. Would I have to determine the neighboring biomes by doing additional calculations across the x axis for every single block? I'm worried about performance if I somehow do this method.
I'm not sure if this would help but biomes are just determined using three instances of 1D noise, depth, temperature and rainfall. Depth is really just for oceans, but rainfall and temperature determine the biome. I have this basic setup (probably not the best code)
if(biome === 'desert') {
frequency = 0.09;
amplitude = 8;
elevation = 65;
} else if(biome === 'mountain') {
frequency = 0.1;
amplitude = 20;
elevation = 65;
} else if(biome === 'tundra') {
frequency = 0.08;
amplitude = 7;
elevation = 65;
} else if(biome === 'spruce') {
frequency = 0.01;
amplitude = 4;
elevation = 65;
} else if(biome === 'plains') {
frequency = 0.08;
amplitude = 8;
elevation = 65;
} else if(biome === 'forest') {
frequency = 0.008;
amplitude = 7;
elevation = 65;
} else if(biome === 'ocean') {
frequency = 0.2;
amplitude = 9;
elevation = 30;
} else if(biome === 'icy ocean') {
frequency = 0.2;
amplitude = 9;
elevation = 30;
}
var height =
(this.biome.noise.terrain.value(xt * frequency) * amplitude) + elevation;

