Particle: Use local RNG during initialization

This commit is contained in:
2018-06-12 15:23:38 +02:00
parent 46cb64917d
commit 53a9cde038

View File

@@ -100,13 +100,13 @@ float PSYS_FRAND_BASE[PSYS_FRAND_COUNT];
void psys_init_rng(void)
{
int i;
BLI_srandom(5831); /* arbitrary */
for (i = 0; i < PSYS_FRAND_COUNT; ++i) {
PSYS_FRAND_BASE[i] = BLI_frand();
PSYS_FRAND_SEED_OFFSET[i] = (unsigned int)BLI_rand();
PSYS_FRAND_SEED_MULTIPLIER[i] = (unsigned int)BLI_rand();
RNG *rng = BLI_rng_new_srandom(5831); /* arbitrary */
for (int i = 0; i < PSYS_FRAND_COUNT; ++i) {
PSYS_FRAND_BASE[i] = BLI_rng_get_float(rng);
PSYS_FRAND_SEED_OFFSET[i] = (unsigned int)BLI_rng_get_int(rng);
PSYS_FRAND_SEED_MULTIPLIER[i] = (unsigned int)BLI_rng_get_int(rng);
}
BLI_rng_free(rng);
}
static void get_child_modifier_parameters(ParticleSettings *part, ParticleThreadContext *ctx,