c# - Integer coordinate hash -
i'm working on gradient noise function based on simplex noise in c# uses simple squares instead of triangles (for performance , avoid patent 3d noise).
the original simplex noise algorithm uses small 256 entry look-up table getting gradient each of triangle's corners. when using squares instead of triangles, noise pattern starts repeat coordinates multiples of 256.
to solve problem came following hash function (completely experimental) seems solve repetition problem:
int64 hash = ((2860486313 * (3367900313 * x ^ 4093082899 * y)) >> 32) & 255;
x , y integer parts of noise function's input, , change according typical use cases of gradient noise functions (texture generation, landscape generation, etc).
can tell me if has period close to, or greater 2^32? on surface seems case, have absolutely no clue of how work out whether or not case (other brute-force checking).
Comments
Post a Comment