diff options
-rw-r--r-- | intern/cycles/kernel/shaders/node_brick_texture.osl | 1 | ||||
-rw-r--r-- | intern/cycles/kernel/svm/svm_brick.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/intern/cycles/kernel/shaders/node_brick_texture.osl b/intern/cycles/kernel/shaders/node_brick_texture.osl index e26e8dbff2c..35e01178ba8 100644 --- a/intern/cycles/kernel/shaders/node_brick_texture.osl +++ b/intern/cycles/kernel/shaders/node_brick_texture.osl @@ -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); diff --git a/intern/cycles/kernel/svm/svm_brick.h b/intern/cycles/kernel/svm/svm_brick.h index fcf8f47b77e..9b0cf5ab8c4 100644 --- a/intern/cycles/kernel/svm/svm_brick.h +++ b/intern/cycles/kernel/svm/svm_brick.h @@ -21,6 +21,7 @@ CCL_NAMESPACE_BEGIN ccl_device_noinline float brick_noise(int n) /* fast integer noise */ { int nn; + n = (n + 1013) & 0x7fffffff; n = (n >> 13) ^ n; nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 0x7fffffff; return 0.5f * ((float)nn / 1073741824.0f); |