noiseHash3 function Noise

int noiseHash3(
  1. int seed,
  2. int x,
  3. int y,
  4. int z,
)

Bit-exact hashed value for the integer lattice cell (x, y, z).

The 3D counterpart of noiseHash2, matching the GLSL NoiseHash3(ivec3(x, y, z), seed) exactly.

Implementation

int noiseHash3(int seed, int x, int y, int z) => _hash3(
  _i32(seed),
  _i32(_i32(x) * _primeX),
  _i32(_i32(y) * _primeY),
  _i32(_i32(z) * _primeZ),
);