Cycles: Fix different noise pattern from fix in T49838:
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 16 Nov 2016 14:12:31 +0000 (15:12 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 16 Nov 2016 14:32:00 +0000 (15:32 +0100)
No need to hash subframe == 0.

intern/cycles/blender/blender_sync.cpp

index 8ec9ecfd8613bb175918bb91d8099a09d1617969..6118cc72239040d3394584842ac9e5f349ded2e8 100644 (file)
@@ -257,9 +257,14 @@ void BlenderSync::sync_integrator()
        integrator->seed = get_int(cscene, "seed");
        if(get_boolean(cscene, "use_animated_seed")) {
                integrator->seed = hash_int_2d(b_scene.frame_current(),
-                                              get_int(cscene, "seed")) +
-                                  hash_int_2d((int)(b_scene.frame_subframe() * (float)INT_MAX),
                                               get_int(cscene, "seed"));
+               if(b_scene.frame_subframe() != 0.0f) {
+                       /* TODO(sergey): Ideally should be some sort of hash_merge,
+                        * but this is good enough for now.
+                        */
+                       integrator->seed += hash_int_2d((int)(b_scene.frame_subframe() * (float)INT_MAX),
+                                                       get_int(cscene, "seed"));
+               }
        }
 
        integrator->sampling_pattern = (SamplingPattern)get_enum(