mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add heightmap write-only property 'noiseSeed'
This commit is contained in:
parent
510c45ffe9
commit
e560236a8c
7 changed files with 56 additions and 13 deletions
|
|
@ -7,15 +7,18 @@ layers = {
|
|||
{block="base:bazalt", height=1},
|
||||
}
|
||||
|
||||
function generate_heightmap(x, y, w, h)
|
||||
function generate_heightmap(x, y, w, h, seed)
|
||||
local umap = Heightmap(w, h)
|
||||
local vmap = Heightmap(w, h)
|
||||
umap.noiseSeed = seed
|
||||
vmap.noiseSeed = seed
|
||||
umap:noise({x+521, y+73}, 0.05, 1, 20.8)
|
||||
umap:noise({x+51, y+75}, 0.05, 1, 21.8)
|
||||
vmap:noise({x+521, y+70}, 0.1, 3, 35.8)
|
||||
vmap:noise({x+95, y+246}, 0.15, 3, 35.8)
|
||||
|
||||
local map = Heightmap(w, h)
|
||||
map.noiseSeed = seed
|
||||
map:noise({x, y}, 0.02, 7, 0.2)
|
||||
map:noise({x, y}, 0.06, 8, 0.4, umap, vmap)
|
||||
map:mul(0.5)
|
||||
|
|
@ -23,6 +26,7 @@ function generate_heightmap(x, y, w, h)
|
|||
map:pow(2.0)
|
||||
|
||||
local rivermap = Heightmap(w, h)
|
||||
rivermap.noiseSeed = seed
|
||||
rivermap:noise({x+21, y+12}, 0.1, 4)
|
||||
rivermap:abs()
|
||||
rivermap:mul(2.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue