home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 August / chip_08_2000.iso / aktualnosci / shareware / Rhinoceros / rh11eval_20000320.exe / %MAINDIR% / RIB / rh_emboss.sl < prev    next >
Encoding:
Text File  |  2000-06-08  |  642 b   |  22 lines

  1. /* custom bump map shader for Rhino. Comparing to original 
  2.  * emboss.sl only the bump direction is reversed. White areas
  3.  * are the ones that stick out.
  4.  *
  5.  *
  6.  * Original emboss.sl, copyrighted Pixar 1989
  7.  * From the RenderMan Companion p.383
  8.  * Listing 16.36  Displacement shader embossing a surface using a texture
  9.  * emboss(): emboss a pencil with lettering.  It uses the same texture
  10.  *     map as sdixon() to define the lettering.
  11.  */
  12.  
  13. displacement
  14. rh_emboss(    
  15.     float    Km        = .05;
  16.     string    texturename    = "")
  17. {
  18.     if( texturename != "") {
  19.         P += Km * texture(texturename, s, t) * normalize(N);
  20.         N = calculatenormal(P);
  21.     }
  22. }