feat: heightmap-inputs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[forest]
|
||||
parameters = [
|
||||
{weight=1, value=1},
|
||||
{weight=1, value=0},
|
||||
{weight=0.5, value=0.2}
|
||||
]
|
||||
layers = [
|
||||
@@ -28,8 +28,8 @@ structures = [
|
||||
|
||||
[desert]
|
||||
parameters = [
|
||||
{weight=0.3, value=0},
|
||||
{weight=0.1, value=0}
|
||||
{weight=1.0, value=1},
|
||||
{weight=0.5, value=0}
|
||||
]
|
||||
layers = [
|
||||
{height=6, block="base:sand"},
|
||||
@@ -43,8 +43,8 @@ sea-layers = [
|
||||
|
||||
[plains]
|
||||
parameters = [
|
||||
{weight=0.6, value=0.5},
|
||||
{weight=0.6, value=0.5}
|
||||
{weight=0.8, value=0.5},
|
||||
{weight=0.8, value=0.0}
|
||||
]
|
||||
layers = [
|
||||
{below-sea-level=false, height=1, block="base:grass_block"},
|
||||
|
||||
@@ -43,7 +43,7 @@ function place_structures_wide(x, z, w, d, seed, chunk_height)
|
||||
return placements
|
||||
end
|
||||
|
||||
function generate_heightmap(x, y, w, h, seed, s)
|
||||
function generate_heightmap(x, y, w, h, seed, s, inputs)
|
||||
local umap = Heightmap(w, h)
|
||||
local vmap = Heightmap(w, h)
|
||||
umap.noiseSeed = seed
|
||||
@@ -65,6 +65,12 @@ function generate_heightmap(x, y, w, h, seed, s)
|
||||
rivermap:pow(0.15)
|
||||
rivermap:max(0.5)
|
||||
map:mul(rivermap)
|
||||
|
||||
local desertmap = Heightmap(w, h)
|
||||
desertmap.noiseSeed = seed
|
||||
desertmap:cellnoise({x+52, y+326}, 0.3*s, 2, 0.2)
|
||||
desertmap:add(0.4)
|
||||
map:mixin(desertmap, inputs[1])
|
||||
return map
|
||||
end
|
||||
|
||||
@@ -72,6 +78,8 @@ function generate_biome_parameters(x, y, w, h, seed, s)
|
||||
local tempmap = Heightmap(w, h)
|
||||
tempmap.noiseSeed = seed + 5324
|
||||
tempmap:noise({x, y}, 0.04*s, 6)
|
||||
tempmap:mul(0.5)
|
||||
tempmap:add(0.5)
|
||||
local hummap = Heightmap(w, h)
|
||||
hummap.noiseSeed = seed + 953
|
||||
hummap:noise({x, y}, 0.04*s, 6)
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# 2 - humidity
|
||||
biome-parameters = 2
|
||||
sea-level = 64
|
||||
heightmap-inputs = [1]
|
||||
|
||||
Reference in New Issue
Block a user