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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-11-26 19:30:02 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-12-01 16:19:15 +0300
commit9d50175b6cc5860926f0974fafd9e8e7868eb805 (patch)
treecad6adc656bb48c9083a0759cde31d585bff348d /intern/cycles/kernel/kernel_jitter.h
parent87cd56b012494e20be06b63f85b798fa043c3194 (diff)
Cycles: Fix correlation issues in certain cases
There were two cases where correlation issues were obvious: - File from T38710 was giving issues in 2.78a again - File from T50116 was having totally different shadow between sample 1 and sample 32. Use some more simplified version of CMJ hash which seems to give nice randomized value which solves the correlation. This commit will break all unit test files, but it's a bug fix so perhaps OK to commit this. This also fixes T41143: Sobol gives nonuniform noise Proper science paper about hash function is coming. Reviewers: brecht Reviewed By: brecht Subscribers: lukasstockner97 Differential Revision: https://developer.blender.org/D2385
Diffstat (limited to 'intern/cycles/kernel/kernel_jitter.h')
-rw-r--r--intern/cycles/kernel/kernel_jitter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/cycles/kernel/kernel_jitter.h b/intern/cycles/kernel/kernel_jitter.h
index aec7bc33acd..67546131746 100644
--- a/intern/cycles/kernel/kernel_jitter.h
+++ b/intern/cycles/kernel/kernel_jitter.h
@@ -149,6 +149,15 @@ ccl_device_inline uint cmj_hash(uint i, uint p)
return i;
}
+ccl_device_inline uint cmj_hash_simple(uint i, uint p)
+{
+ i = (i ^ 61) ^ p;
+ i += i << 3;
+ i ^= i >> 4;
+ i *= 0x27d4eb2d;
+ return i;
+}
+
ccl_device_inline float cmj_randfloat(uint i, uint p)
{
return cmj_hash(i, p) * (1.0f / 4294967808.0f);