home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 August / chip_08_2000.iso / aktualnosci / shareware / Rhinoceros / rh11eval_20000320.exe / %MAINDIR% / RIB / rayserver.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-08  |  1.4 KB  |  47 lines

  1. /* rayserver.h - Shading Language (PRMan side) include file for ray server.
  2.  * 
  3.  * These macros translate calls to trace(), visibility(), and
  4.  * rayhittest() into calls to rayserver().  Each generates different
  5.  * numbers of args, allowing rayserver() to be polymorphic.
  6.  *
  7.  * It is assumed that the rayserver() function itself is implemented
  8.  * as a DSO shadeop.  (See docs for PRMan 3.8 or later.)
  9.  *
  10.  * Note that the ray server expects its data in world space.
  11.  *
  12.  * Author: Larry Gritz (gritzl@acm.org)
  13.  *
  14.  * Reference:  
  15.  *   Gritz, Larry, "Ray Tracing in PRMan (with a little help from
  16.  *   BMRT)".  Appeared in: Apodaca and Gritz, eds., "Advanced
  17.  *   RenderMan: Beyond the Companion", SIGGRAPH '98 course notes
  18.  *   (Course #11), July 20, 1998.
  19.  */
  20.  
  21. #ifndef RAYSERVER_H
  22. #define RAYSERVER_H
  23.  
  24. #ifndef BMRT
  25.  
  26. /* PRMan side only -- BMRT already knows these functions */
  27.  
  28. #define worldp(p) transform("world",p)
  29. #define worldv(v) vtransform("world",v)
  30.  
  31. #define trace(p,d) rayserver(worldp(p), worldv(d))
  32.  
  33. #define visibility(from,to) rayserver(worldp(from), worldp(to))
  34.  
  35. #define rayhittest(p,d,phit,nhit) \
  36.         rayserver(worldp(p), worldv(d), phit,nhit)
  37.  
  38. #define fulltrace(p,d,chit,hitdist,phit,nhit,pmiss,rmiss) \
  39.         rayserver(worldp(p),worldv(d), chit,hitdist,phit,nhit,pmiss,rmiss)
  40.  
  41. float raylevel () { return 0; }
  42. float isshadowray () { return 0; }
  43.  
  44. #endif
  45.  
  46. #endif
  47.