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

Comparing ray/src/cal/cal/noise3.cal (file contents):
Revision 1.1 by greg, Sat Feb 22 02:07:21 2003 UTC vs.
Revision 1.2 by greg, Wed Nov 21 17:45:45 2018 UTC

# Line 1 | Line 1
1 < frac(x)=x-floor(x);
1 > { RCSid $Id$ }
2 > { 3-D Perlin Noise function }
3  
4 < hermite(p0,p1,r0,r1,t) =        p0 * ((2*t-3)*t*t+1) +
4 > frac(x):x-floor(x);
5 >
6 > hermite(p0,p1,r0,r1,t) :        p0 * ((2*t-3)*t*t+1) +
7                                  p1 * (-2*t+3)*t*t +
8                                  r0 * (((t-2)*t+1)*t) +
9                                  r1 * ((t-1)*t*t);
10  
11 < rand3a(x,y,z) = 1-2*rand(.69692*x+.35084*y+.26765*z);
12 < rand3b(x,y,z) = 1-2*rand(.05393*x+.96196*y+.28617*z);
13 < rand3c(x,y,z) = 1-2*rand(.04234*x+.46180*y+.54550*z);
14 < rand3d(x,y,z) = 1-2*rand(.07211*x+.76411*y+.95567*z);
11 > rand3a(x,y,z) : 1-2*rand(.69692*x+.35084*y+.26765*z);
12 > rand3b(x,y,z) : 1-2*rand(.05393*x+.96196*y+.28617*z);
13 > rand3c(x,y,z) : 1-2*rand(.04234*x+.46180*y+.54550*z);
14 > rand3d(x,y,z) : 1-2*rand(.07211*x+.76411*y+.95567*z);
15  
16 < noise3(x,y,z) = noise_3(        floor(x),frac(x),ceil(x),
14 <                                floor(y),frac(y),ceil(y),
15 <                                floor(z),frac(z),ceil(z) );
16 <
17 < noise_3(xl,xd,xu,yl,yd,yu,zl,zd,zu) =
16 > noise_3(xl,xd,xu,yl,yd,yu,zl,zd,zu) :
17                  hermite(
18                          hermite(
19                                  hermite(rand3d(xl,yl,zl),
# Line 57 | Line 56 | noise_3(xl,xd,xu,yl,yd,yu,zl,zd,zu) =
56                                  yd*((1-xd)*rand3c(xl,yu,zu) +
57                                          xd*rand3c(xu,yu,zu)),
58                          zd);
59 +
60 +
61 + noise3(x,y,z) : noise_3(        floor(x),frac(x),ceil(x),
62 +                                floor(y),frac(y),ceil(y),
63 +                                floor(z),frac(z),ceil(z) );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines