ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/noise3.c
(Generate patch)

Comparing ray/src/rt/noise3.c (file contents):
Revision 2.13 by greg, Tue Oct 8 18:59:44 2013 UTC vs.
Revision 2.14 by greg, Wed Nov 21 20:23:15 2018 UTC

# Line 166 | Line 166 | noise3(                        /* compute the revised Perlin noise function
166          static double  x[3];
167          static double  f[4];
168  
169 <        if (gotV && x[0]==xnew[0] && (x[1]==xnew[1]) & (x[2]==xnew[2])) {
170 <                if (!(gotV>>i & 1)) {
171 <                        f[i] = noise3partial(f[3], x, i);
172 <                        gotV |= 1<<i;
173 <                }
174 <                return(f[i]);
169 >        if (!gotV || xnew[0] != x[0] || (xnew[1] != x[1]) | (xnew[2] != x[2])) {
170 >                f[3] = perlin_noise(x[0]=xnew[0], x[1]=xnew[1], x[2]=xnew[2]);
171 >                gotV = 0x8;
172          }
173 <        gotV = 0x8;
174 <        return(f[3] = perlin_noise(x[0]=xnew[0], x[1]=xnew[1], x[2]=xnew[2]));
173 >        if (!(gotV>>i & 1)) {
174 >                f[i] = noise3partial(f[3], x, i);
175 >                gotV |= 1<<i;
176 >        }
177 >        return(f[i]);
178   }
179  
180   static double

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines