ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/man/man1/rtrace.1
Revision: 1.4
Committed: Thu Jan 1 19:31:45 2004 UTC (20 years, 4 months ago) by greg
Branch: MAIN
CVS Tags: rad3R6, rad3R6P1
Changes since 1.3: +2 -2 lines
Log Message:
Renamed rview, lam, calc, and neat to rvu, rlam, icalc, and neaten

File Contents

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