/* surface shader: oilstain creator: Nick Meshes, DePaul University description: based on metallic should produce brighter greener colors parameters: none */ #define GREEN color (0,0,0.5) #define BLUE0 color (0,0.1,0.4) #define BLUE1 color (0,0.2,0.3) #define BLUE2 color (0,0.25,0.25) #define BLUE3 color (0,0.3,0.2) #define BLUE4 color (0,0.35,0.15) #define BLUE5 color (0,0.4,0.1) #define BLUE6 color (0,0.5,0) surface oilstain(){ point Nf = normalize(faceforward(N,I)); point nI = normalize(-I); point R; point Rworld; color Ct = color (1,1,1); float whichone; R = 2 * Nf * (Nf . nI) - nI; Rworld = normalize(ntransform("world", R)); whichone = 0.5 * zcomp(Rworld) + 0.5; Ct = spline(whichone, BLUE6, BLUE6, BLUE6, BLUE6, BLUE6, BLUE6, BLUE5, BLUE4, BLUE3, BLUE2, BLUE1, BLUE0, GREEN ); Oi = Os; Ci = Os * Cs * Ct; }