21.5 C
New York
Tuesday, August 26, 2025

c++ – Hashing gradient vector and unshuffled permutation desk in perlin noise generator


I am implementing perlin noise in C++. I’ve a permutation desk for the gradients vectors and need to shuffle them with a 2 quantity hash that has 2 functions. The hash makes use of the integer portion of the present X and Z place of the float or double with 1 hash technique (probably Szudzik hashing) and one other hash to generate a quantity used to pick which component of a unshuffled permutation desk to pick (probably utilizing modulus of a division for any level not equal to zero) however I am in search of higher strategies. One of the best reply could be to search out what hashing features work with negatives and have seedable performance of the most important worth storeable in c++, probably lengthy lengthy int or double. I need the seed to be as huge as attainable and work throughout the most limits to make the most important voxel array attainable. The dimensions of the map is essential, it wants distinctive values for terrain technology utilizing a seed and I need to get as near the bounds of the variables attainable. I need to use 2 hashes to probably generate the gradient vector from a seed if attainable(eradicating the permutation desk). And if it could’t be eliminated I need to in some way shuffle by seed with some sort of algorithm that works with the identical seed worth to make the identical heightmap each time the identical seed is used. I simply want the names of higher hashes to make use of, I need a big map and huge seed to generate seed worlds. The world is fabricated from chunks the restrict is what number of chunks I can rely by these variables and limits of hashes.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles