home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / general / raytrace / prt / prt.txt < prev   
Text File  |  1992-12-09  |  6KB  |  168 lines

  1.  
  2.                       prt: A parallel raytracer.
  3.                    Copyright (C) 1990, Kory Hamzeh
  4.  
  5. INTRODUCTION
  6.  
  7. This is relase 1.01 of prt. Since version 1.0, the folling changes
  8. have taken place:
  9.  
  10.     - Output file format  description (that always helpful).
  11.     - A minor bug fix with 'instance' definitions.
  12.     - Made it a bit for portable.
  13.  
  14. Prt is a parallel raytracer I wrote which will run across machines that 
  15. are networked together via TCP/IP. Prt consists of two programs:
  16.  
  17.     - prt: the front end system
  18.     - rt: the raytracing engine.
  19.  
  20. Prt requires the name of the input file, output image file name, and a list
  21. of hosts which will run rt. It then uses rsh to start rt on the given hosts.
  22. Rt reads the input file from its standard in and pipes the image back to
  23. prt on its standard out. Prt also monitors the standard error stream for
  24. error/diagnostics from rt.
  25.  
  26. Using rsh might not be the most efficient way to run parallel processes, but
  27. it's simple and very portable. I've run prt on up to 5 Sun SPARCstations and
  28. have gotten excellent performance. The speed improvement is very close to
  29. linear as the number of hosts increase.
  30.  
  31. In this archive set, there is a file named FORMAT which contains the prt
  32. input database format. Please read it.
  33.  
  34. I have also included two example input files: example1.dat and example2.dat.
  35. I have many more available. Contact me if you are interested.
  36.  
  37. The output file of prt is a simple flat file. It consists of a first line
  38. with a C scanf format of "%d %d\n". These two numbers are the X and Y 
  39. resolution of this image. The rest of the file is x*y pixels. Each pixel
  40. consist of 3 bytes; one for red, one for green, and one for blue.
  41.  
  42. I chose this output format because it is the same format that is used by 
  43. the MTV raytracer.
  44.  
  45.  
  46. BUILDING PRT
  47.  
  48. To build prt, make sure you have unshared all of the shar files. Look
  49. through the Makefile to see if every looks good. On some BSD systems,
  50. you might have to add -DBSD in CFLAGS (if you get complaint from
  51. cc that malloc.h was not found, then define BSD).
  52.  
  53. Next, type:
  54.  
  55.     make prt
  56.  
  57. It should require very little or no change on most BSD systems. Prt uses
  58. the select system call, so make sure your system supports it (all BSD and
  59. most System V systems now have a select system call).
  60.  
  61. Next, you need to build rt on all of the hosts which you plan to use. Copy
  62. the files on all of the hosts you want to use, and type:
  63.  
  64.     make rt
  65.  
  66. I have also written a program called nffconv which converts input
  67. databases in NFF format to a prt format. To build nffconv, type:
  68.  
  69.     make nffconv
  70.  
  71. The SURFACE primitive in prt is much more robust than that of NFF ray-
  72. tracers. You might have to tweak the outfile of nffconv to get a pretty
  73. picture.
  74.  
  75.  
  76. RUNNING PRT
  77.  
  78. Before you run prt, make sure that:
  79.  
  80.     1. You have built rt on all of the target hosts.
  81.     2. You have an account on all of the target hosts and can run rsh.
  82.     3. Rsh does not produce any more output other than the output
  83.        of the program. Type:
  84.  
  85.         rsh <hostname> rt
  86.  
  87.        then type a Control-D character. All you should see is:
  88.  
  89.         rt: no light sources were specified.
  90.  
  91.        If you see any other output (including a request for password
  92.        prompt), then you need to correct it. 
  93.  
  94. Prt has the following usage format:
  95.  
  96.     prt [-v] [-s] [-l] [-r] [-c sample_count] input-file
  97.         output-file host [host ... ]
  98.  
  99. The options are:
  100.  
  101.     -v    Verbose mode. Good for debugging and impatient people.
  102.  
  103.     -s    Don't trace shadow rays. For testing an object database.
  104.  
  105.     -l    Don't trace reflected rays. For testing an object database.
  106.  
  107.     -r    Don't trace refracted rays. For testing an object database.
  108.  
  109.     -c    This option specifies the number of samples per pixel 
  110.         for stochastic sampling. The default is 1 (no sampling).
  111.  
  112. Since prt uses two pipes per rt connection, you can specify up to 30 hosts
  113. on the command line. I am trying to figure out a way to increase this. If 
  114. anyone has any ideas, please let me know.
  115.  
  116. You can run rt directly if you want. It has the same usage format as prt
  117. with the exception of the host list. Rt has several more options that are
  118. only used when started by prt. If you are interested, look in main.c.
  119.  
  120. RUNNING NFFCONV
  121.  
  122. Nffconv makes a good faith attempt at converting NFF formatted files to
  123. a format that prt can use. By "good faith" I mean that it makes a lot of
  124. assumptions about the surface properties. Prt's surface properties are more
  125. robust than NFF's.
  126.  
  127. Since prt does not yet handle polygon patches, nnfconv will complain and
  128. exit if your input database contains any polygon patches.
  129.  
  130. Usage for nffconv is:
  131.  
  132.     nffconv <input-file >output-file.
  133.  
  134.  
  135. FUTURE PLANS
  136.  
  137. Since this is the first public release of prt, I expect that there are some
  138. bugs/portability issues. The next release should be less buggy/more portable.
  139. I would like to add the torus object type and polygon patches. The only reason 
  140. that these two objects haven't been added yet is because the math required is
  141. beyond me at this point. I also have come up with a much better load balancing 
  142. scheme which will adjust the load on a per machine basis in real time. I have 
  143. not had a chance to implement this.
  144.  
  145.  
  146. ACKNOWLEDGEMENTS
  147.  
  148. The code for cone intersection and building the bounding boxes were pretty
  149. much lifted from the MTV raytracer. Mark, I hope you don't mind.
  150.  
  151. I would also like to thank Eric Haines and George Kyriazis for their help 
  152. early on in the design of the raytracer engine.
  153.  
  154. Please report bugs/patches/etc to me at:
  155.  
  156.     kory@avatar.com
  157.  
  158. I am very intereseted to hear what kind of images you have done and what kind
  159. of performance you have achieved.
  160.  
  161. If you create cool object files, please send me a copy so that I can archive
  162. them and make them available to others.
  163.  
  164. Enjoy and happy tracing,
  165. --kory
  166. kory@avatar.com
  167.  
  168.