[Bf-blender-cvs] [7e3e624] gooseberry: Tentative fix for flickering particle duplis, when using "pick random" with a dupligroup and distributed rendering.
Lukas Tönne
noreply at git.blender.org
Wed Apr 29 15:21:51 CEST 2015
Commit: 7e3e6242985df6b1f1cba4534ccc4668ef659680
Author: Lukas Tönne
Date: Wed Apr 29 15:16:33 2015 +0200
Branches: gooseberry
https://developer.blender.org/rB7e3e6242985df6b1f1cba4534ccc4668ef659680
Tentative fix for flickering particle duplis, when using "pick random"
with a dupligroup and distributed rendering.
The particle duplis were generated using the global RNG (BLI_rand). This
is unstable once scenes become a bit more complex and objects are
evaluated in multiple threads.
This patch is not in master, because it changes the look of existing
particle setups.
===================================================================
M source/blender/blenkernel/intern/object_dupli.c
===================================================================
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 1574c4a..24a5f7e 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1024,7 +1024,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
/* for groups, pick the object based on settings */
if (part->draw & PART_DRAW_RAND_GR)
- b = BLI_rand() % totgroup;
+ b = (int)(psys_frand(psys, (unsigned int)(a + 974)) * (float)totgroup) % totgroup;
else
b = a % totgroup;
More information about the Bf-blender-cvs
mailing list