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
This commit is contained in:
Antonis Ryakiotakis 2014-10-15 11:04:41 +02:00 committed by Campbell Barton
parent 16f61443bd
commit 3cd2625132
1 changed files with 4 additions and 4 deletions

View File

@ -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;