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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-14 16:32:38 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-02-14 16:55:46 +0300
commitf6107af4cf4d907495e2e9c18e5866fd1d420650 (patch)
treeebac5a9d08145af572e5400c0697156797b73130 /intern/cycles/util
parentc8e661706fcdd88f1cf371f2e5e4eb76bf09fda3 (diff)
Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range.
These are used for randomization, so it's convenient if the index is already hashed and consistent with the Object Info node.
Diffstat (limited to 'intern/cycles/util')
-rw-r--r--intern/cycles/util/util_hash.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/util/util_hash.h b/intern/cycles/util/util_hash.h
index a30b7fe288e..2307ca158f0 100644
--- a/intern/cycles/util/util_hash.h
+++ b/intern/cycles/util/util_hash.h
@@ -61,6 +61,11 @@ static inline uint hash_string(const char *str)
}
#endif
+ccl_device_inline float hash_int_01(uint k)
+{
+ return (float)hash_int(k) * (1.0f/(float)0xFFFFFFFF);
+}
+
CCL_NAMESPACE_END
#endif /* __UTIL_HASH_H__ */