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

Comparing ray/src/cal/cal/noise2.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 > { 2-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 < rand2a(x,y) = 1-2*rand(.69692*x+.35084*y);
12 < rand2b(x,y) = 1-2*rand(.05393*x+.96196*y);
13 < rand2c(x,y) = 1-2*rand(.04234*x+.46180*y);
11 > rand2a(x,y) : 1-2*rand(.69692*x+.35084*y);
12 > rand2b(x,y) : 1-2*rand(.05393*x+.96196*y);
13 > rand2c(x,y) : 1-2*rand(.04234*x+.46180*y);
14  
15 < noise2(x,y) = noise_2(  floor(x),frac(x),ceil(x),
13 <                                floor(y),frac(y),ceil(y) );
14 <
15 < noise_2(xl,xd,xu,yl,yd,yu) =
15 > noise_2(xl,xd,xu,yl,yd,yu) :
16                          hermite(
17                                  hermite(rand2c(xl,yl),
18                                          rand2c(xu,yl),
# Line 29 | Line 29 | noise_2(xl,xd,xu,yl,yd,yu) =
29                                  (1-xd)*rand2b(xl,yu)+
30                                          xd*rand2b(xu,yu),
31                                  yd);
32 +
33 + noise2(x,y) : noise_2(  floor(x),frac(x),ceil(x),
34 +                                floor(y),frac(y),ceil(y) );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines