Open IPotatoCouch opened 4 years ago
This solution that I quickly thought up of would only work with 2 biomes, but maybe someone smarter than me knows how to extend it to more than 2. I haven't spent much time on this.
First, create 2 noise functions; 1 for biome A called GetA(x, z)
, and one for biome B called GetB(x, z)
. Those functions would generate the height for the biomes. So GetA()
could for example be an infinite plains biome, and GetB()
and infinite mountains biome.
Then, have a third noise function representing the blend. For any given point (x, z), the height of point (x, z) would be y = Lerp(GetA(x, z), GetB(x, z), GetBlend(x, z))
. GetA()
and GetB()
representing the noise functions of A and B. GetBlend()
would tell how much to blend the biomes: 0 would be completely biome A, and 1 would be completely biome B.
I would rather do something like this, than a height-based biome, as height-based gives rings of biomes and I don't really like the look of that
Thanks for the tip! This sounds like a good solution. For multiple biomes I was thinking would it be possible to generate a biomes map, something like this maybe.
Each biome has its own color, so with a map like this it would be easy to determine where each biome is located. One issue is blending biomes together. Maybe even make biomes bleed into each other, so it would give more realistic results. I'm not smart enough to figure this out tho..
Yeah, the blend is very difficult. I remember once (like maybe a year ago) trying a climate based biome system, where the inputs are 2 noise maps, one for precipitation and one for temperature. Here's picture of what I mean:
In that experiment, I think I could generate the biomes nicely, but blending the heights was the biggest problem which I never managed to solve.
That looks really nice! What if you blend the biomes map like this? Each biome has its own noise so once the map is blended so as the noise maps. Would that be possible?
This is a bit ugly example, but does this even make sense? In my head this sounds logical yet I have no idea how to accomplish this.. :D
Biomes map would almost act like a mask for noise maps, if the biomes map is 'blurred' you would get a smooth transition
I think that's a great idea! I'll post something here if I manage to think of some implementation. It's definitely a hard problem.
Awesome thank you! 🙂 Been scratching my head for hours, it's quite a task.. A bit too much for my brain too handle 😄
I looked for the repository about the climate based biomes (like in the diagram in the previous comment) and found it! I made a few changes to fix the blending, and made the repository public. Here it is: https://github.com/Eldemarkki/TerrainBiomeGenerator.
This is what it looks like with blending=0:
And this is with blending=3:
It's not perfect, the colours are quite sharp looking at some places, and it is not very realistic as there are multiple places where it goes from desert to tundra, but that can be tweaked quite easily.
And in case it wasn't obvious, that is not using marching cubes.
The blending is done by just taking the average height around the sampling point. The transition from any biome to ocean is not blended, because I don't want the ocean to suddenly go upwards near the transition.
Really nice! This works pretty well! Will you be implementing this approach to Marching-Cubes-Terrain project as well? 🙂
I'm not really sure. If I end up implementing it, it most likely will not be in the main repository, but in the TerrainBiomeGenerator repository.
Different biomes / regions could be nice to have :]