Closed fenjalien closed 3 years ago
Perlin noise produces zero values when sampled along lattice coordinates, i.e. at integer values for x
or y
. To resolve this, you could add an offset to the sampled coordinates, something like:
perlin.get([x as f64 + 0.5, y as f64 + 0.5]);
I'll have to add a note stating this zero result at lattice coordinates for the future.
The following code for me prints 0 for each value
The active toolchain is
stable-x86_64-unknown-linux-gnu
withrustc
at version1.52.1
Other generators likeValue
andOpenSimplex
don't have this behaviour. Changing the seed and version ofnoise-rs
doesn't help.