From 52732d71e72b02ff45e25f44e414f87ec9ab7666 Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 29 Jun 2023 22:15:32 +0200 Subject: Pretty terrain generation --- src/Math/Perlin.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Math/Perlin.hpp') diff --git a/src/Math/Perlin.hpp b/src/Math/Perlin.hpp index c31697b..17d33fd 100644 --- a/src/Math/Perlin.hpp +++ b/src/Math/Perlin.hpp @@ -16,6 +16,7 @@ struct Noise { uint octaves = 3; float persistence = 0.3f; + float lacunarity = 2.0f; float at(Vector pos) const { float result = 0; @@ -27,7 +28,7 @@ struct Noise { result += raw((pos + offset).abs() / scale * frequency) * amplitude; max += amplitude; - frequency *= 2; + frequency *= lacunarity; amplitude *= persistence; } -- cgit 1.4.1