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
committerAntony Riakiotakis <kalast@gmail.com>2014-10-15 13:04:53 +0400
commit6d3757a3ceb188a3fa2c423f50c1bdd670aa538a (patch)
treecb962975bfeaea7e100cd9a9ebe419cf490c8fc0 /source/blender/render
parent4b8430ae8aaab4374310e2f9a91aa253ec2f4ab2 (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!
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/render_texture.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index d9d1acf4efe..1a8ab60d4d0 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -723,7 +723,7 @@ static float voronoiTex(Tex *tex, const float texvec[3], TexResult *texres)
static int texnoise(Tex *tex, TexResult *texres, int thread)
{
float div=3.0;
- int val, ran, loop, shift = 30;
+ int val, ran, loop, shift = 29;
ran= BLI_rng_thread_rand(random_tex_array, thread);
@@ -734,8 +734,8 @@ static int texnoise(Tex *tex, TexResult *texres, int thread)
while (loop--) {
shift -= 2;
- val += ((ran >> shift) & 3);
- div += 3.0f;
+ val *= ((ran >> shift) & 3);
+ div *= 3.0f;
}
texres->tin= ((float)val)/div;