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.
This commit is contained in:
2018-02-14 14:32:38 +01:00
parent c8e661706f
commit f6107af4cf
18 changed files with 54 additions and 56 deletions

View File

@@ -63,4 +63,9 @@ BLI_INLINE unsigned int BLI_hash_int(unsigned int k)
return BLI_hash_int_2d(k, 0);
}
BLI_INLINE float BLI_hash_int_01(unsigned int k)
{
return (float)BLI_hash_int(k) * (1.0f/(float)0xFFFFFFFF);
}
#endif // __BLI_HASH_H__