home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / share / k3d / shaders / surface / k3d_brushedmetal.sl < prev    next >
Encoding:
Text File  |  2008-01-23  |  845 b   |  30 lines

  1. /************************************************************************
  2.  * brushedmetal.sl
  3.  *
  4.  * Description:
  5.  *   Simple anisotropic metal shader.
  6.  * 
  7.  * Parameters:
  8.  *   Ka, Kd, Ks - the usual meaning
  9.  *   uroughness, vroughness - separate roughnesses for u and v directions
  10.  *
  11.  * Author: Larry Gritz (gritzl@acm.org)
  12.  *
  13.  * Reference:
  14.  *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
  15.  *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
  16.  ************************************************************************/
  17.  
  18. #include "k3d_material.h"
  19.  
  20. surface k3d_brushedmetal(float Ka = 1, Kd = 0.1, Ks = .9;
  21.              float uroughness = 0.15, vroughness = 0.5;)
  22. {
  23.   normal Nf = faceforward(normalize(N), I);
  24.   Ci =
  25.     MaterialBrushedMetal(Nf, Cs, Ka, Kd, Ks, normalize(dPdu), uroughness,
  26.              vroughness);
  27.   Oi = Os;
  28.   Ci *= Oi;
  29. }
  30.