ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rtrace.1
Revision: 1.9
Committed: Thu May 26 06:55:22 2005 UTC (19 years ago) by greg
Branch: MAIN
Changes since 1.8: +9 -9 lines
Log Message:
Got rtcontrib working and wrote basic man page

File Contents

# User Rev Content
1 greg 1.9 .\" RCSid "$Id: rtrace.1,v 1.8 2005/05/25 04:44:24 greg Exp $"
2 greg 1.1 .TH RTRACE 1 10/17/97 RADIANCE
3     .SH NAME
4     rtrace - trace rays in RADIANCE scene
5     .SH SYNOPSIS
6     .B rtrace
7     [
8     .B options
9     ]
10     [
11     .B $EVAR
12     ]
13     [
14     .B @file
15     ]
16     .B octree
17     .br
18     .B "rtrace [ options ] \-defaults"
19     .SH DESCRIPTION
20     .I Rtrace
21     traces rays from the standard input through the RADIANCE scene given by
22     .I octree
23     and sends the results to the standard output.
24     (The octree may be given as the output of a command enclosed in quotes
25     and preceded by a `!'.)\0
26     Input for each ray is:
27    
28     xorg yorg zorg xdir ydir zdir
29    
30     If the direction vector is (0,0,0), a bogus record
31     is printed and the output is flushed if the
32     .I -x
33     value is unset or zero.
34     (See the notes on this option below.)\0
35     This may be useful for programs that run
36     .I rtrace
37     as a separate process.
38     In the second form, the default values
39     for the options (modified by those options present)
40     are printed with a brief explanation.
41     .PP
42     Options may be given on the command line and/or read from the
43     environment and/or read from a file.
44     A command argument beginning with a dollar sign ('$') is immediately
45     replaced by the contents of the given environment variable.
46     A command argument beginning with an at sign ('@') is immediately
47     replaced by the contents of the given file.
48     Most options are followed by one or more arguments, which must be
49     separated from the option and each other by white space.
50     The exceptions to this rule are the boolean options.
51     Normally, the appearance of a boolean option causes a feature to
52     be "toggled", that is switched from off to on or on to off
53     depending on its previous state.
54     Boolean options may also be set
55     explicitly by following them immediately with a '+' or '-', meaning
56     on or off, respectively.
57     Synonyms for '+' are any of the characters "yYtT1", and synonyms
58     for '-' are any of the characters "nNfF0".
59     All other characters will generate an error.
60     .TP 10n
61     .BI -f io
62     Format input according to the character
63     .I i
64     and output according to the character
65     .I o.
66     .I Rtrace
67     understands the following input and output formats: 'a' for
68     ascii, 'f' for single-precision floating point,
69     and 'd' for double-precision floating point.
70     In addition to these three choices, the character 'c' may be used
71     to denote 4-byte floating point (Radiance) color format
72     for the output of values only
73     .I (\-ov
74     option, below).
75     If the output character is missing, the input format is used.
76     .IP
77     Note that there is no space between this option and its argument.
78     .TP
79     .BI -o spec
80     Produce output fields according to
81     .I spec.
82     Characters are interpreted as follows:
83     .IP
84     o origin (input)
85     .IP
86     d direction (normalized)
87     .IP
88     v value (radiance)
89     .IP
90     w weight
91     .IP
92 greg 1.7 W contribution
93     .IP
94 greg 1.1 l effective length of ray
95     .IP
96     L first intersection distance
97     .IP
98 greg 1.2 c local (u,v) coordinates
99     .IP
100 greg 1.1 p point of intersection
101     .IP
102     n normal at intersection (perturbed)
103     .IP
104     N normal at intersection (unperturbed)
105     .IP
106     s surface name
107     .IP
108     m modifier name
109     .IP
110 greg 1.6 M material name
111     .IP
112 greg 1.9 ~ tilde (end of trace marker)
113 greg 1.8 .IP
114 greg 1.1 If the letter 't' appears in
115     .I spec,
116     then the fields following will be printed for every ray traced,
117     not just the final result.
118 greg 1.7 If the capital letter 'T' is given instead of 't', then all rays will
119     be reported, including shadow testing rays to light sources.
120 greg 1.1 Spawned rays are indented one tab for each level.
121 greg 1.9 The tilde marker ('~') is a handy way of differentiating the final ray
122     value from daughter values in a traced ray tree, and usually appears
123     right before the 't' or 'T' output flags.
124 greg 1.8 E.g.,
125 greg 1.9 .I \-ov~TmW
126     will emit a tilde followed by a tab at the end of each trace,
127     which can be easily distinguished even in binary output.
128 greg 1.1 .IP
129     Note that there is no space between this option and its argument.
130     .TP
131 greg 1.6 .BI -te \ mod
132 greg 1.1 Append
133 greg 1.6 .I mod
134 greg 1.1 to the trace exclude list,
135     so that it will not be reported by the trace option
136     .I (\-o*t*).
137     Any ray striking an object having
138 greg 1.6 .I mod
139 greg 1.1 as its modifier will not be reported to the standard output with
140     the rest of the rays being traced.
141 greg 1.7 This option has no effect unless either the 't' or 'T'
142     option has been given as part of the output specifier.
143 greg 1.6 Any number of excluded modifiers may be given, but each
144 greg 1.1 must appear in a separate option.
145     .TP
146 greg 1.6 .BI -ti \ mod
147 greg 1.1 Add
148 greg 1.6 .I mod
149 greg 1.1 to the trace include list,
150 greg 1.8 so that it will be reported by the trace option.
151 greg 1.1 The program can use either an include list or an exclude
152     list, but not both.
153     .TP
154     .BI -tE \ file
155     Same as
156     .I \-te,
157 greg 1.6 except read modifiers to be excluded from
158 greg 1.1 .I file.
159     The RAYPATH environment variable determines which directories are
160     searched for this file.
161 greg 1.6 The modifier names are separated by white space in the file.
162 greg 1.1 .TP
163     .BI -tI \ file
164     Same as
165     .I \-ti,
166 greg 1.6 except read modifiers to be included from
167 greg 1.1 .I file.
168     .TP
169     .BR \-i
170     Boolean switch to compute irradiance rather than radiance values.
171     This only affects the final result, substituting a Lambertian
172     surface and multiplying the radiance by pi.
173     Glass and other transparent surfaces are ignored during this stage.
174     Light sources still appear with their original radiance values,
175     though the
176     .I \-dv
177     option (below) may be used to override this.
178     This option is especially useful in
179     conjunction with ximage(1) for computing illuminance at scene points.
180     .TP
181     .BR \-I
182     Boolean switch to compute irradiance rather than radiance,
183     with the input origin and direction interpreted instead
184     as measurement point and orientation.
185     .TP
186     .BR \-h
187     Boolean switch for information header on output.
188     .TP
189     .BI -x \ res
190     Set the x resolution to
191     .I res.
192     The output will be flushed after every
193     .I res
194     input rays.
195     A value of zero means that no output flushing will take place.
196     .TP
197     .BI -y \ res
198     Set the y resolution to
199     .I res.
200     The program will exit after
201     .I res
202     scanlines have been processed, where a scanline is the number of rays
203     given by the
204     .I \-x
205     option, or 1 if
206     .I \-x
207     is zero.
208     A value of zero means the program will not halt until the end
209     of file is reached.
210     .IP
211     If both
212     .I \-x
213     and
214     .I \-y
215     options are given, a resolution string is printed at the beginning
216     of the output.
217     This is mostly useful for recovering image dimensions with
218     .I pvalue(1),
219     and for creating valid Radiance picture files using the color output
220     format.
221     (See the
222     .I \-f
223     option, above.)
224     .TP
225     .BI -dj \ frac
226     Set the direct jittering to
227     .I frac.
228     A value of zero samples each source at specific sample points
229     (see the
230     .I \-ds
231     option below), giving a smoother but somewhat less accurate
232     rendering.
233     A positive value causes rays to be distributed over each
234     source sample according to its size, resulting in more accurate
235     penumbras.
236     This option should never be greater than 1, and may even
237     cause problems (such as speckle) when the value is smaller.
238     A warning about aiming failure will issued if
239     .I frac
240     is too large.
241     .TP
242     .BI -ds \ frac
243     Set the direct sampling ratio to
244     .I frac.
245     A light source will be subdivided until
246     the width of each sample area divided by the distance
247     to the illuminated point is below this ratio.
248     This assures accuracy in regions close to large area sources
249     at a slight computational expense.
250     A value of zero turns source subdivision off, sending at most one
251     shadow ray to each light source.
252     .TP
253     .BI -dt \ frac
254     Set the direct threshold to
255     .I frac.
256     Shadow testing will stop when the potential contribution of at least
257     the next and at most all remaining light sources is less than
258     this fraction of the accumulated value.
259     (See the
260     .I \-dc
261     option below.)
262     The remaining light source contributions are approximated
263     statistically.
264     A value of zero means that all light sources will be tested for shadow.
265     .TP
266     .BI \-dc \ frac
267     Set the direct certainty to
268     .I frac.
269     A value of one guarantees that the absolute accuracy of the direct calculation
270     will be equal to or better than that given in the
271     .I \-dt
272     specification.
273     A value of zero only insures that all shadow lines resulting in a contrast
274     change greater than the
275     .I \-dt
276     specification will be calculated.
277     .TP
278     .BI -dr \ N
279     Set the number of relays for secondary sources to
280     .I N.
281     A value of 0 means that secondary sources will be ignored.
282     A value of 1 means that sources will be made into first generation
283     secondary sources; a value of 2 means that first generation
284     secondary sources will also be made into second generation secondary
285     sources, and so on.
286     .TP
287     .BI -dp \ D
288     Set the secondary source presampling density to D.
289     This is the number of samples per steradian
290     that will be used to determine ahead of time whether or not
291     it is worth following shadow rays through all the reflections and/or
292     transmissions associated with a secondary source path.
293     A value of 0 means that the full secondary source path will always
294     be tested for shadows if it is tested at all.
295     .TP
296     .BR \-dv
297     Boolean switch for light source visibility.
298     With this switch off, sources will be black when viewed directly
299     although they will still participate in the direct calculation.
300     This option is mostly for the program
301     .I mkillum(1)
302     to avoid inappropriate counting of light sources, but it
303     may also be desirable in conjunction with the
304     .I \-i
305     option.
306     .TP
307     .BI -sj \ frac
308     Set the specular sampling jitter to
309     .I frac.
310     This is the degree to which the highlights are sampled
311     for rough specular materials.
312     A value of one means that all highlights will be fully sampled
313     using distributed ray tracing.
314     A value of zero means that no jittering will take place, and all
315     reflections will appear sharp even when they should be diffuse.
316     .TP
317     .BI -st \ frac
318     Set the specular sampling threshold to
319     .I frac.
320     This is the minimum fraction of reflection or transmission, under which
321     no specular sampling is performed.
322     A value of zero means that highlights will always be sampled by
323     tracing reflected or transmitted rays.
324     A value of one means that specular sampling is never used.
325     Highlights from light sources will always be correct, but
326     reflections from other surfaces will be approximated using an
327     ambient value.
328     A sampling threshold between zero and one offers a compromise between image
329     accuracy and rendering time.
330     .TP
331     .BR -bv
332     Boolean switch for back face visibility.
333     With this switch off, back faces of opaque objects will be invisible
334     to all rays.
335     This is dangerous unless the model was constructed such that
336     all surface normals on opaque objects face outward.
337     Although turning off back face visibility does not save much
338     computation time under most circumstances, it may be useful as a
339     tool for scene debugging, or for seeing through one-sided walls from
340     the outside.
341     This option has no effect on transparent or translucent materials.
342     .TP
343     .BI -av " red grn blu"
344     Set the ambient value to a radiance of
345     .I "red grn blu".
346     This is the final value used in place of an
347     indirect light calculation.
348     If the number of ambient bounces is one or greater and the ambient
349     value weight is non-zero (see
350     .I -aw
351     and
352     .I -ab
353     below), this value may be modified by the computed indirect values
354     to improve overall accuracy.
355     .TP
356     .BI -aw \ N
357     Set the relative weight of the ambient value given with the
358     .I -av
359     option to
360     .I N.
361     As new indirect irradiances are computed, they will modify the
362     default ambient value in a moving average, with the specified weight
363     assigned to the initial value given on the command and all other
364     weights set to 1.
365     If a value of 0 is given with this option, then the initial ambient
366     value is never modified.
367     This is the safest value for scenes with large differences in
368     indirect contributions, such as when both indoor and outdoor
369     (daylight) areas are visible.
370     .TP
371     .BI -ab \ N
372     Set the number of ambient bounces to
373     .I N.
374     This is the maximum number of diffuse bounces
375     computed by the indirect calculation.
376     A value of zero implies no indirect calculation.
377     .TP
378     .BI -ar \ res
379     Set the ambient resolution to
380     .I res.
381     This number will determine the maximum density of ambient values
382     used in interpolation.
383     Error will start to increase on surfaces spaced closer than
384     the scene size divided by the ambient resolution.
385     The maximum ambient value density is the scene size times the
386     ambient accuracy (see the
387     .I \-aa
388     option below) divided by the ambient resolution.
389     The scene size can be determined using
390     .I getinfo(1)
391     with the
392     .I \-d
393     option on the input octree.
394     .TP
395     .BI -aa \ acc
396     Set the ambient accuracy to
397     .I acc.
398     This value will approximately equal the error
399     from indirect illuminance interpolation.
400     A value of zero implies no interpolation.
401     .TP
402     .BI -ad \ N
403     Set the number of ambient divisions to
404     .I N.
405     The error in the Monte Carlo calculation of indirect
406     illuminance will be inversely proportional to the square
407     root of this number.
408     A value of zero implies no indirect calculation.
409     .TP
410     .BI -as \ N
411     Set the number of ambient super-samples to
412     .I N.
413     Super-samples are applied only to the ambient divisions which
414     show a significant change.
415     .TP
416     .BI -af \ fname
417     Set the ambient file to
418     .I fname.
419     This is where indirect illuminance will be stored and retrieved.
420     Normally, indirect illuminance values are kept in memory and
421     lost when the program finishes or dies.
422     By using a file, different invocations can share illuminance
423     values, saving time in the computation.
424     The ambient file is in a machine-independent binary format
425     which can be examined with
426     .I lookamb(1).
427     .IP
428     The ambient file may also be used as a means of communication and
429     data sharing between simultaneously executing processes.
430     The same file may be used by multiple processes, possibly running on
431     different machines and accessing the file via the network (ie.
432     .I nfs(4)).
433     The network lock manager
434     .I lockd(8)
435     is used to insure that this information is used consistently.
436     .IP
437     If any calculation parameters are changed or the scene
438     is modified, the old ambient file should be removed so that
439     the calculation can start over from scratch.
440     For convenience, the original ambient parameters are listed in the
441     header of the ambient file.
442     .I Getinfo(1)
443     may be used to print out this information.
444     .TP
445 greg 1.6 .BI -ae \ mod
446 greg 1.1 Append
447 greg 1.6 .I mod
448 greg 1.1 to the ambient exclude list,
449     so that it will not be considered during the indirect calculation.
450     This is a hack for speeding the indirect computation by
451     ignoring certain objects.
452     Any object having
453 greg 1.6 .I mod
454 greg 1.1 as its modifier will get the default ambient
455     level rather than a calculated value.
456 greg 1.6 Any number of excluded modifiers may be given, but each
457 greg 1.1 must appear in a separate option.
458     .TP
459 greg 1.6 .BI -ai \ mod
460 greg 1.1 Add
461 greg 1.6 .I mod
462 greg 1.1 to the ambient include list,
463     so that it will be considered during the indirect calculation.
464     The program can use either an include list or an exclude
465     list, but not both.
466     .TP
467     .BI -aE \ file
468     Same as
469     .I \-ae,
470 greg 1.6 except read modifiers to be excluded from
471 greg 1.1 .I file.
472     The RAYPATH environment variable determines which directories are
473     searched for this file.
474 greg 1.6 The modifier names are separated by white space in the file.
475 greg 1.1 .TP
476     .BI -aI \ file
477     Same as
478     .I \-ai,
479 greg 1.6 except read modifiers to be included from
480 greg 1.1 .I file.
481     .TP
482     .BI -me " rext gext bext"
483     Set the global medium extinction coefficient to the indicated color,
484     in units of 1/distance (distance in world coordinates).
485     Light will be scattered or absorbed over distance according to
486     this value.
487     The ratio of scattering to total scattering plus absorption is set
488     by the albedo parameter, described below.
489     .TP
490     .BI -ma " ralb galb balb"
491     Set the global medium albedo to the given value between 0\00\00
492     and 1\01\01.
493     A zero value means that all light not transmitted by the medium
494     is absorbed.
495     A unitary value means that all light not transmitted by the medium
496     is scattered in some new direction.
497     The isotropy of scattering is determined by the Heyney-Greenstein
498     parameter, described below.
499     .TP
500     .BI \-mg \ gecc
501     Set the medium Heyney-Greenstein eccentricity parameter to
502     .I gecc.
503     This parameter determines how strongly scattering favors the forward
504     direction.
505     A value of 0 indicates perfectly isotropic scattering.
506     As this parameter approaches 1, scattering tends to prefer the
507     forward direction.
508     .TP
509     .BI \-ms \ sampdist
510     Set the medium sampling distance to
511     .I sampdist,
512     in world coordinate units.
513     During source scattering, this will be the average distance between
514     adjacent samples.
515     A value of 0 means that only one sample will be taken per light
516     source within a given scattering volume.
517     .TP
518     .BI -lr \ N
519     Limit reflections to a maximum of
520     .I N.
521     .TP
522     .BI -lw \ frac
523     Limit the weight of each ray to a minimum of
524     .I frac.
525     During ray-tracing, a record is kept of the final contribution
526     a ray would have to the image.
527     If it is less then the specified minimum, the ray is not traced.
528     .TP
529     .BR -ld
530     Boolean switch to limit ray distance.
531     If this option is set, then rays will only be traced as far as the
532     magnitude of each direction vector.
533     Otherwise, vector magnitude is ignored and rays are traced to infinity.
534     .TP
535     .BI -e \ efile
536     Send error messages and progress reports to
537     .I efile
538     instead of the standard error.
539     .TP
540     .BR \-w
541     Boolean switch to suppress warning messages.
542     .TP
543     .BI \-P \ pfile
544     Execute in a persistent mode, using
545     .I pfile
546     as the control file.
547     Persistent execution means that after reaching end-of-file on
548     its input,
549     .I rtrace
550     will fork a child process that will wait for another
551     .I rtrace
552     command with the same
553     .I \-P
554     option to attach to it.
555     (Note that since the rest of the command line options will be those
556     of the original invocation, it is not necessary to give any arguments
557     besides
558     .I \-P
559     for subsequent calls.)
560     Killing the process is achieved with the
561     .I kill(1)
562     command.
563     (The process ID in the first line of
564     .I pfile
565     may be used to identify the waiting
566     .I rtrace
567     process.)
568     This option may be used with the
569     .I \-fr
570     option of
571     .I pinterp(1)
572     to avoid the cost of starting up
573     .I rtrace
574     many times.
575     .TP
576     .BI \-PP \ pfile
577     Execute in continuous-forking persistent mode, using
578     .I pfile
579     as the control file.
580     The difference between this option and the
581     .I \-P
582     option described above is the creation of multiple duplicate
583     processes to handle any number of attaches.
584     This provides a simple and reliable mechanism of memory sharing
585     on most multiprocessing platforms, since the
586     .I fork(2)
587     system call will share memory on a copy-on-write basis.
588     .SH EXAMPLES
589     To compute radiance values for the rays listed in samples.inp:
590     .IP "" .2i
591     rtrace -ov scene.oct < samples.inp > radiance.out
592     .PP
593     To compute illuminance values at locations selected with the 't'
594     command of
595     .I ximage(1):
596     .IP "" .2i
597     ximage scene.pic | rtrace -h -x 1 -i scene.oct | rcalc -e '$1=47.4*$1+120*$2+11.6*$3'
598     .PP
599     To record the object identifier corresponding to each pixel in an image:
600     .IP "" .2i
601     vwrays -fd scene.pic | rtrace -fda `vwrays -d scene.pic` -os scene.oct
602     .PP
603     To compute an image with an unusual view mapping:
604     .IP "" .2i
605     cnt 640 480 | rcalc -e 'xr:640;yr:480' -f unusual_view.cal | rtrace
606     -x 640 -y 480 -fac scene.oct > unusual.pic
607     .SH ENVIRONMENT
608     RAYPATH the directories to check for auxiliary files.
609     .SH FILES
610 greg 1.5 /tmp/rtXXXXXX common header information for picture sequence
611 greg 1.1 .SH DIAGNOSTICS
612     If the program terminates from an input related error, the exit status
613     will be 1.
614     A system related error results in an exit status of 2.
615     If the program receives a signal that is caught, it will exit with a status
616     of 3.
617     In each case, an error message will be printed to the standard error, or
618     to the file designated by the
619     .I \-e
620     option.
621     .SH AUTHOR
622     Greg Ward
623     .SH "SEE ALSO"
624     getinfo(1), lookamb(1), oconv(1), pfilt(1), pinterp(1),
625 greg 1.9 pvalue(1), rpict(1), rtcontrib(1), rvu(1), vwrays(1), ximage(1)