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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-05 20:25:42 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-09-05 20:25:42 +0400
commit419042af55ddb789f29771886e0bb090ad757cad (patch)
tree2e19ff5b89c474b73a1acdbc77114c88368af943 /source/blender/blenlib
parent59dbd53e72ae25edf247e49ea1e291af277fecc4 (diff)
Fix #28394: clouds texture error with high noise depth and blender original
noise, patch from Campbell,
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/noise.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index 9bc666dc971..9efe8dc9739 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -263,13 +263,21 @@ static float newPerlinU(float x, float y, float z)
static float orgBlenderNoise(float x, float y, float z)
{
register float cn1, cn2, cn3, cn4, cn5, cn6, i, *h;
- float ox, oy, oz, jx, jy, jz;
+ float fx, fy, fz, ox, oy, oz, jx, jy, jz;
float n= 0.5;
int ix, iy, iz, b00, b01, b10, b11, b20, b21;
- ox= (x- (ix= (int)floor(x)) );
- oy= (y- (iy= (int)floor(y)) );
- oz= (z- (iz= (int)floor(z)) );
+ fx= floor(x);
+ fy= floor(y);
+ fz= floor(z);
+
+ ox= x- fx;
+ oy= y- fy;
+ oz= z- fz;
+
+ ix= (int)fx;
+ iy= (int)fy;
+ iz= (int)fz;
jx= ox-1;
jy= oy-1;