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_incandplastic.sl < prev    next >
Encoding:
Text File  |  2008-01-23  |  855 b   |  30 lines

  1. /* incandPlastic.sl   version 1.0, Jan. 2002
  2.  * Felipe Esquivel <felipe@siggraph.org.mx>
  3.  * 
  4.  * Este es un shader plastico con componente de
  5.  * incandescencia como el contenido en un Blinn. 
  6.  *
  7.  * This is a normal plastic shader and includes an
  8.  * incandescence value like the blinn shader.
  9.  */
  10. surface 
  11. k3d_incandplastic(color SurfaceColor = color(0, 0.25, 1);
  12.           color SurfaceOpacity = 1;
  13.           float Ka = 0;
  14.           float Kd = 0.9;
  15.           float Ks = 0.5;
  16.           float Roughness = 0.05;
  17.           color SpecularColor = 1;
  18.           color Incandescence = color(0, 0, 0.3);)
  19. {
  20.   normal Nf;
  21.   vector NI;
  22.   
  23.   Nf = faceforward(normalize(N), I, normalize(N));
  24.   NI = -normalize(I);
  25.   Ci = SurfaceOpacity * (SurfaceColor * (Ka * ambient() + Kd * diffuse(Nf)) +
  26.              SpecularColor * Ks * specular(Nf, NI, Roughness) +
  27.              Incandescence);
  28.   Oi = SurfaceOpacity;
  29. }
  30.