#include "rmannotes.sl" surface falls( float Ka = .2, Kd = .2, Ks= 1, roughness = .01,Kr =.8, blur = 0;color specul_col = 1;float samples = 1; color wcolor = color(.1, .2, .8)) { point PP,Nf,V; color Ct,Ot; point IN; point Rdir; point uoffset, voffset; color ev; point R; float i, l, o, f; float octave = 9, lambda = 2, omega = 0.7, a, turb, maxFreq = 6; V = normalize(I); Nf = faceforward(normalize(N),V); IN = normalize (I); ev = 0; PP = transform("shader",P); l=1;o=1; a = 0; for (f = 1; f <= octave; f+=1) { a+= o* ((noise(l*PP)) ) / f ; l*= lambda; o*= omega; } turb = 0; for (f = 1; f < maxFreq; f *= 2) turb += abs(snoise(PP * f)) / f; Ct = wcolor * (color noise (PP)* 2 ) ; Ot = (comp(Ct,1) + comp(Ct,.5) + comp(Ct,0))/6 + (1.5-Ct) ; Oi = Ot * (.8 - 0.15*abs(V.Nf)); Ct = mix (Ct, color(1, 1, 1), turb); Ci = ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) + specul_col * Ks*specular(Nf,-V,roughness) *.2); }