mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Merge pull request #923 from Neveix/fix-demo-generator-rivers
fix rivers in base:demo
This commit is contained in:
commit
afc7cb6ef8
1 changed files with 21 additions and 6 deletions
|
|
@ -86,12 +86,27 @@ function generate_heightmap(x, y, w, h, s, inputs)
|
||||||
|
|
||||||
local rivermap = Heightmap(w, h)
|
local rivermap = Heightmap(w, h)
|
||||||
rivermap.noiseSeed = SEED
|
rivermap.noiseSeed = SEED
|
||||||
rivermap:noise({x+21, y+12}, 0.1*s, 4)
|
rivermap:noise({ x + 21, y + 12 }, 0.1 * s, 4)
|
||||||
rivermap:abs()
|
rivermap:pow(4)
|
||||||
rivermap:mul(2.0)
|
rivermap:mul(3500)
|
||||||
rivermap:pow(0.15)
|
rivermap:add(1)
|
||||||
rivermap:max(0.5)
|
rivermap:pow(-1)
|
||||||
map:mul(rivermap)
|
rivermap:mul(-1)
|
||||||
|
rivermap:add(1)
|
||||||
|
|
||||||
|
local rivermap_bottom = Heightmap(w, h)
|
||||||
|
rivermap_bottom:add(0.23)
|
||||||
|
rivermap_bottom:noise({ x, y }, 2 * s, 4, 0.005)
|
||||||
|
|
||||||
|
map:sub(rivermap_bottom)
|
||||||
|
|
||||||
|
local map_multiplied = Heightmap(w, h)
|
||||||
|
map_multiplied:add(map)
|
||||||
|
map_multiplied:mul(rivermap)
|
||||||
|
|
||||||
|
map:min(map_multiplied)
|
||||||
|
|
||||||
|
map:add(rivermap_bottom)
|
||||||
|
|
||||||
local desertmap = Heightmap(w, h)
|
local desertmap = Heightmap(w, h)
|
||||||
desertmap.noiseSeed = SEED
|
desertmap.noiseSeed = SEED
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue