diff options
author | Ton Roosendaal <ton@blender.org> | 2006-11-21 18:52:45 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-11-21 18:52:45 +0300 |
commit | 20e6dc7f57fabe5076ba67b2ca5ab94a9ab5772c (patch) | |
tree | d71272c7057011700c777973504f5f224516cb47 /source/blender/blenlib | |
parent | 9f9d99ef8d875a408f763f569fef3bb2dd445ef0 (diff) |
Bugfix, own collection:
Random seeding is still not perfect in render, especially lack of good
thread support still.
- VectorBlur node was calling seed for each exec, causing other nodes to
get fixed random too.
- added seed in non-OSA main loop for render
- use BLI_srandom, is better than BLI_srand
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/rand.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c index e80ab07f8a9..bf700f8c62c 100644 --- a/source/blender/blenlib/intern/rand.c +++ b/source/blender/blenlib/intern/rand.c @@ -171,6 +171,9 @@ void BLI_thread_srandom(int thread, unsigned int seed) { extern unsigned char hash[]; // noise.c + if(thread >= MAX_RNG_THREADS) + thread= 0; + rng_seed(&rng_tab[thread], seed + hash[seed & 255]); seed= rng_getInt(&rng_tab[thread]); rng_seed(&rng_tab[thread], seed + hash[seed & 255]); |