home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / DemoApps / Graphics / Viewers / raytracers / ohta / README < prev    next >
Encoding:
Text File  |  1991-10-08  |  4.5 KB  |  176 lines

  1. This is a public domain ray tracing program with the following features:
  2.     * shadows
  3.     * specular reflection
  4.     * transparency with refraction
  5.     * antialiasing
  6.     * high speed
  7.  
  8. It computes ray-object intersections very fast by exploiting ray coherence.
  9. For many scenes, the program can compute ray-object intersections
  10. in constant time, regardless of the number of objects.
  11.  
  12. The technique is described in the paper "Ray Coherence Theorem
  13. and Constant Time Ray Tracing Algorithm",
  14. "Computer Graphics 1987, Proceedings of CG International '87"
  15. Springer-Verlag, pp. 303-314.
  16.  
  17. Any suggestions or beautiful pictures generated
  18. using this program are welcome.
  19.  
  20.             Masataka Ohta
  21.  
  22.             Computer Center, Tokyo Institute of Technology,
  23.             2-12-1, O-okayama, Meguro-ku, Tokyo 152, JAPAN
  24.  
  25.             mohta%titcce.cc.titech.junet@relay.cs.net
  26.  
  27. ==========================================================
  28.  
  29. To test the program:
  30.  
  31.     "make test.pic" will produce a beautiful(?) image of nine spheres.
  32.  
  33.     "make test1000.pic" will produce an image of 1,000 spheres.
  34.  
  35.  
  36. Usage: ray [options] <scene file> <picture file>
  37.  
  38. Options:
  39.  
  40.     -a:
  41.         do anti-aliasing
  42.  
  43.     -r res
  44.         set resolution to res (default 128)
  45.  
  46.     -t:
  47.         output timing information
  48.  
  49.     -s:
  50.         use classical slow algorithm
  51.     
  52.     -o:
  53.         disable object ordering optimization
  54.  
  55.     -d:
  56.         debug
  57.  
  58.     -b:
  59.         no shading
  60.  
  61.     
  62. File format: 
  63.     
  64.     scene file: (an ascii file, see test.v or "make test1000.v" for example)
  65.         f <field of view>
  66.         l <x coordinate of the first light source>
  67.           <y coordinate of the first light source>
  68.           <z coordinate of the first light source>
  69.         l <x coordinate of the second light source>
  70.           <y coordinate of the second light source>
  71.           <z coordinate of the second light source>
  72.         .
  73.         .
  74.         .
  75.         o <shape number (integer) of the first object>
  76.           <shade number (integer) of the first object>
  77.           <first shape parameter of the first object>
  78.            .
  79.            .
  80.            .
  81.           <first shade parameter of the first object>
  82.            .
  83.            .
  84.            .
  85.         o <shape number (integer) of the second object>
  86.           <shade number (integer) of the second object>
  87.         .
  88.         .
  89.         .
  90.         e
  91.  
  92.     picture file: (a binary file, make test.pic for an example)
  93.         <long int xres>
  94.         <long int yres>
  95.         <pixel array of yres*xres*3 bytes>
  96.     pixel array has the form:
  97.         struct {unsigned char r, g, b;} array[yres][xres];
  98.     screen space y=0 is at the top
  99.  
  100. Currently supported light source types: (should be programmable)
  101.  
  102.     point light source with constant intensity of (1,1,1)
  103.     regardless to the distance to the light source
  104.  
  105. Currently supported shapes: (may be changed by modifying shape.c)
  106.  
  107.     number:            0
  108.     shape:            sphere
  109.     number of parameters:    4
  110.         first parameter:    x coordinate value of the center
  111.         second parameter:    y coordinate value of the center
  112.         third parameter:    z coordinate value of the center
  113.         forth parameter:    radius
  114.  
  115. Currently supported shades: (may be changed by modifying shade.c)
  116.  
  117.     number:            0
  118.     shade:            lambert with shadows
  119.     number of parameters:    6
  120.         first to third parameters:    RGB value of ambient
  121.         4th to 6th parameters:        RGB value of diffuse
  122.  
  123.     number:            1
  124.     shade:            phong type specular with shadows
  125.     number of parameters:    10
  126.         first to third parameters:    RGB value of ambient
  127.         4th to 6th parameters:        RGB value of diffuse
  128.         7th to 9th parameters:        RGB value of specular
  129.         10th parameter:            specular width factor
  130.  
  131.     number:            2
  132.     shade:            mirror (i.e. reflective ) with phong
  133.                 type specular with shadows
  134.     number of parameters:    13
  135.         first to third parameters:    RGB value of ambient
  136.         4th to 6th parameters:        RGB value of diffuse
  137.         7th to 9th parameters:        RGB value of specular
  138.         10th parameter:            specular width factor
  139.         11th to 13th parameters:    RGB ratio of reflection
  140.  
  141.     number:            3
  142.     shade:            glass (i.e. reflective and refractive)
  143.                 with phong type specular with shadows
  144.     number of parameters:    17
  145.         first to third parameters:    RGB value of ambient
  146.         4th to 6th parameters:        RGB value of diffuse
  147.         7th to 9th parameters:        RGB value of specular
  148.         10th parameter:            specular width factor
  149.         11th to 13th parameters:    RGB ratio of reflection
  150.         14th to 16th parameters:    RGB ratio of refraction
  151.         17th parameter:            refractive index
  152.  
  153. Viewing parameters:
  154.  
  155.     eye:            fixed at (0,0,0)
  156.     eye direction:        fixed to (0,0,1)
  157.     field of view:        variable from 0 to 180 degree (with 'f' option)
  158.  
  159. Resolution:
  160.  
  161.     set with 'r' option, defaults to 128
  162.     picture is always square
  163.  
  164. Limitations:
  165.  
  166.     coordinate transformation should be supported
  167.  
  168.     light source type should be programmable
  169.  
  170.     more complex shapes should be supported
  171.  
  172.     more sophisticated syntax should be used (eg. comments, symbolic names)
  173.  
  174.     dynamic loading of light source, shape and shade functions
  175.     should be possible
  176.