home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 11 / 11.iso / m / m470 / 1.ddi / RMAN / CGTEXMAP.SL < prev    next >
Encoding:
Text File  |  1990-11-12  |  566 b   |  24 lines

  1. /* @(#)cgtexmap.sl    1.1 (Pixar - RenderMan Division) 9/28/89 */
  2. /* Texture Map shader for CrystalGraphics RIB files */
  3.  
  4. surface
  5. cgtexmap( float Ks=.5, Kd=.5, Ka=1, roughness=.1; color specularcolor=1;
  6.      string texturename = ""; )
  7. {
  8.     point Nf, V;
  9.     color Ct;
  10.  
  11.     Nf = faceforward( normalize(N), I );
  12.     V = -normalize(I);
  13.  
  14.     if (texturename != "") {
  15.     Ct = color texture(texturename);
  16.     } else {
  17.     Ct = Cs;
  18.     }
  19.  
  20.     Oi = Os;
  21.     Ci = Os * (Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
  22.          specularcolor * Ks * specular(Nf,V,roughness) );
  23. }
  24.