Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-09-24 11:54:11 +0300
committerJacques Lucke <jacques@blender.org>2021-09-24 11:55:23 +0300
commitbc27bafa542d5a5f85b45b83676fe1ad21a3f926 (patch)
tree9ee618aedcd50df47d709e48e6b8cea1746f534c /source/blender/blenlib/BLI_noise.hh
parent7ca48a38147fa3b8bf816316df4cc1034b099b19 (diff)
BLI: make noise hash functions available in header
Diffstat (limited to 'source/blender/blenlib/BLI_noise.hh')
-rw-r--r--source/blender/blenlib/BLI_noise.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_noise.hh b/source/blender/blenlib/BLI_noise.hh
index 760ff082d06..b5a06b2b020 100644
--- a/source/blender/blenlib/BLI_noise.hh
+++ b/source/blender/blenlib/BLI_noise.hh
@@ -22,6 +22,13 @@
namespace blender::noise {
+/* Create a randomized hash from the given inputs. Contrary to hash functions in `BLI_hash.hh`
+ * these functions produce better randomness but are more expensive to compute. */
+uint32_t hash(uint32_t kx);
+uint32_t hash(uint32_t kx, uint32_t ky);
+uint32_t hash(uint32_t kx, uint32_t ky, uint32_t kz);
+uint32_t hash(uint32_t kx, uint32_t ky, uint32_t kz, uint32_t kw);
+
/* Perlin noise in the range [-1, 1]. */
float perlin_signed(float position);