Experiment with biomes

This commit is contained in:
Tim
2023-06-05 02:54:54 +02:00
parent cccd74f1a5
commit 007a9f7989
5 changed files with 65 additions and 24 deletions

View File

@ -148,7 +148,7 @@ class PerlinNoise
return $value;
}
function random2D(float $x, float $y, ?int $size = NULL): float
function random2D(float $x, float $y, ?int $size = null, float $multiplier = 1.0): float
{
if ($size === NULL) {
$size = $this->_default_size;
@ -167,7 +167,7 @@ class PerlinNoise
// $value /= 2.0;
return $this->sigmoid($value);
return $this->sigmoid($value * $multiplier);
}
private function sigmoid(float $t): float