/*Wooksang's irregular shader for Digital lighting*/ #include "rmannotes.sl" surface irregular(float fuzz=0.5, freq=30 ; float Ks = 1, Kd=1, Ka = 0.1,roughness=0.1,Km=0.1; color first = color(1,1,1); color second = color(0,0,0); color specularcolor = 1; varying point Pr = 0;) { /*basic setting*/ color surface_color, layer_color; float surface_opac, layer_opac; float f; vector V; normal Nf; point PP; Nf=faceforward(normalize(N),I); V=-normalize(I); /* background layer (layer 0) */ /* surface_color = color(1,0,0); */ float tt = repeat(t,10); surface_color = texture("pipe_color.tx",s,tt)+ color(0.2,0,0); surface_opac = 1; /* layer #1 */ PP = transform("shader", P); layer_color = first; layer_opac = 0; for (f=1;f