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

  1. surface
  2. RCBulb(
  3.     float Ks = 1.0,
  4.       Ka = 0.1,
  5.       Kd = 0.3,
  6.       Ksilh = 0.05,
  7.       roughness = 0.1,
  8.       silhrough = 0.55;
  9.     color specularcolor = 1)
  10.  
  11. {
  12.      point Nf = faceforward(normalize(N), I);
  13.      point V = -normalize(I);
  14.  
  15.      Oi = Os;
  16.      Ci = Oi*Cs*(Ka*ambient() + Kd*diffuse(Nf)) +
  17.       specularcolor*Ks*specular(Nf, V, roughness)
  18.       + specularcolor*Ksilh*(pow(1.0 - (V.Nf),1/silhrough));
  19. }
  20.