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

  1. /* BMFunkyGlass.sl - Standard plastic surface for randomly colored glass.
  2.  * (c) Copyright 1994, Larry Gritz
  3.  *
  4.  * The RenderMan (R) Interface Procedures and RIB Protocol are:
  5.  *     Copyright 1988, 1989, Pixar.  All rights reserved.
  6.  * RenderMan (R) is a registered trademark of Pixar.
  7.  *
  8.  *   14 Oct 1994 - (wave) changed named to BMFunkyGlass for name space reasons...
  9.  *
  10.  * last modified Oct 14 1994 by Michael B. Johnson (wave@media.mit.edu)
  11.  */
  12.  
  13.  
  14.  
  15. surface
  16. BMFunkyGlass (float Ka = .5;
  17.           float Kd = .5;
  18.           float Ks = 1;
  19.           float roughness = .01;
  20.           color specularcolor = 1;)
  21. {
  22.   point PP, Nf, V;
  23.   color Ct, Ot;
  24.  
  25.   V = normalize(I);
  26.   Nf = faceforward (normalize(N),V);
  27.   PP = transform ("shader", P);
  28.   Ct = color noise (PP);
  29.   Ot = Os;
  30.   Ot -= Ct;
  31.  
  32.   Oi = Ot * (0.75 - 0.5*abs(V.Nf));
  33.   Ci = Oi * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
  34.           specularcolor * Ks*specular(Nf,-V,roughness));
  35. }
  36.  
  37.