When generating math with math.noise() and using Perlin you will typically set it up as so
local ResX,ResY = 15,15
for x = -ResX,ResX do
for y = -ResY,ResY do
-- Store if your data as necessary i.e table[x] = {} table[x][y] = {}
local Height = math.noise(
x / ResX,
y / ResY
)
end
end
And with this you have some pretty basic noise, But as you’ve said we need to make it smoother! And there we introduce our frequency value, the frequency is how much the noise differs as its generated or as youve said “how smooth it is” heres how we would set that up
local ResX,ResY,Frequency = 15,15,5
for x = -ResX,ResX do
for y = -ResY,ResY do
-- Store if your data as necessary i.e table[x] = {} table[x][y] = {}
local Height = math.noise(
x / ResX * Frequency, -- The (x/y) / resolution will still work as asked
y / ResY * Frequency -- however, we now introduce our frequency value
-- this value is how we will shift around our noise to be used as wanted!
)
end
end
To make it low poly, I would create a map of triangles (e.g. just a standard triangle tessellation), sample the noise at the points of the triangles, then create 3D triangles between the sampled heights.
E.g. sample in this pattern:
Then make a 3D triangle between the points of the form (patternX, noiseSampleHeight, patternZ).
For smoother noise, you can make the noise map wider.
For more realistic/varied terrain, try a combination of big noise maps that are smooth along with smaller noise maps.
For noise like in the first reply, take a regular noise map, then multiple it by a “mountain” noise map. You can make the mountain noise map by doing:
-- An example of a map that would work:
local regularNoise = sampleNoise() -- Make this a very big noise map, that varies slowly
-- Make the noise [0-1]
mountainNoise = (regularNoise/2 + 0.5)
if mountainNoise > 0.5 then
mountainNoise *= mountainNoise -- Make high parts of the map extra high
else
For more help, what do you mean by smoother? Low poly and smooth seem kind of contradictory.
Oh yeah I tought it would make more sense if I say smoother and lowpolly at the same time. Ok so Im looking to make lowpolly generation. OK now let me get to the point:
(patternX, noiseSampleHeight, patternZ) I thought this before but I didnt know how to rotate them and I couldnt explain myself better ? Can you explain a bit more