diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-10-15 13:04:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-15 18:58:15 +0400 |
commit | 3cd2625132f4cdfe62a24721b9cc3931632084e7 (patch) | |
tree | c50441824a6002595feda9d330667f59721ba015 | |
parent | 16f61443bd3a1ac976ed910919f3eb9e3f11968a (diff) |
Better fix for T42139
Noise function's significant bits are up to 31st bit. This should now
give the same visual result as before, minus the stripes.
Issue pointed out by Anthony Edlin, thanks!
Conflicts:
source/blender/render/intern/source/render_texture.c
-rw-r--r-- | source/blender/render/intern/source/render_texture.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index 566668bdda5..53ac3b069eb 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -712,16 +712,16 @@ static float voronoiTex(Tex *tex, const float texvec[3], TexResult *texres) static int texnoise(Tex *tex, TexResult *texres) { float div=3.0; - int val, ran, loop; + int val, ran, loop, shift = 29; ran= BLI_rand(); val= (ran & 3); loop= tex->noisedepth; while (loop--) { - ran= (ran>>2); - val*= (ran & 3); - div*= 3.0f; + shift -= 2; + val *= ((ran >> shift) & 3); + div *= 3.0f; } texres->tin= ((float)val)/div; |