Start setting things out to implement erosion

First up, we're going to attempt to implement a snowballs-based 
algorithm.
Reference: https://jobtalle.com/simulating_hydraulic_erosion.html
This commit is contained in:
Starbeamrainbowlabs 2020-08-18 02:11:37 +01:00
parent de6ea49d6f
commit 20ccf321ce
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
4 changed files with 13 additions and 1 deletions

View file

@ -23,7 +23,7 @@ dofile(worldeditadditions.modpath.."/lib/walls.lua")
dofile(worldeditadditions.modpath.."/lib/replacemix.lua") dofile(worldeditadditions.modpath.."/lib/replacemix.lua")
dofile(worldeditadditions.modpath.."/lib/maze2d.lua") dofile(worldeditadditions.modpath.."/lib/maze2d.lua")
dofile(worldeditadditions.modpath.."/lib/maze3d.lua") dofile(worldeditadditions.modpath.."/lib/maze3d.lua")
dofile(worldeditadditions.modpath.."/lib/conv/convolution.lua") dofile(worldeditadditions.modpath.."/lib/conv/conv.lua")
dofile(worldeditadditions.modpath.."/lib/count.lua") dofile(worldeditadditions.modpath.."/lib/count.lua")

View file

@ -0,0 +1,3 @@
worldeditadditions.erode = {}
dofile(worldeditadditions.modpath.."/lib/erode/snowballs.lua")

View file

@ -0,0 +1,9 @@
--[[
2D erosion algorithm based on snowballs
Note that this *mutates* the given heightmap.
@source https://jobtalle.com/simulating_hydraulic_erosion.html
]]--
function worldeditadditions.erode.snowballs(heightmap, heightmap_size, erosion_params)
end