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

  1. /* Copyrighted Pixar 1989 */
  2. /* From the RenderMan Companion p.383 */
  3. /* Listing 16.36  Displacement shader embossing a surface using a texture */
  4.  
  5. /*
  6.  * emboss(): emboss a pencil with lettering.  It uses the same texture
  7.  *     map as sdixon() to define the lettering.
  8.  */
  9. displacement
  10. k3d_emboss(    
  11.     float    Km        = .05;
  12.     string    texturename    = "")
  13. {
  14.     if( texturename != "") {
  15.         P -= Km * texture(texturename, s, t) * normalize(N);
  16.         N = calculatenormal(P);
  17.     }
  18. }
  19.