Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions noise.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void xPerlinInit(PerlinNoise *noise, Xoroshiro *xr)
}

double samplePerlin(const PerlinNoise *noise, double d1, double d2, double d3,
double yamp, double ymin)
double yamp, double ymax)
{
uint8_t h1, h2, h3;
double t1, t2, t3;
Expand Down Expand Up @@ -143,7 +143,7 @@ double samplePerlin(const PerlinNoise *noise, double d1, double d2, double d3,

if (yamp)
{
double yclamp = ymin < d2 ? ymin : d2;
double yclamp = ymax >= 0.0 && ymax < d2 ? ymax : d2;
d2 -= floor(yclamp / yamp) * yamp;
}

Expand Down
2 changes: 1 addition & 1 deletion noise.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void perlinInit(PerlinNoise *noise, uint64_t *seed);
void xPerlinInit(PerlinNoise *noise, Xoroshiro *xr);

double samplePerlin(const PerlinNoise *noise, double x, double y, double z,
double yamp, double ymin);
double yamp, double ymax);
double sampleSimplex2D(const PerlinNoise *noise, double x, double y);

/// Perlin Octaves
Expand Down