ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/noise2.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 2 months ago) by greg
Branch: MAIN
CVS Tags: rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# User Rev Content
1 greg 1.1 frac(x)=x-floor(x);
2    
3     hermite(p0,p1,r0,r1,t) = p0 * ((2*t-3)*t*t+1) +
4     p1 * (-2*t+3)*t*t +
5     r0 * (((t-2)*t+1)*t) +
6     r1 * ((t-1)*t*t);
7    
8     rand2a(x,y) = 1-2*rand(.69692*x+.35084*y);
9     rand2b(x,y) = 1-2*rand(.05393*x+.96196*y);
10     rand2c(x,y) = 1-2*rand(.04234*x+.46180*y);
11    
12     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) =
16     hermite(
17     hermite(rand2c(xl,yl),
18     rand2c(xu,yl),
19     rand2a(xl,yl),
20     rand2a(xu,yl),
21     xd),
22     hermite(rand2c(xl,yu),
23     rand2c(xu,yu),
24     rand2a(xl,yu),
25     rand2a(xu,yu),
26     xd),
27     (1-xd)*rand2b(xl,yl)+
28     xd*rand2b(xu,yl),
29     (1-xd)*rand2b(xl,yu)+
30     xd*rand2b(xu,yu),
31     yd);