ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rtrace.1
Revision: 1.42
Committed: Wed Apr 23 15:09:03 2025 UTC (3 weeks, 3 days ago) by greg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.41: +6 -3 lines
Log Message:
docs: Wording fixes to man pages regarding -e and -f options

File Contents

# User Rev Content
1 greg 1.42 .\" RCSid "$Id: rtrace.1,v 1.41 2025/04/22 17:12:25 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 greg 1.36 .br
20     .B "rtrace \-features [feat1 ..]"
21 greg 1.1 .SH DESCRIPTION
22     .I Rtrace
23     traces rays from the standard input through the RADIANCE scene given by
24     .I octree
25     and sends the results to the standard output.
26     (The octree may be given as the output of a command enclosed in quotes
27     and preceded by a `!'.)\0
28     Input for each ray is:
29    
30     xorg yorg zorg xdir ydir zdir
31    
32     If the direction vector is (0,0,0), a bogus record
33     is printed and the output is flushed if the
34     .I -x
35 greg 1.24 value is one or zero.
36 greg 1.1 (See the notes on this option below.)\0
37     This may be useful for programs that run
38     .I rtrace
39     as a separate process.
40 greg 1.36 .PP
41     In the second form shown above, the default values
42 greg 1.1 for the options (modified by those options present)
43     are printed with a brief explanation.
44     .PP
45 greg 1.36 In the third form, a list of supported features is sent
46     to the standard output, one per line.
47     If additional arguments follow, they are checked for presence in
48     this list.
49     If a feature includes subfeatures, these may be checked as well by
50     specifying:
51     .nf
52    
53     rtrace -features FeatName=subfeat1,subfeat2
54    
55     .fi
56     If any named feature or subfeature is missing, an error is
57     reported and the program returns an error status.
58     If all of the named features are present, a zero status is returned.
59     .PP
60 greg 1.1 Options may be given on the command line and/or read from the
61     environment and/or read from a file.
62     A command argument beginning with a dollar sign ('$') is immediately
63     replaced by the contents of the given environment variable.
64     A command argument beginning with an at sign ('@') is immediately
65     replaced by the contents of the given file.
66     Most options are followed by one or more arguments, which must be
67     separated from the option and each other by white space.
68     The exceptions to this rule are the boolean options.
69     Normally, the appearance of a boolean option causes a feature to
70     be "toggled", that is switched from off to on or on to off
71     depending on its previous state.
72     Boolean options may also be set
73     explicitly by following them immediately with a '+' or '-', meaning
74     on or off, respectively.
75     Synonyms for '+' are any of the characters "yYtT1", and synonyms
76     for '-' are any of the characters "nNfF0".
77     All other characters will generate an error.
78     .TP 10n
79     .BI -f io
80     Format input according to the character
81     .I i
82     and output according to the character
83     .I o.
84     .I Rtrace
85     understands the following input and output formats: 'a' for
86     ascii, 'f' for single-precision floating point,
87     and 'd' for double-precision floating point.
88     In addition to these three choices, the character 'c' may be used
89 greg 1.33 to denote 4-byte RGBE (Radiance) color format
90     for the output of individual color values only, and the
91     .I \-x
92     and
93     .I \-y
94     options should also be specified to create a valid output picture.
95 greg 1.1 If the output character is missing, the input format is used.
96     .IP
97     Note that there is no space between this option and its argument.
98     .TP
99     .BI -o spec
100     Produce output fields according to
101     .I spec.
102     Characters are interpreted as follows:
103     .IP
104     o origin (input)
105     .IP
106     d direction (normalized)
107     .IP
108     v value (radiance)
109     .IP
110 greg 1.14 V contribution (radiance)
111     .IP
112 greg 1.1 w weight
113     .IP
114 greg 1.10 W color coefficient
115 greg 1.7 .IP
116 greg 1.1 l effective length of ray
117     .IP
118     L first intersection distance
119     .IP
120 greg 1.2 c local (u,v) coordinates
121     .IP
122 greg 1.1 p point of intersection
123     .IP
124     n normal at intersection (perturbed)
125     .IP
126     N normal at intersection (unperturbed)
127     .IP
128     s surface name
129     .IP
130     m modifier name
131     .IP
132 greg 1.6 M material name
133     .IP
134 greg 1.31 r mirrored value contribution
135     .IP
136     x unmirrored value contribution
137     .IP
138     R mirrored ray length
139     .IP
140     X unmirrored ray length
141     .IP
142 greg 1.9 ~ tilde (end of trace marker)
143 greg 1.8 .IP
144 greg 1.1 If the letter 't' appears in
145     .I spec,
146     then the fields following will be printed for every ray traced,
147     not just the final result.
148 greg 1.7 If the capital letter 'T' is given instead of 't', then all rays will
149     be reported, including shadow testing rays to light sources.
150 greg 1.1 Spawned rays are indented one tab for each level.
151 greg 1.9 The tilde marker ('~') is a handy way of differentiating the final ray
152     value from daughter values in a traced ray tree, and usually appears
153     right before the 't' or 'T' output flags.
154 greg 1.8 E.g.,
155 greg 1.9 .I \-ov~TmW
156     will emit a tilde followed by a tab at the end of each trace,
157     which can be easily distinguished even in binary output.
158 greg 1.1 .IP
159     Note that there is no space between this option and its argument.
160     .TP
161 greg 1.6 .BI -te \ mod
162 greg 1.1 Append
163 greg 1.6 .I mod
164 greg 1.1 to the trace exclude list,
165     so that it will not be reported by the trace option
166     .I (\-o*t*).
167     Any ray striking an object having
168 greg 1.6 .I mod
169 greg 1.1 as its modifier will not be reported to the standard output with
170     the rest of the rays being traced.
171 greg 1.7 This option has no effect unless either the 't' or 'T'
172     option has been given as part of the output specifier.
173 greg 1.6 Any number of excluded modifiers may be given, but each
174 greg 1.1 must appear in a separate option.
175     .TP
176 greg 1.6 .BI -ti \ mod
177 greg 1.1 Add
178 greg 1.6 .I mod
179 greg 1.1 to the trace include list,
180 greg 1.8 so that it will be reported by the trace option.
181 greg 1.1 The program can use either an include list or an exclude
182     list, but not both.
183     .TP
184     .BI -tE \ file
185     Same as
186     .I \-te,
187 greg 1.6 except read modifiers to be excluded from
188 greg 1.1 .I file.
189     The RAYPATH environment variable determines which directories are
190     searched for this file.
191 greg 1.6 The modifier names are separated by white space in the file.
192 greg 1.1 .TP
193     .BI -tI \ file
194     Same as
195     .I \-ti,
196 greg 1.6 except read modifiers to be included from
197 greg 1.1 .I file.
198     .TP
199     .BR \-i
200     Boolean switch to compute irradiance rather than radiance values.
201     This only affects the final result, substituting a Lambertian
202     surface and multiplying the radiance by pi.
203     Glass and other transparent surfaces are ignored during this stage.
204     Light sources still appear with their original radiance values,
205     though the
206     .I \-dv
207     option (below) may be used to override this.
208     This option is especially useful in
209 greg 1.35 conjunction with ximage(1) for computing irradiance at scene points.
210 greg 1.1 .TP
211 greg 1.13 .BR \-u
212     Boolean switch to control uncorrelated random sampling.
213 greg 1.12 When "off", a low-discrepancy sequence is used, which reduces
214     variance but can result in a brushed appearance in specular highlights.
215     When "on", pure Monte Carlo sampling is used in all calculations.
216     .TP
217 greg 1.1 .BR \-I
218     Boolean switch to compute irradiance rather than radiance,
219     with the input origin and direction interpreted instead
220     as measurement point and orientation.
221     .TP
222     .BR \-h
223     Boolean switch for information header on output.
224     .TP
225     .BI -x \ res
226     Set the x resolution to
227     .I res.
228     The output will be flushed after every
229     .I res
230 greg 1.21 input rays if
231     .I \-y
232     is set to zero.
233     A value of one means that every ray will be flushed, whatever
234     the setting of
235     .I \-y.
236 greg 1.1 A value of zero means that no output flushing will take place.
237     .TP
238     .BI -y \ res
239     Set the y resolution to
240     .I res.
241     The program will exit after
242     .I res
243     scanlines have been processed, where a scanline is the number of rays
244     given by the
245     .I \-x
246     option, or 1 if
247     .I \-x
248     is zero.
249     A value of zero means the program will not halt until the end
250     of file is reached.
251     .IP
252     If both
253     .I \-x
254     and
255     .I \-y
256     options are given, a resolution string is printed at the beginning
257     of the output.
258     This is mostly useful for recovering image dimensions with
259     .I pvalue(1),
260     and for creating valid Radiance picture files using the color output
261     format.
262     (See the
263 greg 1.41 .I \-f\*
264 greg 1.1 option, above.)
265     .TP
266 greg 1.18 .BI -n \ nproc
267     Execute in parallel on
268     .I nproc
269     local processes.
270 greg 1.19 This option is incompatible with the
271 greg 1.18 .I \-P
272     and
273     .I \-PP,
274 greg 1.19 options.
275 greg 1.18 Multiple processes also do not work properly with ray tree output
276     using any of the
277     .I \-o*t*
278     options.
279     There is no benefit from specifying more processes than there are
280     cores available on the system or the
281     .I \-x
282     setting, which forces a wait at each flush.
283     .TP
284 greg 1.41 .BI -f \ source
285 greg 1.42 Load definitions from the file
286 greg 1.41 .I source
287 greg 1.42 and assign at the global level.
288     The usual set of library directories is searched based on the
289     .I RAYPATH
290     environment variable.
291 greg 1.41 .TP
292     .BI -e \ expr
293     Set additional definitions from
294     .I expr.
295     .TP
296 greg 1.1 .BI -dj \ frac
297     Set the direct jittering to
298     .I frac.
299     A value of zero samples each source at specific sample points
300     (see the
301     .I \-ds
302     option below), giving a smoother but somewhat less accurate
303     rendering.
304     A positive value causes rays to be distributed over each
305     source sample according to its size, resulting in more accurate
306     penumbras.
307     This option should never be greater than 1, and may even
308     cause problems (such as speckle) when the value is smaller.
309     A warning about aiming failure will issued if
310     .I frac
311     is too large.
312     .TP
313     .BI -ds \ frac
314     Set the direct sampling ratio to
315     .I frac.
316     A light source will be subdivided until
317     the width of each sample area divided by the distance
318     to the illuminated point is below this ratio.
319     This assures accuracy in regions close to large area sources
320     at a slight computational expense.
321     A value of zero turns source subdivision off, sending at most one
322     shadow ray to each light source.
323     .TP
324     .BI -dt \ frac
325     Set the direct threshold to
326     .I frac.
327     Shadow testing will stop when the potential contribution of at least
328     the next and at most all remaining light sources is less than
329     this fraction of the accumulated value.
330     (See the
331     .I \-dc
332     option below.)
333     The remaining light source contributions are approximated
334     statistically.
335     A value of zero means that all light sources will be tested for shadow.
336     .TP
337     .BI \-dc \ frac
338     Set the direct certainty to
339     .I frac.
340     A value of one guarantees that the absolute accuracy of the direct calculation
341     will be equal to or better than that given in the
342     .I \-dt
343     specification.
344     A value of zero only insures that all shadow lines resulting in a contrast
345     change greater than the
346     .I \-dt
347     specification will be calculated.
348     .TP
349     .BI -dr \ N
350 greg 1.35 Set the number of relays for virtual sources to
351 greg 1.1 .I N.
352 greg 1.35 A value of 0 means that virtual sources will be ignored.
353 greg 1.1 A value of 1 means that sources will be made into first generation
354 greg 1.35 virtual sources; a value of 2 means that first generation
355     virtual sources will also be made into second generation virtual
356 greg 1.1 sources, and so on.
357     .TP
358     .BI -dp \ D
359 greg 1.35 Set the virtual source presampling density to D.
360 greg 1.1 This is the number of samples per steradian
361     that will be used to determine ahead of time whether or not
362     it is worth following shadow rays through all the reflections and/or
363 greg 1.35 transmissions associated with a virtual source path.
364     A value of 0 means that the full virtual source path will always
365 greg 1.1 be tested for shadows if it is tested at all.
366     .TP
367     .BR \-dv
368     Boolean switch for light source visibility.
369     With this switch off, sources will be black when viewed directly
370     although they will still participate in the direct calculation.
371     This option is mostly for the program
372     .I mkillum(1)
373     to avoid inappropriate counting of light sources, but it
374     may also be desirable in conjunction with the
375     .I \-i
376     option.
377     .TP
378 greg 1.22 .BI -ss \ samp
379     Set the specular sampling to
380     .I samp.
381     For values less than 1, this is the degree to which the highlights
382     are sampled for rough specular materials.
383     A value greater than one causes multiple ray samples to be sent
384     to reduce noise at a commmesurate cost.
385 greg 1.1 A value of zero means that no jittering will take place, and all
386     reflections will appear sharp even when they should be diffuse.
387     .TP
388     .BI -st \ frac
389     Set the specular sampling threshold to
390     .I frac.
391     This is the minimum fraction of reflection or transmission, under which
392     no specular sampling is performed.
393     A value of zero means that highlights will always be sampled by
394     tracing reflected or transmitted rays.
395     A value of one means that specular sampling is never used.
396     Highlights from light sources will always be correct, but
397     reflections from other surfaces will be approximated using an
398     ambient value.
399     A sampling threshold between zero and one offers a compromise between image
400     accuracy and rendering time.
401     .TP
402     .BR -bv
403     Boolean switch for back face visibility.
404 greg 1.25 With this switch off, back faces of all objects will be invisible
405     to view rays.
406 greg 1.1 This is dangerous unless the model was constructed such that
407 greg 1.25 all surface normals face outward.
408 greg 1.1 Although turning off back face visibility does not save much
409     computation time under most circumstances, it may be useful as a
410     tool for scene debugging, or for seeing through one-sided walls from
411     the outside.
412     .TP
413     .BI -av " red grn blu"
414     Set the ambient value to a radiance of
415     .I "red grn blu".
416     This is the final value used in place of an
417     indirect light calculation.
418     If the number of ambient bounces is one or greater and the ambient
419     value weight is non-zero (see
420     .I -aw
421     and
422     .I -ab
423     below), this value may be modified by the computed indirect values
424     to improve overall accuracy.
425     .TP
426     .BI -aw \ N
427     Set the relative weight of the ambient value given with the
428     .I -av
429     option to
430     .I N.
431     As new indirect irradiances are computed, they will modify the
432     default ambient value in a moving average, with the specified weight
433     assigned to the initial value given on the command and all other
434     weights set to 1.
435     If a value of 0 is given with this option, then the initial ambient
436     value is never modified.
437     This is the safest value for scenes with large differences in
438     indirect contributions, such as when both indoor and outdoor
439     (daylight) areas are visible.
440     .TP
441     .BI -ab \ N
442     Set the number of ambient bounces to
443     .I N.
444 greg 1.26 This is the maximum number of diffuse bounces computed by the indirect
445     calculation. A value of zero implies no indirect calculation.
446     .IP
447 rschregle 1.27 This value defaults to 1 in photon mapping mode (see
448 greg 1.26 .I -ap
449 rschregle 1.27 below), implying that global photon irradiance is always computed via
450 greg 1.26 .I one
451 rschregle 1.27 ambient bounce; this behaviour applies to any positive number of ambient
452     bounces, regardless of the actual value specified. A negative value enables
453     a preview mode that directly visualises the irradiance from the global
454     photon map without any ambient bounces.
455 greg 1.1 .TP
456     .BI -ar \ res
457     Set the ambient resolution to
458     .I res.
459     This number will determine the maximum density of ambient values
460     used in interpolation.
461     Error will start to increase on surfaces spaced closer than
462     the scene size divided by the ambient resolution.
463     The maximum ambient value density is the scene size times the
464     ambient accuracy (see the
465     .I \-aa
466     option below) divided by the ambient resolution.
467     The scene size can be determined using
468     .I getinfo(1)
469     with the
470     .I \-d
471     option on the input octree.
472     .TP
473     .BI -aa \ acc
474     Set the ambient accuracy to
475     .I acc.
476     This value will approximately equal the error
477 greg 1.35 from indirect irradiance interpolation.
478 greg 1.1 A value of zero implies no interpolation.
479     .TP
480     .BI -ad \ N
481     Set the number of ambient divisions to
482     .I N.
483     The error in the Monte Carlo calculation of indirect
484 greg 1.35 irradiance will be inversely proportional to the square
485 greg 1.1 root of this number.
486     A value of zero implies no indirect calculation.
487     .TP
488     .BI -as \ N
489     Set the number of ambient super-samples to
490     .I N.
491     Super-samples are applied only to the ambient divisions which
492     show a significant change.
493     .TP
494     .BI -af \ fname
495     Set the ambient file to
496     .I fname.
497 greg 1.35 This is where indirect irradiance will be stored and retrieved.
498     Normally, indirect irradiance values are kept in memory and
499 greg 1.1 lost when the program finishes or dies.
500 greg 1.35 By using a file, different invocations can share irradiance
501 greg 1.1 values, saving time in the computation.
502     The ambient file is in a machine-independent binary format
503     which can be examined with
504     .I lookamb(1).
505     .IP
506     The ambient file may also be used as a means of communication and
507     data sharing between simultaneously executing processes.
508     The same file may be used by multiple processes, possibly running on
509     different machines and accessing the file via the network (ie.
510     .I nfs(4)).
511     The network lock manager
512     .I lockd(8)
513     is used to insure that this information is used consistently.
514     .IP
515     If any calculation parameters are changed or the scene
516     is modified, the old ambient file should be removed so that
517     the calculation can start over from scratch.
518     For convenience, the original ambient parameters are listed in the
519     header of the ambient file.
520     .I Getinfo(1)
521     may be used to print out this information.
522     .TP
523 greg 1.6 .BI -ae \ mod
524 greg 1.1 Append
525 greg 1.6 .I mod
526 greg 1.1 to the ambient exclude list,
527     so that it will not be considered during the indirect calculation.
528     This is a hack for speeding the indirect computation by
529     ignoring certain objects.
530     Any object having
531 greg 1.6 .I mod
532 greg 1.1 as its modifier will get the default ambient
533     level rather than a calculated value.
534 greg 1.6 Any number of excluded modifiers may be given, but each
535 greg 1.1 must appear in a separate option.
536     .TP
537 greg 1.6 .BI -ai \ mod
538 greg 1.1 Add
539 greg 1.6 .I mod
540 greg 1.1 to the ambient include list,
541     so that it will be considered during the indirect calculation.
542     The program can use either an include list or an exclude
543     list, but not both.
544     .TP
545     .BI -aE \ file
546     Same as
547     .I \-ae,
548 greg 1.6 except read modifiers to be excluded from
549 greg 1.1 .I file.
550     The RAYPATH environment variable determines which directories are
551     searched for this file.
552 greg 1.6 The modifier names are separated by white space in the file.
553 greg 1.1 .TP
554     .BI -aI \ file
555     Same as
556     .I \-ai,
557 greg 1.6 except read modifiers to be included from
558 greg 1.1 .I file.
559     .TP
560 greg 1.26 .BI -ap " file [bwidth1 [bwidth2]]"
561     Enable photon mapping mode. Loads a photon map generated with
562     .I mkpmap(1)
563     from
564     .I file,
565     and evaluates the indirect irradiance depending on the photon type
566     (automagically detected) using density estimates with a bandwidth of
567     .I bwidth1
568     photons, or the default bandwidth if none is specified (a warning will be
569     issued in this case).
570     .IP
571     Global photon irradiance is evaluated as part of the ambient calculation (see
572     .I \-ab
573     above), caustic photon irradiance is evaluated at primary rays, and
574     indirect inscattering in
575     .I mist
576 rschregle 1.29 is accounted for by volume photons. Contribution photons are treated as
577     global photons by
578     .I rtrace.
579 greg 1.26 .IP
580     Additionally specifying
581     .I bwidth2
582     enables bias compensation for the density estimates with a
583     minimum and maximum bandwidth of
584     .I bwidth1
585     and
586     .I bwidth2,
587     respectively.
588     .IP
589     Global photon irradiance may be optionally precomputed by
590     .I mkpmap(1),
591     in which case the bandwidth, if specified, is ignored, as the nearest photon
592     is invariably looked up.
593     .IP
594     Using direct photons replaces the direct calculation with density estimates
595     for debugging and validation of photon emission.
596     .TP
597     .BI -am " frac"
598 rschregle 1.27 Maximum search radius for photon map lookups. Without this option, an
599     initial maximum search radius is estimated for each photon map from the
600     average photon distance to the distribution's centre of gravity. It is then
601     adapted to the photon density in subsequent lookups. This option imposes a
602     global fixed maximum search radius for
603     .I all
604     photon maps, thus defeating the automatic adaptation. It is useful when
605     multiple warnings about short photon lookups are issued. Note that this
606     option does not conflict with the bandwidth specified with the
607     .I \-ap
608     option; the number of photons found will not exceed the latter, but may be
609     lower if the maximum search radius contains fewer photons, thus resulting in
610     short lookups. Setting this radius too large, on the other hand, may
611     degrade performance.
612 greg 1.26 .TP
613 rschregle 1.28 .BI -ac " pagesize"
614     Set the photon cache page size when using out-of-core photon mapping. The
615     photon cache reduces disk I/O incurred by on-demand loading (paging) of
616     photons, and thus increases performance. This
617     is expressed as a (float) multiple of the density estimate bandwidth
618     specified with
619     .I \-ap
620     under the assumption that photon lookups are local to a cache page. Cache
621     performance is sensitive to this parameter: larger pagesizes will reduce the
622     paging frequency at the expense of higher latency when paging does occur.
623     Sensible values are in the range 4 (default) to 16.
624     .TP
625     .BI -aC " cachesize"
626     Set the total number of photons cached when using out-of-core photon
627     mapping, taking into account the pagesize specified by
628     .I \-ac.
629     Note that this is approximate as the number of cache pages is rounded to
630     the nearest prime. This allows adapting the cache to the available physical
631     memory. In conjunction with the
632     .I \-n
633     option, this is the cache size
634     .I per parallel process.
635     Cache performance is less sensitive to this parameter,
636     and reasonable performance can obtained with as few as 10k photons. The
637     default is 1M. This option recognises multiplier suffixes (k = 1e3, M =
638     1e6), both in upper and lower case.
639     .TP
640 greg 1.1 .BI -me " rext gext bext"
641     Set the global medium extinction coefficient to the indicated color,
642     in units of 1/distance (distance in world coordinates).
643     Light will be scattered or absorbed over distance according to
644     this value.
645     The ratio of scattering to total scattering plus absorption is set
646     by the albedo parameter, described below.
647     .TP
648     .BI -ma " ralb galb balb"
649     Set the global medium albedo to the given value between 0\00\00
650     and 1\01\01.
651     A zero value means that all light not transmitted by the medium
652     is absorbed.
653     A unitary value means that all light not transmitted by the medium
654     is scattered in some new direction.
655     The isotropy of scattering is determined by the Heyney-Greenstein
656     parameter, described below.
657     .TP
658     .BI \-mg \ gecc
659     Set the medium Heyney-Greenstein eccentricity parameter to
660     .I gecc.
661     This parameter determines how strongly scattering favors the forward
662     direction.
663     A value of 0 indicates perfectly isotropic scattering.
664     As this parameter approaches 1, scattering tends to prefer the
665     forward direction.
666     .TP
667     .BI \-ms \ sampdist
668     Set the medium sampling distance to
669     .I sampdist,
670     in world coordinate units.
671     During source scattering, this will be the average distance between
672     adjacent samples.
673     A value of 0 means that only one sample will be taken per light
674     source within a given scattering volume.
675     .TP
676     .BI -lr \ N
677     Limit reflections to a maximum of
678 greg 1.20 .I N,
679     if N is a positive integer.
680 greg 1.11 If
681     .I N
682     is zero or negative, then Russian roulette is used for ray
683     termination, and the
684     .I -lw
685     setting (below) must be positive.
686 greg 1.32 If N is a negative integer, then this limits the maximum
687     number of reflections even with Russian roulette.
688 greg 1.11 In scenes with dielectrics and total internal reflection,
689     a setting of 0 (no limit) may cause a stack overflow.
690 greg 1.1 .TP
691     .BI -lw \ frac
692     Limit the weight of each ray to a minimum of
693     .I frac.
694 greg 1.11 During ray-tracing, a record is kept of the estimated contribution
695     (weight) a ray would have in the image.
696     If this weight is less than the specified minimum and the
697     .I -lr
698     setting (above) is positive, the ray is not traced.
699     Otherwise, Russian roulette is used to
700     continue rays with a probability equal to the ray weight
701     divided by the given
702     .I frac.
703 greg 1.1 .TP
704 greg 1.37 .BR \-ld
705 greg 1.1 Boolean switch to limit ray distance.
706     If this option is set, then rays will only be traced as far as the
707     magnitude of each direction vector.
708     Otherwise, vector magnitude is ignored and rays are traced to infinity.
709     .TP
710 greg 1.37 .BI -cs \ Ns
711     Use
712     .I Ns
713     bands for spectral sampling rather than the default RGB calculation space.
714     The maximum setting is controlled by the compiler macro MAXCSAMP, and
715     defaults to 24.
716     Larger values for Ns will be reduced to MAXCSAMP.
717     .TP
718     .BI -cw " nmA nmB"
719     Set extrema to the given wavelengths for spectral sampling.
720     The default is 380 and 780 nanometers.
721     The order specified does not matter.
722     .TP
723     .BR \-co
724     Boolean switch turns on spectral data output if selected.
725     The default is to reduce spectral results to RGB, but see the related
726     .I \-p*
727     options, below.
728     .TP
729     .BI -pc " xr yr xg yg xb yb xw yw"
730     Use the specified chromaticity pairs for output primaries and white
731     point rather than the standard RGB color space.
732     .TP
733     .BR \-pRGB
734     Output standard RGB values (the default).
735     .TP
736     .BR \-pXYZ
737     Output standard CIE XYZ tristimulus values rather than RGB.
738     .TP
739     .BR \-pY
740 greg 1.38 Produce a single output channel corresponding to photopic luminance.
741 greg 1.37 .TP
742     .BR \-pS
743 greg 1.38 Produce a single output channel corresponding to scotopic luminance.
744 greg 1.37 .TP
745     .BR \-pM
746 greg 1.38 Produce a single output channel corresponding to melanopic luminance.
747 greg 1.37 .TP
748 greg 1.1 .BI -e \ efile
749     Send error messages and progress reports to
750     .I efile
751     instead of the standard error.
752     .TP
753     .BR \-w
754     Boolean switch to suppress warning messages.
755     .TP
756     .BI \-P \ pfile
757     Execute in a persistent mode, using
758     .I pfile
759     as the control file.
760     Persistent execution means that after reaching end-of-file on
761     its input,
762     .I rtrace
763     will fork a child process that will wait for another
764     .I rtrace
765     command with the same
766     .I \-P
767     option to attach to it.
768     (Note that since the rest of the command line options will be those
769     of the original invocation, it is not necessary to give any arguments
770     besides
771     .I \-P
772     for subsequent calls.)
773     Killing the process is achieved with the
774     .I kill(1)
775     command.
776     (The process ID in the first line of
777     .I pfile
778     may be used to identify the waiting
779     .I rtrace
780     process.)
781     This option may be used with the
782     .I \-fr
783     option of
784     .I pinterp(1)
785     to avoid the cost of starting up
786     .I rtrace
787     many times.
788     .TP
789     .BI \-PP \ pfile
790     Execute in continuous-forking persistent mode, using
791     .I pfile
792     as the control file.
793     The difference between this option and the
794     .I \-P
795     option described above is the creation of multiple duplicate
796     processes to handle any number of attaches.
797     This provides a simple and reliable mechanism of memory sharing
798     on most multiprocessing platforms, since the
799     .I fork(2)
800     system call will share memory on a copy-on-write basis.
801 greg 1.26 .SH NOTES
802     Photons are generally surface bound (an exception are volume photons), thus
803     the ambient irradiance in photon mapping mode will be biased at positions
804     which do not lie on a surface.
805 greg 1.1 .SH EXAMPLES
806     To compute radiance values for the rays listed in samples.inp:
807     .IP "" .2i
808 greg 1.15 rtrace \-ov scene.oct < samples.inp > radiance.out
809 greg 1.1 .PP
810 greg 1.35 To compute irradiance values at locations selected with the 't'
811 greg 1.1 command of
812     .I ximage(1):
813     .IP "" .2i
814 greg 1.16 ximage scene.hdr | rtrace \-h \-x 1 \-i scene.oct | rcalc \-e '$1=47.4*$1+120*$2+11.6*$3'
815 greg 1.1 .PP
816     To record the object identifier corresponding to each pixel in an image:
817     .IP "" .2i
818 greg 1.16 vwrays \-fd scene.hdr | rtrace \-fda `vwrays \-d scene.hdr` \-os scene.oct
819 greg 1.1 .PP
820     To compute an image with an unusual view mapping:
821     .IP "" .2i
822 greg 1.17 cnt 480 640 | rcalc \-e 'xr:640;yr:480' \-f unusual_view.cal | rtrace
823 greg 1.16 \-x 640 \-y 480 \-fac scene.oct > unusual.hdr
824 greg 1.26 .PP
825 greg 1.35 To compute ambient irradiance in photon mapping mode from a global photon
826 greg 1.26 map global.pm via one ambient bounce, and from a caustic photon map
827     caustic.pm at sensor positions in samples.inp:
828     .IP "" .2i
829     rtrace -h -ov -ab 1 -ap global.pm 50 -ap caustic.pm 50 scene.oct <
830     samples.inp > illum.out
831 greg 1.1 .SH ENVIRONMENT
832     RAYPATH the directories to check for auxiliary files.
833     .SH FILES
834 greg 1.5 /tmp/rtXXXXXX common header information for picture sequence
835 greg 1.1 .SH DIAGNOSTICS
836     If the program terminates from an input related error, the exit status
837     will be 1.
838     A system related error results in an exit status of 2.
839     If the program receives a signal that is caught, it will exit with a status
840     of 3.
841     In each case, an error message will be printed to the standard error, or
842     to the file designated by the
843     .I \-e
844     option.
845     .SH AUTHOR
846     Greg Ward
847     .SH "SEE ALSO"
848 greg 1.39 dctimestep(1), getinfo(1), lookamb(1),
849     mkpmap(1), oconv(1), pfilt(1), pinterp(1),
850 greg 1.40 pvalue(1), rcalc(1), rcomb(1), rcontrib(1), rcrop(1),
851     rmtxop(1), rsplit(1),
852 greg 1.34 rpict(1), rtpict(1), rvu(1), vwrays(1), ximage(1)