/* Shader description goes here */ surface maya_pattern(float Kfb = 1, inv_circle_size = .03, black_circle_size = .01, repeats = 7, left_right = .5, up_down = .5; color stripe = color(0,0,1), background_color = color(1,0,0), dot = color(0,0,0)) { color surfcolor = .4; normal n = normalize(N); normal nf = faceforward(n, I); /* STEP 1 - set the apparent surface opacity */ Oi = Os; // Do the lighting (copy is in dropbox). Diff can be called whatever. color diff = diffuse(nf); /* Diagonal patterns */ float j; float swap = 0; float decr = 1.0/repeats; for(j = 1; j >= 0; j = j - decr) { if ( s + j >= 1 - t) { if(swap == 0) { surfcolor = stripe; swap = 1; } else { surfcolor = background_color; swap = 0; } } if ( s - j >= 1 - t) { if(swap == 0) { surfcolor = background_color; swap = 1; } else { surfcolor = stripe; swap = 0; } } } /* First circle set */ if(((s-left_right)*(s-left_right))+((t-up_down)*(t-up_down))