surface first( float Prob = 0.4, // probability of seeing orange Ks = 0.5, // specular coefficient Kd = 0.5, // diffuse coefficient Ka = .1, // ambient coefficient roughness = 0.1; // specular roughness color SpecularColor = color( 1, 1, 1 ) // specular color ) { color stripeColor; // what color to actually paint here varying vector Nf = faceforward( normalize( N ), I ); vector V = normalize( -I ); color TheColor = Cs; // #define NOT_YET_1 #ifdef NOT_YET_1 float x = xcomp(P); float xfrac = mod( x, 1. ); if( xfrac < Prob ) TheColor = color( 1., .5, 0. ); #endif #ifdef NOT_YET_2 float up = 2. * u; float vp = v; float WIDTH = 0.05; float numinu = floor( up / WIDTH ); float numinv = floor( vp / WIDTH ); if( mod( numinu+numinv, 2. ) == 0 ) TheColor = color( 1., .5, 0. ); #endif Oi = Os; // use whatever the rib file gave us Ci = TheColor * Ka * ambient(); Ci = Ci + TheColor * Kd * diffuse(Nf); Ci = Ci + SpecularColor * Ks * specular( Nf, V, roughness ); }