ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rtrace.1
Revision: 1.13
Committed: Tue Jun 14 03:34:14 2005 UTC (18 years, 10 months ago) by greg
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1
Changes since 1.12: +3 -3 lines
Log Message:
Had to change new -R rendering option to -u to avoid conflict with rpiece

File Contents

# Content
1 .\" RCSid "$Id: rtrace.1,v 1.12 2005/06/13 20:07:55 greg Exp $"
2 .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 W color coefficient
93 .IP
94 l effective length of ray
95 .IP
96 L first intersection distance
97 .IP
98 c local (u,v) coordinates
99 .IP
100 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 M material name
111 .IP
112 ~ tilde (end of trace marker)
113 .IP
114 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 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 Spawned rays are indented one tab for each level.
121 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 E.g.,
125 .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 .IP
129 Note that there is no space between this option and its argument.
130 .TP
131 .BI -te \ mod
132 Append
133 .I mod
134 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 .I mod
139 as its modifier will not be reported to the standard output with
140 the rest of the rays being traced.
141 This option has no effect unless either the 't' or 'T'
142 option has been given as part of the output specifier.
143 Any number of excluded modifiers may be given, but each
144 must appear in a separate option.
145 .TP
146 .BI -ti \ mod
147 Add
148 .I mod
149 to the trace include list,
150 so that it will be reported by the trace option.
151 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 except read modifiers to be excluded from
158 .I file.
159 The RAYPATH environment variable determines which directories are
160 searched for this file.
161 The modifier names are separated by white space in the file.
162 .TP
163 .BI -tI \ file
164 Same as
165 .I \-ti,
166 except read modifiers to be included from
167 .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 \-u
182 Boolean switch to control uncorrelated random sampling.
183 When "off", a low-discrepancy sequence is used, which reduces
184 variance but can result in a brushed appearance in specular highlights.
185 When "on", pure Monte Carlo sampling is used in all calculations.
186 .TP
187 .BR \-I
188 Boolean switch to compute irradiance rather than radiance,
189 with the input origin and direction interpreted instead
190 as measurement point and orientation.
191 .TP
192 .BR \-h
193 Boolean switch for information header on output.
194 .TP
195 .BI -x \ res
196 Set the x resolution to
197 .I res.
198 The output will be flushed after every
199 .I res
200 input rays.
201 A value of zero means that no output flushing will take place.
202 .TP
203 .BI -y \ res
204 Set the y resolution to
205 .I res.
206 The program will exit after
207 .I res
208 scanlines have been processed, where a scanline is the number of rays
209 given by the
210 .I \-x
211 option, or 1 if
212 .I \-x
213 is zero.
214 A value of zero means the program will not halt until the end
215 of file is reached.
216 .IP
217 If both
218 .I \-x
219 and
220 .I \-y
221 options are given, a resolution string is printed at the beginning
222 of the output.
223 This is mostly useful for recovering image dimensions with
224 .I pvalue(1),
225 and for creating valid Radiance picture files using the color output
226 format.
227 (See the
228 .I \-f
229 option, above.)
230 .TP
231 .BI -dj \ frac
232 Set the direct jittering to
233 .I frac.
234 A value of zero samples each source at specific sample points
235 (see the
236 .I \-ds
237 option below), giving a smoother but somewhat less accurate
238 rendering.
239 A positive value causes rays to be distributed over each
240 source sample according to its size, resulting in more accurate
241 penumbras.
242 This option should never be greater than 1, and may even
243 cause problems (such as speckle) when the value is smaller.
244 A warning about aiming failure will issued if
245 .I frac
246 is too large.
247 .TP
248 .BI -ds \ frac
249 Set the direct sampling ratio to
250 .I frac.
251 A light source will be subdivided until
252 the width of each sample area divided by the distance
253 to the illuminated point is below this ratio.
254 This assures accuracy in regions close to large area sources
255 at a slight computational expense.
256 A value of zero turns source subdivision off, sending at most one
257 shadow ray to each light source.
258 .TP
259 .BI -dt \ frac
260 Set the direct threshold to
261 .I frac.
262 Shadow testing will stop when the potential contribution of at least
263 the next and at most all remaining light sources is less than
264 this fraction of the accumulated value.
265 (See the
266 .I \-dc
267 option below.)
268 The remaining light source contributions are approximated
269 statistically.
270 A value of zero means that all light sources will be tested for shadow.
271 .TP
272 .BI \-dc \ frac
273 Set the direct certainty to
274 .I frac.
275 A value of one guarantees that the absolute accuracy of the direct calculation
276 will be equal to or better than that given in the
277 .I \-dt
278 specification.
279 A value of zero only insures that all shadow lines resulting in a contrast
280 change greater than the
281 .I \-dt
282 specification will be calculated.
283 .TP
284 .BI -dr \ N
285 Set the number of relays for secondary sources to
286 .I N.
287 A value of 0 means that secondary sources will be ignored.
288 A value of 1 means that sources will be made into first generation
289 secondary sources; a value of 2 means that first generation
290 secondary sources will also be made into second generation secondary
291 sources, and so on.
292 .TP
293 .BI -dp \ D
294 Set the secondary source presampling density to D.
295 This is the number of samples per steradian
296 that will be used to determine ahead of time whether or not
297 it is worth following shadow rays through all the reflections and/or
298 transmissions associated with a secondary source path.
299 A value of 0 means that the full secondary source path will always
300 be tested for shadows if it is tested at all.
301 .TP
302 .BR \-dv
303 Boolean switch for light source visibility.
304 With this switch off, sources will be black when viewed directly
305 although they will still participate in the direct calculation.
306 This option is mostly for the program
307 .I mkillum(1)
308 to avoid inappropriate counting of light sources, but it
309 may also be desirable in conjunction with the
310 .I \-i
311 option.
312 .TP
313 .BI -sj \ frac
314 Set the specular sampling jitter to
315 .I frac.
316 This is the degree to which the highlights are sampled
317 for rough specular materials.
318 A value of one means that all highlights will be fully sampled
319 using distributed ray tracing.
320 A value of zero means that no jittering will take place, and all
321 reflections will appear sharp even when they should be diffuse.
322 .TP
323 .BI -st \ frac
324 Set the specular sampling threshold to
325 .I frac.
326 This is the minimum fraction of reflection or transmission, under which
327 no specular sampling is performed.
328 A value of zero means that highlights will always be sampled by
329 tracing reflected or transmitted rays.
330 A value of one means that specular sampling is never used.
331 Highlights from light sources will always be correct, but
332 reflections from other surfaces will be approximated using an
333 ambient value.
334 A sampling threshold between zero and one offers a compromise between image
335 accuracy and rendering time.
336 .TP
337 .BR -bv
338 Boolean switch for back face visibility.
339 With this switch off, back faces of opaque objects will be invisible
340 to all rays.
341 This is dangerous unless the model was constructed such that
342 all surface normals on opaque objects face outward.
343 Although turning off back face visibility does not save much
344 computation time under most circumstances, it may be useful as a
345 tool for scene debugging, or for seeing through one-sided walls from
346 the outside.
347 This option has no effect on transparent or translucent materials.
348 .TP
349 .BI -av " red grn blu"
350 Set the ambient value to a radiance of
351 .I "red grn blu".
352 This is the final value used in place of an
353 indirect light calculation.
354 If the number of ambient bounces is one or greater and the ambient
355 value weight is non-zero (see
356 .I -aw
357 and
358 .I -ab
359 below), this value may be modified by the computed indirect values
360 to improve overall accuracy.
361 .TP
362 .BI -aw \ N
363 Set the relative weight of the ambient value given with the
364 .I -av
365 option to
366 .I N.
367 As new indirect irradiances are computed, they will modify the
368 default ambient value in a moving average, with the specified weight
369 assigned to the initial value given on the command and all other
370 weights set to 1.
371 If a value of 0 is given with this option, then the initial ambient
372 value is never modified.
373 This is the safest value for scenes with large differences in
374 indirect contributions, such as when both indoor and outdoor
375 (daylight) areas are visible.
376 .TP
377 .BI -ab \ N
378 Set the number of ambient bounces to
379 .I N.
380 This is the maximum number of diffuse bounces
381 computed by the indirect calculation.
382 A value of zero implies no indirect calculation.
383 .TP
384 .BI -ar \ res
385 Set the ambient resolution to
386 .I res.
387 This number will determine the maximum density of ambient values
388 used in interpolation.
389 Error will start to increase on surfaces spaced closer than
390 the scene size divided by the ambient resolution.
391 The maximum ambient value density is the scene size times the
392 ambient accuracy (see the
393 .I \-aa
394 option below) divided by the ambient resolution.
395 The scene size can be determined using
396 .I getinfo(1)
397 with the
398 .I \-d
399 option on the input octree.
400 .TP
401 .BI -aa \ acc
402 Set the ambient accuracy to
403 .I acc.
404 This value will approximately equal the error
405 from indirect illuminance interpolation.
406 A value of zero implies no interpolation.
407 .TP
408 .BI -ad \ N
409 Set the number of ambient divisions to
410 .I N.
411 The error in the Monte Carlo calculation of indirect
412 illuminance will be inversely proportional to the square
413 root of this number.
414 A value of zero implies no indirect calculation.
415 .TP
416 .BI -as \ N
417 Set the number of ambient super-samples to
418 .I N.
419 Super-samples are applied only to the ambient divisions which
420 show a significant change.
421 .TP
422 .BI -af \ fname
423 Set the ambient file to
424 .I fname.
425 This is where indirect illuminance will be stored and retrieved.
426 Normally, indirect illuminance values are kept in memory and
427 lost when the program finishes or dies.
428 By using a file, different invocations can share illuminance
429 values, saving time in the computation.
430 The ambient file is in a machine-independent binary format
431 which can be examined with
432 .I lookamb(1).
433 .IP
434 The ambient file may also be used as a means of communication and
435 data sharing between simultaneously executing processes.
436 The same file may be used by multiple processes, possibly running on
437 different machines and accessing the file via the network (ie.
438 .I nfs(4)).
439 The network lock manager
440 .I lockd(8)
441 is used to insure that this information is used consistently.
442 .IP
443 If any calculation parameters are changed or the scene
444 is modified, the old ambient file should be removed so that
445 the calculation can start over from scratch.
446 For convenience, the original ambient parameters are listed in the
447 header of the ambient file.
448 .I Getinfo(1)
449 may be used to print out this information.
450 .TP
451 .BI -ae \ mod
452 Append
453 .I mod
454 to the ambient exclude list,
455 so that it will not be considered during the indirect calculation.
456 This is a hack for speeding the indirect computation by
457 ignoring certain objects.
458 Any object having
459 .I mod
460 as its modifier will get the default ambient
461 level rather than a calculated value.
462 Any number of excluded modifiers may be given, but each
463 must appear in a separate option.
464 .TP
465 .BI -ai \ mod
466 Add
467 .I mod
468 to the ambient include list,
469 so that it will be considered during the indirect calculation.
470 The program can use either an include list or an exclude
471 list, but not both.
472 .TP
473 .BI -aE \ file
474 Same as
475 .I \-ae,
476 except read modifiers to be excluded from
477 .I file.
478 The RAYPATH environment variable determines which directories are
479 searched for this file.
480 The modifier names are separated by white space in the file.
481 .TP
482 .BI -aI \ file
483 Same as
484 .I \-ai,
485 except read modifiers to be included from
486 .I file.
487 .TP
488 .BI -me " rext gext bext"
489 Set the global medium extinction coefficient to the indicated color,
490 in units of 1/distance (distance in world coordinates).
491 Light will be scattered or absorbed over distance according to
492 this value.
493 The ratio of scattering to total scattering plus absorption is set
494 by the albedo parameter, described below.
495 .TP
496 .BI -ma " ralb galb balb"
497 Set the global medium albedo to the given value between 0\00\00
498 and 1\01\01.
499 A zero value means that all light not transmitted by the medium
500 is absorbed.
501 A unitary value means that all light not transmitted by the medium
502 is scattered in some new direction.
503 The isotropy of scattering is determined by the Heyney-Greenstein
504 parameter, described below.
505 .TP
506 .BI \-mg \ gecc
507 Set the medium Heyney-Greenstein eccentricity parameter to
508 .I gecc.
509 This parameter determines how strongly scattering favors the forward
510 direction.
511 A value of 0 indicates perfectly isotropic scattering.
512 As this parameter approaches 1, scattering tends to prefer the
513 forward direction.
514 .TP
515 .BI \-ms \ sampdist
516 Set the medium sampling distance to
517 .I sampdist,
518 in world coordinate units.
519 During source scattering, this will be the average distance between
520 adjacent samples.
521 A value of 0 means that only one sample will be taken per light
522 source within a given scattering volume.
523 .TP
524 .BI -lr \ N
525 Limit reflections to a maximum of
526 .I N.
527 If
528 .I N
529 is zero or negative, then Russian roulette is used for ray
530 termination, and the
531 .I -lw
532 setting (below) must be positive.
533 If N is a negative integer, then this sets the upper limit
534 of reflections past which Russian roulette will not be used.
535 In scenes with dielectrics and total internal reflection,
536 a setting of 0 (no limit) may cause a stack overflow.
537 .TP
538 .BI -lw \ frac
539 Limit the weight of each ray to a minimum of
540 .I frac.
541 During ray-tracing, a record is kept of the estimated contribution
542 (weight) a ray would have in the image.
543 If this weight is less than the specified minimum and the
544 .I -lr
545 setting (above) is positive, the ray is not traced.
546 Otherwise, Russian roulette is used to
547 continue rays with a probability equal to the ray weight
548 divided by the given
549 .I frac.
550 .TP
551 .BR -ld
552 Boolean switch to limit ray distance.
553 If this option is set, then rays will only be traced as far as the
554 magnitude of each direction vector.
555 Otherwise, vector magnitude is ignored and rays are traced to infinity.
556 .TP
557 .BI -e \ efile
558 Send error messages and progress reports to
559 .I efile
560 instead of the standard error.
561 .TP
562 .BR \-w
563 Boolean switch to suppress warning messages.
564 .TP
565 .BI \-P \ pfile
566 Execute in a persistent mode, using
567 .I pfile
568 as the control file.
569 Persistent execution means that after reaching end-of-file on
570 its input,
571 .I rtrace
572 will fork a child process that will wait for another
573 .I rtrace
574 command with the same
575 .I \-P
576 option to attach to it.
577 (Note that since the rest of the command line options will be those
578 of the original invocation, it is not necessary to give any arguments
579 besides
580 .I \-P
581 for subsequent calls.)
582 Killing the process is achieved with the
583 .I kill(1)
584 command.
585 (The process ID in the first line of
586 .I pfile
587 may be used to identify the waiting
588 .I rtrace
589 process.)
590 This option may be used with the
591 .I \-fr
592 option of
593 .I pinterp(1)
594 to avoid the cost of starting up
595 .I rtrace
596 many times.
597 .TP
598 .BI \-PP \ pfile
599 Execute in continuous-forking persistent mode, using
600 .I pfile
601 as the control file.
602 The difference between this option and the
603 .I \-P
604 option described above is the creation of multiple duplicate
605 processes to handle any number of attaches.
606 This provides a simple and reliable mechanism of memory sharing
607 on most multiprocessing platforms, since the
608 .I fork(2)
609 system call will share memory on a copy-on-write basis.
610 .SH EXAMPLES
611 To compute radiance values for the rays listed in samples.inp:
612 .IP "" .2i
613 rtrace -ov scene.oct < samples.inp > radiance.out
614 .PP
615 To compute illuminance values at locations selected with the 't'
616 command of
617 .I ximage(1):
618 .IP "" .2i
619 ximage scene.pic | rtrace -h -x 1 -i scene.oct | rcalc -e '$1=47.4*$1+120*$2+11.6*$3'
620 .PP
621 To record the object identifier corresponding to each pixel in an image:
622 .IP "" .2i
623 vwrays -fd scene.pic | rtrace -fda `vwrays -d scene.pic` -os scene.oct
624 .PP
625 To compute an image with an unusual view mapping:
626 .IP "" .2i
627 cnt 640 480 | rcalc -e 'xr:640;yr:480' -f unusual_view.cal | rtrace
628 -x 640 -y 480 -fac scene.oct > unusual.pic
629 .SH ENVIRONMENT
630 RAYPATH the directories to check for auxiliary files.
631 .SH FILES
632 /tmp/rtXXXXXX common header information for picture sequence
633 .SH DIAGNOSTICS
634 If the program terminates from an input related error, the exit status
635 will be 1.
636 A system related error results in an exit status of 2.
637 If the program receives a signal that is caught, it will exit with a status
638 of 3.
639 In each case, an error message will be printed to the standard error, or
640 to the file designated by the
641 .I \-e
642 option.
643 .SH AUTHOR
644 Greg Ward
645 .SH "SEE ALSO"
646 getinfo(1), lookamb(1), oconv(1), pfilt(1), pinterp(1),
647 pvalue(1), rpict(1), rtcontrib(1), rvu(1), vwrays(1), ximage(1)