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_roughmetal.sl < prev    next >
Encoding:
Text File  |  2008-01-23  |  604 b   |  26 lines

  1. /*
  2.  * roughmetal.sl
  3.  *
  4.  * Description:
  5.  *   Rough metal without coherent reflections
  6.  *
  7.  * Parameters:
  8.  *   Ka, Kd, Ks - ambient, diffuse, specular weights
  9.  *   roughness - highlight width
  10.  * 
  11.  * The RenderMan (R) Interface Procedures and RIB Protocol are:
  12.  *     Copyright 1988, 1989, Pixar.  All rights reserved.
  13.  * RenderMan (R) is a registered trademark of Pixar.
  14.  */
  15.  
  16. #include "k3d_material.h"
  17.  
  18.  
  19. surface k3d_roughmetal(float Ka = 1, Kd = 0.1, Ks = .9, roughness = 0.4;)
  20. {
  21.   normal Nf = faceforward(normalize(N), I);
  22.   Ci = MaterialRoughMetal(Nf, Cs, Ka, Kd, Ks, roughness);
  23.   Oi = Os;
  24.   Ci *= Oi;
  25. }
  26.