Fix T46030: Strange behavior of Cycles Brick Texture

Added some extra seed to the hash, so it's now less likely to give repetitive
patters at values around zero.

This will change distribution of bricks for existing files. but it's something
inevitable.
This commit is contained in:
Sergey Sharybin
2015-09-18 17:28:40 +05:00
parent 910aaa3951
commit de7b7572c2
2 changed files with 2 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
float brick_noise(int n) /* fast integer noise */
{
int nn;
n = (n + 1013) & 2147483647;
n = (n >> 13) ^ n;
nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 2147483647;
return 0.5 * ((float)nn / 1073741824.0);