/**************************************************************************** * based on woodblockprint (info below), but modified to show * different features * ************************************************ * * The original shader was: * * woodblockprint.sl -- surface shader for carved wood block printing * * (c) Copyright 1998 by Fleeting Image Animation, Inc. * All rights reserved. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and for any purpose, provided that the above copyright * notice appear in all copies of this software. * * Author: Scott F. Johnston * * Reference: * _Advanced RenderMan: Creating CGI for Motion Picture_, * by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999. * ****************************************************************************/ surface woodblockprint ( float freq = 2; float duty = 0.50; color stripe_color = 0;) { float sawtooth = mod(u * freq, 1); float triangle = abs(2.0 * sawtooth - 1.0); float square = filterstep(duty, triangle); Ci = mix(Cs, stripe_color, square); }