ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/rmain.c
Revision: 2.28
Committed: Wed Aug 25 13:44:06 1993 UTC (32 years, 4 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.27: +6 -0 lines
Log Message:
added -R option and L and V commands for rview

File Contents

# Content
1 /* Copyright (c) 1993 Regents of the University of California */
2
3 #ifndef lint
4 static char SCCSid[] = "$SunId$ LBL";
5 #endif
6
7 /*
8 * rmain.c - main for ray tracing programs
9 *
10 * 3/24/87
11 */
12
13 /* for flaky pre-processors */
14 #ifndef RPICT
15 #define RPICT 0
16 #endif
17 #ifndef RTRACE
18 #define RTRACE 0
19 #endif
20 #ifndef RVIEW
21 #define RVIEW 0
22 #endif
23
24 #include "ray.h"
25
26 #include "resolu.h"
27
28 #include "octree.h"
29
30 #include <signal.h>
31
32 #include "view.h"
33
34 #include "paths.h"
35 /* persistent processes define */
36 #define NOPERS 0 /* do not persist (must be zero) */
37 #ifdef F_SETLKW
38 #if RPICT|RTRACE
39 #define PERSIST 1 /* normal persist */
40 #define PARALLEL 2 /* parallel persist */
41 #define PCHILD 3 /* child of normal persist */
42 #endif
43 #endif
44
45 char *progname; /* argv[0] */
46
47 char *octname; /* octree name */
48
49 char *libpath; /* library directory list */
50
51 char *sigerr[NSIG]; /* signal error messages */
52
53 extern char VersionID[]; /* version ID string */
54
55 extern int stderr_v(); /* standard error output */
56 int (*errvec)() = stderr_v; /* error output vector */
57 int (*wrnvec)() = stderr_v; /* warning output vector */
58 int (*cmdvec)() = NULL; /* command error vector */
59
60 int (*trace)() = NULL; /* trace call */
61 int do_irrad = 0; /* compute irradiance? */
62
63 extern long time();
64 long tstart; /* start time */
65
66 extern int ambnotify(); /* new object notify functions */
67 #if RTRACE
68 extern int tranotify();
69 int (*addobjnotify[])() = {ambnotify, tranotify, NULL};
70 extern char *tralist[]; /* trace include/exclude list */
71 extern int traincl; /* include == 1, exclude == 0 */
72 #else
73 int (*addobjnotify[])() = {ambnotify, NULL};
74 #endif
75
76 CUBE thescene; /* our scene */
77 OBJECT nsceneobjs; /* number of objects in our scene */
78
79 extern unsigned long raynum, nrays; /* ray counts */
80
81 extern int imm_irrad; /* calculate immediate irradiance? */
82
83 extern int ralrm; /* seconds between reports */
84
85 extern int greyscale; /* map colors to brightness? */
86 extern char *devname; /* output device name */
87
88 extern char *formstr(); /* string from format */
89 extern int inform; /* input format */
90 extern int outform; /* output format */
91 extern char *outvals; /* output values */
92
93 extern VIEW ourview; /* viewing parameters */
94
95 extern char rifname[]; /* rad input file name */
96
97 extern int hresolu; /* horizontal resolution */
98 extern int vresolu; /* vertical resolution */
99 extern double pixaspect; /* pixel aspect ratio */
100
101 extern int psample; /* pixel sample size */
102 extern double maxdiff; /* max. sample difference */
103 extern double dstrpix; /* square pixel distribution */
104
105 extern double dstrsrc; /* square source distribution */
106 extern double shadthresh; /* shadow threshold */
107 extern double shadcert; /* shadow testing certainty */
108 extern int directrelay; /* number of source relays */
109 extern int vspretest; /* virtual source pretest density */
110 extern int directvis; /* light sources visible to eye? */
111 extern double srcsizerat; /* maximum source size/dist. ratio */
112
113 extern double specthresh; /* specular sampling threshold */
114 extern double specjitter; /* specular sampling jitter */
115
116 extern int maxdepth; /* maximum recursion depth */
117 extern double minweight; /* minimum ray weight */
118
119 extern COLOR ambval; /* ambient value */
120 extern double ambacc; /* ambient accuracy */
121 extern int ambres; /* ambient resolution */
122 extern int ambdiv; /* ambient divisions */
123 extern int ambssamp; /* ambient super-samples */
124 extern int ambounce; /* ambient bounces */
125 extern char *amblist[]; /* ambient include/exclude list */
126 extern int ambincl; /* include == 1, exclude == 0 */
127
128
129 main(argc, argv)
130 int argc;
131 char *argv[];
132 {
133 #define check(ol,al) if (argv[i][ol] || \
134 badarg(argc-i-1,argv+i+1,al)) \
135 goto badopt
136 #define bool(olen,var) switch (argv[i][olen]) { \
137 case '\0': var = !var; break; \
138 case 'y': case 'Y': case 't': case 'T': \
139 case '+': case '1': var = 1; break; \
140 case 'n': case 'N': case 'f': case 'F': \
141 case '-': case '0': var = 0; break; \
142 default: goto badopt; }
143 char *err;
144 char *recover = NULL;
145 char *outfile = NULL;
146 char *zfile = NULL;
147 char *errfile = NULL;
148 char *ambfile = NULL;
149 int loadflags = ~IO_FILES;
150 int seqstart = 0;
151 int persist = NOPERS;
152 char **amblp;
153 char **tralp;
154 int duped1;
155 int rval;
156 int i;
157 /* record start time */
158 tstart = time((long *)0);
159 /* global program name */
160 progname = argv[0] = fixargv0(argv[0]);
161 /* get library path */
162 if ((libpath = getenv(ULIBVAR)) == NULL)
163 libpath = DEFPATH;
164 /* initialize object types */
165 initotypes();
166 /* initialize urand */
167 initurand(2048);
168 /* option city */
169 for (i = 1; i < argc; i++) {
170 /* expand arguments */
171 while (rval = expandarg(&argc, &argv, i))
172 if (rval < 0) {
173 sprintf(errmsg, "cannot expand '%s'", argv[i]);
174 error(SYSTEM, errmsg);
175 }
176 if (argv[i] == NULL || argv[i][0] != '-')
177 break; /* break from options */
178 if (!strcmp(argv[i], "-version")) {
179 puts(VersionID);
180 quit(0);
181 }
182 if (!strcmp(argv[i], "-defaults") ||
183 !strcmp(argv[i], "-help")) {
184 printdefaults();
185 quit(0);
186 }
187 #if RVIEW
188 if (!strcmp(argv[i], "-devices")) {
189 printdevices();
190 quit(0);
191 }
192 #endif
193 #if RPICT|RVIEW
194 rval = getviewopt(&ourview, argc-i, argv+i);
195 if (rval >= 0) {
196 i += rval;
197 continue;
198 }
199 #endif
200 switch (argv[i][1]) {
201 #if RPICT|RVIEW
202 case 'v': /* view file */
203 if (argv[i][2] != 'f')
204 goto badopt;
205 check(3,"s");
206 rval = viewfile(argv[++i], &ourview, NULL);
207 if (rval < 0) {
208 sprintf(errmsg,
209 "cannot open view file \"%s\"",
210 argv[i]);
211 error(SYSTEM, errmsg);
212 } else if (rval == 0) {
213 sprintf(errmsg,
214 "bad view file \"%s\"",
215 argv[i]);
216 error(USER, errmsg);
217 }
218 break;
219 #endif
220 case 'd': /* direct */
221 switch (argv[i][2]) {
222 case 't': /* threshold */
223 check(3,"f");
224 shadthresh = atof(argv[++i]);
225 break;
226 case 'c': /* certainty */
227 check(3,"f");
228 shadcert = atof(argv[++i]);
229 break;
230 case 'j': /* jitter */
231 check(3,"f");
232 dstrsrc = atof(argv[++i]);
233 break;
234 case 'r': /* relays */
235 check(3,"i");
236 directrelay = atoi(argv[++i]);
237 break;
238 case 'p': /* pretest */
239 check(3,"i");
240 vspretest = atoi(argv[++i]);
241 break;
242 case 'v': /* visibility */
243 bool(3,directvis);
244 break;
245 case 's': /* size */
246 check(3,"f");
247 srcsizerat = atof(argv[++i]);
248 break;
249 default:
250 goto badopt;
251 }
252 break;
253 case 's': /* specular */
254 switch (argv[i][2]) {
255 case 't': /* threshold */
256 check(3,"f");
257 specthresh = atof(argv[++i]);
258 break;
259 case 'j': /* jitter */
260 check(3,"f");
261 specjitter = atof(argv[++i]);
262 break;
263 default:
264 goto badopt;
265 }
266 break;
267 #if RPICT|RVIEW
268 case 'p': /* pixel */
269 switch (argv[i][2]) {
270 case 's': /* sample */
271 check(3,"i");
272 psample = atoi(argv[++i]);
273 break;
274 case 't': /* threshold */
275 check(3,"f");
276 maxdiff = atof(argv[++i]);
277 break;
278 #if RPICT
279 case 'j': /* jitter */
280 check(3,"f");
281 dstrpix = atof(argv[++i]);
282 break;
283 case 'a': /* aspect */
284 check(3,"f");
285 pixaspect = atof(argv[++i]);
286 break;
287 #endif
288 default:
289 goto badopt;
290 }
291 break;
292 #endif
293 #if RPICT|RTRACE
294 case 'x': /* x resolution */
295 check(2,"i");
296 hresolu = atoi(argv[++i]);
297 break;
298 case 'y': /* y resolution */
299 check(2,"i");
300 vresolu = atoi(argv[++i]);
301 break;
302 #endif
303 case 'w': /* warnings */
304 rval = wrnvec != NULL;
305 bool(2,rval);
306 if (rval) wrnvec = stderr_v;
307 else wrnvec = NULL;
308 break;
309 case 'e': /* error file */
310 check(2,"s");
311 errfile = argv[++i];
312 break;
313 case 'l': /* limit */
314 switch (argv[i][2]) {
315 case 'r': /* recursion */
316 check(3,"i");
317 maxdepth = atoi(argv[++i]);
318 break;
319 case 'w': /* weight */
320 check(3,"f");
321 minweight = atof(argv[++i]);
322 break;
323 default:
324 goto badopt;
325 }
326 break;
327 case 'i': /* irradiance */
328 bool(2,do_irrad);
329 break;
330 #if RPICT
331 case 'S': /* slave index */
332 check(2,"i");
333 seqstart = atoi(argv[++i]);
334 break;
335 case 'o': /* output file */
336 check(2,"s");
337 outfile = argv[++i];
338 break;
339 case 'z': /* z file */
340 check(2,"s");
341 zfile = argv[++i];
342 break;
343 case 'r': /* recover file */
344 if (argv[i][2] == 'o') { /* +output */
345 check(3,"s");
346 outfile = argv[i+1];
347 } else
348 check(2,"s");
349 recover = argv[++i];
350 break;
351 case 't': /* timer */
352 check(2,"i");
353 ralrm = atoi(argv[++i]);
354 break;
355 #endif
356 case 'a': /* ambient */
357 switch (argv[i][2]) {
358 case 'v': /* value */
359 check(3,"fff");
360 setcolor(ambval, atof(argv[i+1]),
361 atof(argv[i+2]),
362 atof(argv[i+3]));
363 i += 3;
364 break;
365 case 'a': /* accuracy */
366 check(3,"f");
367 ambacc = atof(argv[++i]);
368 break;
369 case 'r': /* resolution */
370 check(3,"i");
371 ambres = atoi(argv[++i]);
372 break;
373 case 'd': /* divisions */
374 check(3,"i");
375 ambdiv = atoi(argv[++i]);
376 break;
377 case 's': /* super-samp */
378 check(3,"i");
379 ambssamp = atoi(argv[++i]);
380 break;
381 case 'b': /* bounces */
382 check(3,"i");
383 ambounce = atoi(argv[++i]);
384 break;
385 case 'i': /* include */
386 case 'I':
387 check(3,"s");
388 if (ambincl != 1) {
389 ambincl = 1;
390 amblp = amblist;
391 }
392 if (argv[i][2] == 'I') { /* file */
393 rval = wordfile(amblp,
394 getpath(argv[++i],libpath,R_OK));
395 if (rval < 0) {
396 sprintf(errmsg,
397 "cannot open ambient include file \"%s\"",
398 argv[i]);
399 error(SYSTEM, errmsg);
400 }
401 amblp += rval;
402 } else {
403 *amblp++ = argv[++i];
404 *amblp = NULL;
405 }
406 break;
407 case 'e': /* exclude */
408 case 'E':
409 check(3,"s");
410 if (ambincl != 0) {
411 ambincl = 0;
412 amblp = amblist;
413 }
414 if (argv[i][2] == 'E') { /* file */
415 rval = wordfile(amblp,
416 getpath(argv[++i],libpath,R_OK));
417 if (rval < 0) {
418 sprintf(errmsg,
419 "cannot open ambient exclude file \"%s\"",
420 argv[i]);
421 error(SYSTEM, errmsg);
422 }
423 amblp += rval;
424 } else {
425 *amblp++ = argv[++i];
426 *amblp = NULL;
427 }
428 break;
429 case 'f': /* file */
430 check(3,"s");
431 ambfile= argv[++i];
432 break;
433 default:
434 goto badopt;
435 }
436 break;
437 #if RTRACE
438 case 'I': /* immed. irradiance */
439 bool(2,imm_irrad);
440 break;
441 case 'f': /* format i/o */
442 switch (argv[i][2]) {
443 case 'a': /* ascii */
444 case 'f': /* float */
445 case 'd': /* double */
446 inform = argv[i][2];
447 break;
448 default:
449 goto badopt;
450 }
451 switch (argv[i][3]) {
452 case '\0':
453 outform = inform;
454 break;
455 case 'a': /* ascii */
456 case 'f': /* float */
457 case 'd': /* double */
458 case 'c': /* color */
459 check(4,"");
460 outform = argv[i][3];
461 break;
462 default:
463 goto badopt;
464 }
465 break;
466 case 'o': /* output */
467 outvals = argv[i]+2;
468 break;
469 case 'h': /* header output */
470 rval = loadflags & IO_INFO;
471 bool(2,rval);
472 loadflags = rval ? loadflags | IO_INFO :
473 loadflags & ~IO_INFO;
474 break;
475 case 't': /* trace */
476 switch (argv[i][2]) {
477 case 'i': /* include */
478 case 'I':
479 check(3,"s");
480 if (traincl != 1) {
481 traincl = 1;
482 tralp = tralist;
483 }
484 if (argv[i][2] == 'I') { /* file */
485 rval = wordfile(tralp,
486 getpath(argv[++i],libpath,R_OK));
487 if (rval < 0) {
488 sprintf(errmsg,
489 "cannot open trace include file \"%s\"",
490 argv[i]);
491 error(SYSTEM, errmsg);
492 }
493 tralp += rval;
494 } else {
495 *tralp++ = argv[++i];
496 *tralp = NULL;
497 }
498 break;
499 case 'e': /* exclude */
500 case 'E':
501 check(3,"s");
502 if (traincl != 0) {
503 traincl = 0;
504 tralp = tralist;
505 }
506 if (argv[i][2] == 'E') { /* file */
507 rval = wordfile(tralp,
508 getpath(argv[++i],libpath,R_OK));
509 if (rval < 0) {
510 sprintf(errmsg,
511 "cannot open trace exclude file \"%s\"",
512 argv[i]);
513 error(SYSTEM, errmsg);
514 }
515 tralp += rval;
516 } else {
517 *tralp++ = argv[++i];
518 *tralp = NULL;
519 }
520 break;
521 default:
522 goto badopt;
523 }
524 break;
525 #endif
526 #if RVIEW
527 case 'b': /* black and white */
528 bool(2,greyscale);
529 break;
530 case 'o': /* output device */
531 check(2,"s");
532 devname = argv[++i];
533 break;
534 case 'R': /* render input file */
535 check(2,"s");
536 strcpy(rifname, argv[++i]);
537 break;
538 #endif
539 #ifdef PERSIST
540 case 'P': /* persist file */
541 if (argv[i][2] == 'P') {
542 check(3,"s");
543 persist = PARALLEL;
544 } else {
545 check(2,"s");
546 persist = PERSIST;
547 }
548 persistfile(argv[++i]);
549 break;
550 #endif
551 default:
552 goto badopt;
553 }
554 }
555 #if RPICT|RVIEW
556 err = setview(&ourview); /* set viewing parameters */
557 if (err != NULL)
558 error(USER, err);
559 #endif
560 /* set up signal handling */
561 sigdie(SIGINT, "Interrupt");
562 sigdie(SIGHUP, "Hangup");
563 sigdie(SIGTERM, "Terminate");
564 sigdie(SIGPIPE, "Broken pipe");
565 sigdie(SIGALRM, "Alarm clock");
566 #ifdef SIGXCPU
567 sigdie(SIGXCPU, "CPU limit exceeded");
568 sigdie(SIGXFSZ, "File size exceeded");
569 #endif
570 /* open error file */
571 if (errfile != NULL) {
572 if (freopen(errfile, "a", stderr) == NULL)
573 quit(2);
574 fprintf(stderr, "**************\n*** PID %5d: ",
575 getpid());
576 printargs(argc, argv, stderr);
577 putc('\n', stderr);
578 fflush(stderr);
579 }
580 #ifdef NICE
581 nice(NICE); /* lower priority */
582 #endif
583 /* get octree */
584 #if RVIEW
585 loadflags &= ~IO_INFO;
586 #endif
587 if (i == argc)
588 octname = NULL;
589 else if (i == argc-1)
590 octname = argv[i];
591 else
592 goto badopt;
593 if (
594 #if RPICT
595 seqstart > 0 &&
596 #endif
597 octname == NULL)
598 error(USER, "missing octree argument");
599 /* set up output */
600 #ifdef PERSIST
601 if (persist) {
602 #if RPICT
603 if (recover != NULL)
604 error(USER, "persist option used with recover file");
605 if (seqstart <= 0)
606 error(USER, "persist option only for sequences");
607 if (outfile == NULL)
608 #endif
609 duped1 = dup(fileno(stdout)); /* don't lose our output */
610 openheader();
611 }
612 #if RPICT
613 else
614 #endif
615 #endif
616 #if RPICT
617 if (outfile != NULL)
618 openheader();
619 #endif
620 #ifdef MSDOS
621 #if RTRACE
622 if (outform != 'a')
623 #endif
624 setmode(fileno(stdout), O_BINARY);
625 if (octname == NULL)
626 setmode(fileno(stdin), O_BINARY);
627 #endif
628 readoct(octname, loadflags, &thescene, NULL);
629 nsceneobjs = nobjects;
630
631 if (loadflags & IO_INFO) { /* print header */
632 printargs(i, argv, stdout);
633 printf("SOFTWARE= %s\n", VersionID);
634 #if RTRACE
635 fputformat(formstr(outform), stdout);
636 putchar('\n');
637 #endif
638 }
639
640 marksources(); /* find and mark sources */
641
642 setambient(ambfile); /* initialize ambient calculation */
643
644 #ifdef PERSIST
645 if (persist) {
646 fflush(stdout);
647 if (outfile == NULL) { /* reconnect stdout */
648 dup2(duped1, fileno(stdout));
649 close(duped1);
650 }
651 if (persist == PARALLEL) { /* multiprocessing */
652 preload_objs(); /* preload scene */
653 while ((rval=fork()) == 0) { /* keep on forkin' */
654 pflock(1);
655 pfhold();
656 tstart = time(0);
657 }
658 if (rval < 0)
659 error(SYSTEM, "cannot fork child for persist function");
660 pfdetach(); /* parent exits */
661 }
662 }
663 runagain:
664 if (persist)
665 if (outfile == NULL) /* if out to stdout */
666 dupheader(); /* send header */
667 else /* if out to file */
668 duped1 = dup(fileno(stdout)); /* hang onto pipe */
669 #endif
670 #if RPICT
671 rpict(seqstart, outfile, zfile, recover);
672 #endif
673 #if RTRACE
674 rtrace(NULL);
675 #endif
676 #if RVIEW
677 rview();
678 #endif
679 ambsync(); /* flush ambient file */
680 #ifdef PERSIST
681 if (persist == PERSIST) { /* first run-through */
682 if ((rval=fork()) == 0) { /* child loops until killed */
683 pflock(1);
684 persist = PCHILD;
685 } else { /* original process exits */
686 if (rval < 0)
687 error(SYSTEM, "cannot fork child for persist function");
688 pfdetach(); /* parent exits */
689 }
690 }
691 if (persist == PCHILD) { /* wait for a signal then go again */
692 if (outfile != NULL)
693 close(duped1); /* release output handle */
694 pfhold();
695 tstart = time(0); /* reinitialize counters */
696 raynum = nrays = 0;
697 goto runagain;
698 }
699 #endif
700 quit(0);
701
702 badopt:
703 sprintf(errmsg, "command line error at '%s'", argv[i]);
704 error(USER, errmsg);
705
706 #undef check
707 #undef bool
708 }
709
710
711 eputs(s) /* error output */
712 char *s;
713 {
714 if (errvec != NULL)
715 (*errvec)(s);
716 }
717
718
719 wputs(s) /* warning output */
720 char *s;
721 {
722 int lasterrno = errno; /* save errno */
723
724 if (wrnvec != NULL)
725 (*wrnvec)(s);
726
727 errno = lasterrno;
728 }
729
730
731 cputs(s) /* command error output */
732 char *s;
733 {
734 if (cmdvec != NULL)
735 (*cmdvec)(s);
736 }
737
738
739 stderr_v(s) /* put string to stderr */
740 register char *s;
741 {
742 static int midline = 0;
743
744 if (!*s)
745 return;
746 if (!midline++) {
747 fputs(progname, stderr);
748 fputs(": ", stderr);
749 }
750 fputs(s, stderr);
751 if (s[strlen(s)-1] == '\n') {
752 fflush(stderr);
753 midline = 0;
754 }
755 }
756
757
758 onsig(signo) /* fatal signal */
759 int signo;
760 {
761 static int gotsig = 0;
762
763 if (gotsig++) /* two signals and we're gone! */
764 _exit(signo);
765
766 alarm(15); /* allow 15 seconds to clean up */
767 signal(SIGALRM, SIG_DFL); /* make certain we do die */
768 eputs("signal - ");
769 eputs(sigerr[signo]);
770 eputs("\n");
771 quit(3);
772 }
773
774
775 sigdie(signo, msg) /* set fatal signal */
776 int signo;
777 char *msg;
778 {
779 if (signal(signo, onsig) == SIG_IGN)
780 signal(signo, SIG_IGN);
781 sigerr[signo] = msg;
782 }
783
784
785 printdefaults() /* print default values to stdout */
786 {
787 register char *cp;
788
789 #if RTRACE
790 if (imm_irrad)
791 printf("-I+\t\t\t\t# immediate irradiance on\n");
792 else
793 #endif
794 printf(do_irrad ? "-i+\t\t\t\t# irradiance calculation on\n" :
795 "-i-\t\t\t\t# irradiance calculation off\n");
796 #if RVIEW
797 printf(greyscale ? "-b+\t\t\t\t# greyscale on\n" :
798 "-b-\t\t\t\t# greyscale off\n");
799 #endif
800 #if RPICT|RVIEW
801 printf("-vt%c\t\t\t\t# view type %s\n", ourview.type,
802 ourview.type==VT_PER ? "perspective" :
803 ourview.type==VT_PAR ? "parallel" :
804 ourview.type==VT_HEM ? "hemispherical" :
805 ourview.type==VT_ANG ? "angular" :
806 "unknown");
807 printf("-vp %f %f %f\t# view point\n",
808 ourview.vp[0], ourview.vp[1], ourview.vp[2]);
809 printf("-vd %f %f %f\t# view direction\n",
810 ourview.vdir[0], ourview.vdir[1], ourview.vdir[2]);
811 printf("-vu %f %f %f\t# view up\n",
812 ourview.vup[0], ourview.vup[1], ourview.vup[2]);
813 printf("-vh %f\t\t\t# view horizontal size\n", ourview.horiz);
814 printf("-vv %f\t\t\t# view vertical size\n", ourview.vert);
815 printf("-vs %f\t\t\t# view shift\n", ourview.hoff);
816 printf("-vl %f\t\t\t# view lift\n", ourview.voff);
817 #endif
818 #if RPICT|RTRACE
819 printf("-x %-9d\t\t\t# x resolution\n", hresolu);
820 printf("-y %-9d\t\t\t# y resolution\n", vresolu);
821 #endif
822 #if RPICT
823 printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect);
824 printf("-pj %f\t\t\t# pixel jitter\n", dstrpix);
825 #endif
826 #if RPICT|RVIEW
827 printf("-ps %-9d\t\t\t# pixel sample\n", psample);
828 printf("-pt %f\t\t\t# pixel threshold\n", maxdiff);
829 #endif
830 printf("-dt %f\t\t\t# direct threshold\n", shadthresh);
831 printf("-dc %f\t\t\t# direct certainty\n", shadcert);
832 printf("-dj %f\t\t\t# direct jitter\n", dstrsrc);
833 printf("-ds %f\t\t\t# direct sampling\n", srcsizerat);
834 printf("-dr %-9d\t\t\t# direct relays\n", directrelay);
835 printf("-dp %-9d\t\t\t# direct pretest density\n", vspretest);
836 printf(directvis ? "-dv+\t\t\t\t# direct visibility on\n" :
837 "-dv-\t\t\t\t# direct visibility off\n");
838 printf("-sj %f\t\t\t# specular jitter\n", specjitter);
839 printf("-st %f\t\t\t# specular threshold\n", specthresh);
840 printf("-av %f %f %f\t# ambient value\n", colval(ambval,RED),
841 colval(ambval,GRN), colval(ambval, BLU));
842 printf("-ab %-9d\t\t\t# ambient bounces\n", ambounce);
843 printf("-aa %f\t\t\t# ambient accuracy\n", ambacc);
844 printf("-ar %-9d\t\t\t# ambient resolution\n", ambres);
845 printf("-ad %-9d\t\t\t# ambient divisions\n", ambdiv);
846 printf("-as %-9d\t\t\t# ambient super-samples\n", ambssamp);
847 printf("-lr %-9d\t\t\t# limit reflection\n", maxdepth);
848 printf("-lw %f\t\t\t# limit weight\n", minweight);
849 #if RPICT
850 printf("-t %-9d\t\t\t# time between reports\n", ralrm);
851 #endif
852 #if RVIEW
853 printf("-o %s\t\t\t\t# output device\n", devname);
854 #endif
855 #if RTRACE
856 printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
857 inform, outform, formstr(inform), formstr(outform));
858 printf("-o%s\t\t\t\t# output", outvals);
859 for (cp = outvals; *cp; cp++)
860 switch (*cp) {
861 case 't': printf(" trace"); break;
862 case 'o': printf(" origin"); break;
863 case 'd': printf(" direction"); break;
864 case 'v': printf(" value"); break;
865 case 'l': printf(" length"); break;
866 case 'L': printf(" first_length"); break;
867 case 'p': printf(" point"); break;
868 case 'n': printf(" normal"); break;
869 case 'N': printf(" unperturbed_normal"); break;
870 case 's': printf(" surface"); break;
871 case 'w': printf(" weight"); break;
872 case 'm': printf(" modifier"); break;
873 }
874 putchar('\n');
875 #endif
876 printf(wrnvec != NULL ? "-w+\t\t\t\t# warning messages on\n" :
877 "-w-\t\t\t\t# warning messages off\n");
878 }