Merge: lib/noise: fix gradient_vector to return a unit vector
authorJean Privat <jean@pryen.org>
Thu, 12 Mar 2015 05:59:10 +0000 (12:59 +0700)
committerJean Privat <jean@pryen.org>
Thu, 12 Mar 2015 05:59:10 +0000 (12:59 +0700)
commitb60d594edc4be417034910889dbe752a29cea970
tree56c17400283318905f4b9ca17c639257270864e0
parent554d6282e727f598563a666d9dcf691e38d0d499
parent9f0a4b447e19b3c495379237369273a6710e0dc0
Merge: lib/noise: fix gradient_vector to return a unit vector

This was an error in the previous implementation. It will now produce noise with a better/greater amplitude so they are... noisier.

The sample result of InterpolatedNoise shows that it now uses the full amplitude, from 0 to f. The sample result of PerlinNoise uses 1 to d, which is a reasonable portion of the full amplitude of 16 considering that it uses only 4 layers and thus the real amplitude is of 15 (8+4+2+1).

Pull-Request: #1200
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>