home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / Shaders / RCShaders / RCPlastic.sl < prev    next >
Encoding:
Text File  |  1995-03-22  |  370 b   |  19 lines

  1. /*
  2.  *  plastic(): give the appearance of a plastic surface
  3.  */
  4. surface 
  5. RCPlastic( 
  6.     float    Ks            = .5, 
  7.         Kd            = .5, 
  8.         Ka            =  1, 
  9.         roughness        = .1; 
  10.     color    specularcolor        =  1 )
  11. {
  12.     point Nf = faceforward(normalize(N), I );
  13.     point V = normalize(-I);
  14.     
  15.     Oi = Os;
  16.     Ci = Os * ( Cs * (Ka*ambient() + Kd*diffuse(Nf)) + 
  17.          specularcolor * Ks * specular(Nf,V,roughness) );
  18. }
  19.