fix rivers depth

This commit is contained in:
MihailRis 2024-08-16 01:20:35 +03:00
parent 347a01e0c2
commit 33a73a0014

View File

@ -8,16 +8,17 @@ function generate_heightmap(x, y, w, h)
local map = Heightmap(w, h) local map = Heightmap(w, h)
map:noise({x, y}, 0.02, 7, 0.2) map:noise({x, y}, 0.02, 7, 0.2)
map:noise({x, y}, 0.06, 8, 0.5, umap, vmap) map:noise({x, y}, 0.06, 8, 0.4, umap, vmap)
map:mul(0.5) map:mul(0.5)
map:add(0.3) map:add(0.1)
map:pow(2.0) map:pow(2.0)
local rivermap = Heightmap(w, h) local rivermap = Heightmap(w, h)
rivermap:noise({x+21, y+12}, 0.03, 4) rivermap:noise({x+21, y+12}, 0.1, 4)
rivermap:abs() rivermap:abs()
rivermap:mul(2.0) rivermap:mul(2.0)
rivermap:pow(0.18) rivermap:pow(0.4)
rivermap:max(0.6)
map:add(0.4) map:add(0.4)
map:mul(rivermap) map:mul(rivermap)
map:add(-0.2) map:add(-0.2)