Closed rehwinkel closed 4 years ago
While I agree with the intent to generate a seed from string using a hashing function, I believe MD5 is entirely overkill for this purpose since the generated hash does not need to be secure in the cryptographic sense of the word. I suggest to keep the PRs intent, but swap out MD5 for std::hash, which should also provide a small performance benefit on the side.
@b0guslaw good suggestion! MD5 was the first thing that came to my mind, so I used that, but std::hash seems so much more convenient!
Apparently using the seed from std::hash generates the same terrain as using md5.
The seed is used as an offset for x and y axis and also used as the 3rd parameter to the simplex noise. Also, the seed is an given as an integer, which is then reinterpreted as a float before being used. This integer can be generated from a string using md5 hash. The default seed has been set to "test"