vendredi 23 septembre 2016

How to Generate Seeded 2D White Noise

I am trying to write a function so that f(x, y, seed) returns some float between 0.0 and 1.0. x and y are two floats, and the seed would be an integer. The result should look like a random number, but using the same arguments will always return the same result. I am planning to use this for terrain generation (using Perlin Noise), but the effect should be that white noise could be created from a given seed (with the x and y arguments corresponding to positions in the image).

I have looked into using hash functions to achieve this, but all of the ones I have come across either don't accept floats, don't produce uniform results (so that each number between 0.0 and 1.0 is equally likely), show an obvious pattern, or the result doesn't change much for close co-ordinates)




Aucun commentaire:

Enregistrer un commentaire