Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-10-15 13:04:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-10-15 18:58:15 +0400
commit3cd2625132f4cdfe62a24721b9cc3931632084e7 (patch)
treec50441824a6002595feda9d330667f59721ba015
parent16f61443bd3a1ac976ed910919f3eb9e3f11968a (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.c8
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;