Godot Version
4.3
Question
Hi! I have 3 biomes currently that each spawn at varying heights in the world. I have a noise map to calculate the altitude at a given point in the world for biome placement. The 3 biomes also have noise maps to create different terrain shapes.
Currently I am using the Terrain3D plugin which takes a heightmap as an input and deforms a mesh to create a landscape, therefore I am plotting all the biomes onto 1 heightmap (I’m not entirely sure if this is the correct way to map biomes onto terrain).
My problem occurs when the borders of biomes meet. Below is an image of the biome borders without blending. (scaled up for better visual)
I assume this is due to the different terrainscale parameters I have for each of the biomes and thought it would be an easy fix by blending.
Below is the code I have for “blending” the biomes.
for x in range(0, width):
for y in range(0, height):
# init vars
var heightMapVal : float = HeightMap.get_pixel(x,y).r # decides which biome to place
var temperatureVal = Temperature.get_image().get_pixel(x,y).r # currently unused
var scaledHeight : float = mapHeight - (heightMapVal * mapHeight) # the heightmap scaled by mapheight (500), i am using depth so must subtract the mapheight
var selectedBiomes : Array[BiomeRules] # biomes influence a given point
# create list of biomes at point
for i in range (0,Biomes.size()):
var biome : BiomeRules = Biomes[i]
# heightBlendDropoff is how much you want the borders to overlap
if biome.DepthMax + HeightBlendDropoff >= scaledHeight and biome.DepthMin - HeightBlendDropoff <= scaledHeight:
if biome.TemperatureHigh + TemperatureBlendOffset >= temperatureVal and biome.TemperatureLow - TemperatureBlendOffset <= temperatureVal:
selectedBiomes.append(biome)
# loop overlapping biomes
var biomeAlpha : float = 1 # the alpha used to alter the overlapping biome influence
var finalBiomeVal : float = 0
var offset : float = 0
for biome : BiomeRules in selectedBiomes:
if scaledHeight >= biome.DepthMax:
biomeAlpha = 1 - abs(scaledHeight - biome.DepthMax) / HeightBlendDropoff
elif scaledHeight <= biome.DepthMin:
biomeAlpha = 1 - abs(biome.DepthMin - scaledHeight) / HeightBlendDropoff
var biomeVal : float = biome.TerrainNoise.get_image().get_pixel(x, y).r # the value of the biome noisemap at a given point
var scalarFloat : float = (biome.TerrainHeightScale / mapHeight) # how much to scale the biome noise by
offset = clampf(heightMapVal - scalarFloat, 0, 1.0) # offset of the heightmap (the lowest point of the biome)
var finalVal : float = (biomeVal * scalarFloat) # this value mapped onto terrain is the first image
finalBiomeVal += (finalVal * biomeAlpha) # altering biome influence for multiple biomes?
finalBiomeVal += offset
If anyone knows of an alternative way to create terrain w/biomes in Godot or may know where I am going wrong with this I would greatly appreciate the help ![]()




