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_outline.sl < prev    next >
Encoding:
Text File  |  2008-01-23  |  283 b   |  16 lines

  1. /* IDoutline written by Ivan DeWolf
  2.  * it's the valdez algorithm. short and sweet.
  3.  * width sets the line width.
  4.  */
  5. surface
  6. k3d_outline(float width = .05)
  7. {
  8.  
  9.   normal Nn = normalize (-N);
  10.   float dot = Nn . normalize(I);
  11.  
  12.   P += Nn*width;
  13.   Ci = 0;
  14.   Oi = smoothstep(-.01,0,dot);
  15. }
  16.