Random number generator: replace a bunch of usage of the global random number
generator with a local one. It's not thread safe and will not give repeatable results, so in most cases it should not be used. Also fixes #34992 where the noise texture of a displacement modifier was not properly random in opengl animation render, because the seed got reset to a fixed value by an unrelated function while for final render it changed each frame.
This commit is contained in:
@@ -313,8 +313,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
||||
{
|
||||
float ran = 0.0f;
|
||||
if (pimd->random_position != 0.0f) {
|
||||
BLI_srandom(psys->seed + p);
|
||||
ran = pimd->random_position * BLI_frand();
|
||||
ran = pimd->random_position * BLI_hash_frand(psys->seed + p);
|
||||
}
|
||||
|
||||
if (pimd->flag & eParticleInstanceFlag_KeepShape) {
|
||||
|
||||
Reference in New Issue
Block a user