ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rmain.c
Revision: 2.8
Committed: Tue Jul 21 10:36:39 1992 UTC (32 years, 9 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.7: +7 -3 lines
Log Message:
fixed bug introduced in last change with -h- option of rtrace

File Contents

# User Rev Content
1 greg 2.7 /* Copyright (c) 1992 Regents of the University of California */
2 greg 1.1
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 greg 1.50 #include "resolu.h"
27    
28 greg 1.1 #include "octree.h"
29    
30     #include <signal.h>
31    
32     #include "view.h"
33    
34     #ifndef DEFPATH
35     #define DEFPATH ":/usr/local/lib/ray"
36     #endif
37 greg 1.17 #ifndef ULIBVAR
38 greg 1.1 #define ULIBVAR "RAYPATH"
39 greg 1.17 #endif
40 greg 1.1
41     char *progname; /* argv[0] */
42    
43 greg 1.19 char *octname; /* octree name */
44    
45 greg 1.1 char *libpath; /* library directory list */
46    
47     char *sigerr[NSIG]; /* signal error messages */
48    
49 greg 1.46 extern char VersionID[]; /* version ID string */
50    
51 greg 1.1 extern int stderr_v(); /* standard error output */
52     int (*errvec)() = stderr_v; /* error output vector */
53     int (*wrnvec)() = stderr_v; /* warning output vector */
54     int (*cmdvec)() = NULL; /* command error vector */
55    
56     int (*trace)() = NULL; /* trace call */
57 greg 1.36 int do_irrad = 0; /* compute irradiance? */
58 greg 1.1
59 greg 1.34 extern long time();
60     long tstart; /* start time */
61    
62 greg 1.24 extern int ambnotify(); /* new object notify functions */
63     int (*addobjnotify[])() = {ambnotify, NULL};
64    
65 greg 1.1 CUBE thescene; /* our scene */
66    
67 greg 1.36 extern int imm_irrad; /* calculate immediate irradiance? */
68    
69 greg 1.1 extern int ralrm; /* seconds between reports */
70    
71     extern int greyscale; /* map colors to brightness? */
72     extern char *devname; /* output device name */
73    
74 greg 2.8 extern char *formstr(); /* string from format */
75 greg 1.1 extern int inform; /* input format */
76     extern int outform; /* output format */
77     extern char *outvals; /* output values */
78    
79     extern VIEW ourview; /* viewing parameters */
80    
81     extern int hresolu; /* horizontal resolution */
82     extern int vresolu; /* vertical resolution */
83 greg 1.22 extern double pixaspect; /* pixel aspect ratio */
84 greg 1.1
85     extern int psample; /* pixel sample size */
86     extern double maxdiff; /* max. sample difference */
87 greg 1.11 extern double dstrpix; /* square pixel distribution */
88 greg 1.1
89     extern double dstrsrc; /* square source distribution */
90 greg 1.11 extern double shadthresh; /* shadow threshold */
91 greg 1.15 extern double shadcert; /* shadow testing certainty */
92 greg 1.39 extern int directrelay; /* number of source relays */
93 greg 1.40 extern int vspretest; /* virtual source pretest density */
94 greg 1.42 extern int directinvis; /* light sources invisible to eye? */
95 greg 1.47 extern double srcsizerat; /* maximum source size/dist. ratio */
96 greg 1.1
97 greg 2.4 extern double specthresh; /* specular sampling threshold */
98     extern double specjitter; /* specular sampling jitter */
99    
100 greg 1.1 extern int maxdepth; /* maximum recursion depth */
101     extern double minweight; /* minimum ray weight */
102    
103     extern COLOR ambval; /* ambient value */
104     extern double ambacc; /* ambient accuracy */
105     extern int ambres; /* ambient resolution */
106     extern int ambdiv; /* ambient divisions */
107     extern int ambssamp; /* ambient super-samples */
108     extern int ambounce; /* ambient bounces */
109     extern char *amblist[]; /* ambient include/exclude list */
110     extern int ambincl; /* include == 1, exclude == 0 */
111    
112    
113     main(argc, argv)
114     int argc;
115     char *argv[];
116     {
117 greg 1.49 #define check(ol,al) if (argv[i][ol] || \
118     badarg(argc-i-1,argv+i+1,al)) \
119     goto badopt
120 greg 1.43 #define bool(olen,var) switch (argv[i][olen]) { \
121     case '\0': var = !var; break; \
122     case 'y': case 'Y': case 't': case 'T': \
123     case '+': case '1': var = 1; break; \
124     case 'n': case 'N': case 'f': case 'F': \
125     case '-': case '0': var = 0; break; \
126     default: goto badopt; }
127 greg 1.45 extern char *getenv();
128 greg 1.1 char *err;
129     char *recover = NULL;
130 greg 2.7 char *outfile = NULL;
131 greg 1.20 char *zfile = NULL;
132 greg 1.1 char *errfile = NULL;
133     char *ambfile = NULL;
134     char **amblp = amblist;
135     int loadflags = ~IO_FILES;
136 greg 2.7 int seqstart = 0;
137     int rval;
138 greg 1.1 int i;
139 greg 1.34 /* record start time */
140     tstart = time((long *)0);
141 greg 1.1 /* global program name */
142     progname = argv[0];
143     /* get library path */
144     if ((libpath = getenv(ULIBVAR)) == NULL)
145     libpath = DEFPATH;
146 greg 1.31 /* initialize object types */
147     initotypes();
148 greg 1.37 /* initialize urand */
149 greg 1.41 initurand(2048);
150 greg 1.10 /* option city */
151 greg 1.1 for (i = 1; i < argc && argv[i][0] == '-'; i++) {
152 greg 1.46 if (!strcmp(argv[i], "-version")) {
153     puts(VersionID);
154     quit(0);
155     }
156 greg 1.18 if (!strcmp(argv[i], "-defaults") ||
157     !strcmp(argv[i], "-help")) {
158 greg 1.1 printdefaults();
159     quit(0);
160     }
161     #if RVIEW
162     if (!strcmp(argv[i], "-devices")) {
163     printdevices();
164     quit(0);
165     }
166     #endif
167 greg 1.21 #if RPICT|RVIEW
168     rval = getviewopt(&ourview, argc-i, argv+i);
169     if (rval >= 0) {
170     i += rval;
171     continue;
172     }
173     #endif
174 greg 1.1 switch (argv[i][1]) {
175     #if RPICT|RVIEW
176 greg 1.21 case 'v': /* view file */
177     if (argv[i][2] != 'f')
178 greg 1.10 goto badopt;
179 greg 1.49 check(3,"s");
180 greg 1.50 rval = viewfile(argv[++i], &ourview, NULL);
181 greg 1.21 if (rval < 0) {
182     sprintf(errmsg,
183     "cannot open view file \"%s\"",
184     argv[i]);
185     error(SYSTEM, errmsg);
186     } else if (rval == 0) {
187     sprintf(errmsg,
188     "bad view file \"%s\"",
189     argv[i]);
190     error(USER, errmsg);
191 greg 2.7 }
192 greg 1.1 break;
193     #endif
194 greg 1.11 case 'd': /* direct */
195 greg 1.1 switch (argv[i][2]) {
196 greg 1.13 case 't': /* threshold */
197 greg 1.49 check(3,"f");
198 greg 1.11 shadthresh = atof(argv[++i]);
199 greg 1.1 break;
200 greg 1.15 case 'c': /* certainty */
201 greg 1.49 check(3,"f");
202 greg 1.15 shadcert = atof(argv[++i]);
203     break;
204 greg 1.11 case 'j': /* jitter */
205 greg 1.49 check(3,"f");
206 greg 1.1 dstrsrc = atof(argv[++i]);
207     break;
208 greg 1.47 case 'r': /* relays */
209 greg 1.49 check(3,"i");
210 greg 1.39 directrelay = atoi(argv[++i]);
211     break;
212 greg 1.47 case 'p': /* pretest */
213 greg 1.49 check(3,"i");
214 greg 1.40 vspretest = atoi(argv[++i]);
215 greg 1.42 break;
216 greg 1.47 case 'i': /* invis. */
217 greg 1.43 bool(3,directinvis);
218 greg 1.40 break;
219 greg 1.47 case 's': /* size */
220 greg 1.49 check(3,"f");
221 greg 1.47 srcsizerat = atof(argv[++i]);
222     break;
223 greg 1.1 default:
224 greg 1.10 goto badopt;
225 greg 1.1 }
226     break;
227 greg 2.4 case 's': /* specular */
228     switch (argv[i][2]) {
229     case 't': /* threshold */
230     check(3,"f");
231     specthresh = atof(argv[++i]);
232     break;
233     case 'j': /* jitter */
234     check(3,"f");
235     specjitter = atof(argv[++i]);
236     break;
237     default:
238     goto badopt;
239     }
240     break;
241 greg 1.1 #if RPICT|RVIEW
242 greg 2.4 case 'p': /* pixel */
243 greg 1.1 switch (argv[i][2]) {
244 greg 2.4 case 's': /* sample */
245 greg 1.49 check(3,"i");
246 greg 1.1 psample = atoi(argv[++i]);
247     break;
248 greg 1.13 case 't': /* threshold */
249 greg 1.49 check(3,"f");
250 greg 1.1 maxdiff = atof(argv[++i]);
251     break;
252 greg 1.11 #if RPICT
253     case 'j': /* jitter */
254 greg 1.49 check(3,"f");
255 greg 1.11 dstrpix = atof(argv[++i]);
256     break;
257 greg 2.4 case 'a': /* aspect */
258     check(3,"f");
259     pixaspect = atof(argv[++i]);
260     break;
261 greg 1.11 #endif
262 greg 1.1 default:
263 greg 1.10 goto badopt;
264 greg 1.1 }
265     break;
266     #endif
267 greg 1.22 #if RPICT|RTRACE
268 greg 1.1 case 'x': /* x resolution */
269 greg 1.49 check(2,"i");
270 greg 1.1 hresolu = atoi(argv[++i]);
271     break;
272     case 'y': /* y resolution */
273 greg 1.49 check(2,"i");
274 greg 1.1 vresolu = atoi(argv[++i]);
275     break;
276 greg 1.22 #endif
277 greg 1.1 case 'w': /* warnings */
278 greg 1.43 rval = wrnvec != NULL;
279     bool(2,rval);
280 greg 2.6 if (rval) wrnvec = stderr_v;
281     else wrnvec = NULL;
282 greg 1.1 break;
283     case 'e': /* error file */
284 greg 1.49 check(2,"s");
285 greg 1.1 errfile = argv[++i];
286     break;
287     case 'l': /* limit */
288     switch (argv[i][2]) {
289     case 'r': /* recursion */
290 greg 1.49 check(3,"i");
291 greg 1.1 maxdepth = atoi(argv[++i]);
292     break;
293     case 'w': /* weight */
294 greg 1.49 check(3,"f");
295 greg 1.1 minweight = atof(argv[++i]);
296     break;
297     default:
298 greg 1.10 goto badopt;
299 greg 1.1 }
300     break;
301 greg 1.36 case 'i': /* irradiance */
302 greg 1.43 bool(2,do_irrad);
303 greg 1.36 break;
304 greg 1.1 #if RPICT
305 greg 2.7 case 'S': /* slave index */
306     check(2,"i");
307     seqstart = atoi(argv[++i]);
308     break;
309     case 'o': /* output file */
310     check(2,"s");
311     outfile = argv[++i];
312     break;
313 greg 1.20 case 'z': /* z file */
314 greg 1.49 check(2,"s");
315 greg 1.20 zfile = argv[++i];
316     break;
317 greg 1.1 case 'r': /* recover file */
318 greg 1.49 check(2,"s");
319 greg 1.1 recover = argv[++i];
320     break;
321     case 't': /* timer */
322 greg 1.49 check(2,"i");
323 greg 1.1 ralrm = atoi(argv[++i]);
324     break;
325     #endif
326     case 'a': /* ambient */
327     switch (argv[i][2]) {
328     case 'v': /* value */
329 greg 1.49 check(3,"fff");
330 greg 1.1 setcolor(ambval, atof(argv[i+1]),
331     atof(argv[i+2]),
332     atof(argv[i+3]));
333     i += 3;
334     break;
335     case 'a': /* accuracy */
336 greg 1.49 check(3,"f");
337 greg 1.1 ambacc = atof(argv[++i]);
338     break;
339     case 'r': /* resolution */
340 greg 1.49 check(3,"i");
341 greg 1.1 ambres = atoi(argv[++i]);
342     break;
343     case 'd': /* divisions */
344 greg 1.49 check(3,"i");
345 greg 1.1 ambdiv = atoi(argv[++i]);
346     break;
347     case 's': /* super-samp */
348 greg 1.49 check(3,"i");
349 greg 1.1 ambssamp = atoi(argv[++i]);
350     break;
351     case 'b': /* bounces */
352 greg 1.49 check(3,"i");
353 greg 1.1 ambounce = atoi(argv[++i]);
354     break;
355     case 'i': /* include */
356 greg 2.5 case 'I':
357 greg 1.49 check(3,"s");
358 greg 1.1 if (ambincl != 1) {
359     ambincl = 1;
360     amblp = amblist;
361     }
362 greg 2.5 if (argv[i][2] == 'I') { /* file */
363     rval = wordfile(amblp, argv[++i]);
364     if (rval < 0) {
365     sprintf(errmsg,
366     "cannot open ambient include file \"%s\"",
367     argv[i]);
368     error(SYSTEM, errmsg);
369     }
370     amblp += rval;
371     } else
372     *amblp++ = argv[++i];
373 greg 1.1 break;
374     case 'e': /* exclude */
375 greg 2.5 case 'E':
376 greg 1.49 check(3,"s");
377 greg 1.1 if (ambincl != 0) {
378     ambincl = 0;
379     amblp = amblist;
380     }
381 greg 2.5 if (argv[i][2] == 'E') { /* file */
382     rval = wordfile(amblp, argv[++i]);
383     if (rval < 0) {
384     sprintf(errmsg,
385     "cannot open ambient exclude file \"%s\"",
386     argv[i]);
387     error(SYSTEM, errmsg);
388     }
389     amblp += rval;
390     } else
391     *amblp++ = argv[++i];
392 greg 1.1 break;
393     case 'f': /* file */
394 greg 1.49 check(3,"s");
395 greg 1.1 ambfile= argv[++i];
396     break;
397     default:
398 greg 1.10 goto badopt;
399 greg 1.1 }
400     break;
401     #if RTRACE
402 greg 1.36 case 'I': /* immed. irradiance */
403 greg 1.43 bool(2,imm_irrad);
404 greg 1.36 break;
405 greg 1.1 case 'f': /* format i/o */
406     switch (argv[i][2]) {
407     case 'a': /* ascii */
408     case 'f': /* float */
409     case 'd': /* double */
410     inform = argv[i][2];
411     break;
412     default:
413 greg 1.10 goto badopt;
414 greg 1.1 }
415     switch (argv[i][3]) {
416     case '\0':
417     outform = inform;
418     break;
419     case 'a': /* ascii */
420     case 'f': /* float */
421     case 'd': /* double */
422 greg 2.7 case 'c': /* color */
423 greg 1.49 check(4,"");
424 greg 1.1 outform = argv[i][3];
425     break;
426     default:
427 greg 1.10 goto badopt;
428 greg 1.1 }
429     break;
430     case 'o': /* output */
431     outvals = argv[i]+2;
432     break;
433 greg 1.44 case 'h': /* header output */
434     rval = loadflags & IO_INFO;
435     bool(2,rval);
436     loadflags = rval ? loadflags | IO_INFO :
437     loadflags & ~IO_INFO;
438 greg 1.1 break;
439     #endif
440     #if RVIEW
441     case 'b': /* black and white */
442 greg 1.49 bool(2,greyscale);
443 greg 1.1 break;
444     case 'o': /* output device */
445 greg 1.49 check(2,"s");
446 greg 1.1 devname = argv[++i];
447     break;
448     #endif
449     default:
450 greg 1.19 goto badopt;
451 greg 1.1 }
452     }
453 greg 1.24 *amblp = NULL;
454 greg 1.1 #if RPICT|RVIEW
455     err = setview(&ourview); /* set viewing parameters */
456     if (err != NULL)
457     error(USER, err);
458     #endif
459     /* set up signal handling */
460     sigdie(SIGINT, "Interrupt");
461     sigdie(SIGHUP, "Hangup");
462     sigdie(SIGTERM, "Terminate");
463     sigdie(SIGPIPE, "Broken pipe");
464 greg 1.45 sigdie(SIGALRM, "Alarm clock");
465 greg 1.1 #ifdef SIGXCPU
466     sigdie(SIGXCPU, "CPU limit exceeded");
467     sigdie(SIGXFSZ, "File size exceeded");
468     #endif
469     /* open error file */
470     if (errfile != NULL) {
471     if (freopen(errfile, "a", stderr) == NULL)
472 greg 1.14 quit(2);
473 greg 1.1 fprintf(stderr, "**************\n*** PID %5d: ",
474     getpid());
475     printargs(argc, argv, stderr);
476     fputs("\n", stderr);
477     fflush(stderr);
478     }
479     #ifdef NICE
480     nice(NICE); /* lower priority */
481     #endif
482 greg 1.19 /* get octree */
483 greg 1.1 #if RVIEW
484     loadflags &= ~IO_INFO;
485     #endif
486     if (i == argc)
487 greg 1.19 octname = NULL;
488     else if (i == argc-1)
489     octname = argv[i];
490 greg 1.1 else
491 greg 1.19 goto badopt;
492 greg 2.7 if (
493     #if RPICT
494     seqstart > 0 &&
495     #endif
496     octname == NULL)
497 greg 1.19 error(USER, "missing octree argument");
498 greg 2.7 #if RPICT
499     if (outfile != NULL)
500     openheader();
501 greg 1.1 #endif
502 greg 1.19 readoct(octname, loadflags, &thescene, NULL);
503 greg 1.1
504     if (loadflags & IO_INFO) { /* print header */
505     printargs(i, argv, stdout);
506 greg 1.46 printf("SOFTWARE= %s\n", VersionID);
507 greg 2.8 #if RTRACE
508     fputformat(formstr(outform), stdout);
509     putchar('\n');
510     #endif
511 greg 1.1 }
512    
513     marksources(); /* find and mark sources */
514    
515 greg 1.24 setambient(ambfile); /* initialize ambient calculation */
516 greg 1.1
517     #if RPICT
518 greg 2.7 rpict(seqstart, outfile, zfile, recover);
519 greg 1.1 #endif
520     #if RTRACE
521 greg 2.8 rtrace(NULL);
522 greg 1.1 #endif
523     #if RVIEW
524 greg 2.8 rview();
525 greg 1.1 #endif
526     quit(0);
527 greg 1.19
528     badopt:
529     sprintf(errmsg, "command line error at '%s'", argv[i]);
530     error(USER, errmsg);
531    
532 greg 1.10 #undef check
533 greg 1.43 #undef bool
534 greg 1.1 }
535    
536    
537     eputs(s) /* error output */
538     char *s;
539     {
540     if (errvec != NULL)
541     (*errvec)(s);
542     }
543    
544    
545     wputs(s) /* warning output */
546     char *s;
547     {
548 greg 2.3 int lasterrno = errno; /* save errno */
549    
550 greg 1.1 if (wrnvec != NULL)
551     (*wrnvec)(s);
552 greg 2.3
553     errno = lasterrno;
554 greg 1.1 }
555    
556    
557     cputs(s) /* command error output */
558     char *s;
559     {
560     if (cmdvec != NULL)
561     (*cmdvec)(s);
562     }
563    
564    
565     stderr_v(s) /* put string to stderr */
566     register char *s;
567     {
568 greg 1.26 static int midline = 0;
569 greg 1.1
570 greg 1.27 if (!*s)
571     return;
572 greg 1.26 if (!midline++) {
573 greg 1.1 fputs(progname, stderr);
574     fputs(": ", stderr);
575     }
576     fputs(s, stderr);
577 greg 1.27 if (s[strlen(s)-1] == '\n') {
578 greg 1.1 fflush(stderr);
579 greg 1.26 midline = 0;
580 greg 1.1 }
581     }
582    
583    
584     onsig(signo) /* fatal signal */
585     int signo;
586     {
587 greg 1.8 static int gotsig = 0;
588    
589     if (gotsig++) /* two signals and we're gone! */
590 greg 1.9 _exit(signo);
591 greg 1.8
592 greg 1.48 alarm(15); /* allow 15 seconds to clean up */
593     signal(SIGALRM, SIG_DFL); /* make certain we do die */
594 greg 1.1 eputs("signal - ");
595     eputs(sigerr[signo]);
596     eputs("\n");
597 greg 1.14 quit(3);
598 greg 1.1 }
599    
600    
601     sigdie(signo, msg) /* set fatal signal */
602     int signo;
603     char *msg;
604     {
605     if (signal(signo, onsig) == SIG_IGN)
606     signal(signo, SIG_IGN);
607     sigerr[signo] = msg;
608     }
609    
610    
611     printdefaults() /* print default values to stdout */
612     {
613     register char *cp;
614    
615 greg 1.43 #if RTRACE
616     if (imm_irrad)
617     printf("-I+\t\t\t\t# immediate irradiance on\n");
618     else
619     #endif
620     printf(do_irrad ? "-i+\t\t\t\t# irradiance calculation on\n" :
621     "-i-\t\t\t\t# irradiance calculation off\n");
622 greg 1.49 #if RVIEW
623     printf(greyscale ? "-b+\t\t\t\t# greyscale on\n" :
624     "-b-\t\t\t\t# greyscale off\n");
625     #endif
626 greg 1.1 #if RPICT|RVIEW
627 greg 1.7 printf("-vt%c\t\t\t\t# view type %s\n", ourview.type,
628 greg 1.1 ourview.type==VT_PER ? "perspective" :
629     ourview.type==VT_PAR ? "parallel" :
630 greg 1.28 ourview.type==VT_HEM ? "hemispherical" :
631     ourview.type==VT_ANG ? "angular" :
632 greg 1.1 "unknown");
633     printf("-vp %f %f %f\t# view point\n",
634     ourview.vp[0], ourview.vp[1], ourview.vp[2]);
635     printf("-vd %f %f %f\t# view direction\n",
636     ourview.vdir[0], ourview.vdir[1], ourview.vdir[2]);
637     printf("-vu %f %f %f\t# view up\n",
638     ourview.vup[0], ourview.vup[1], ourview.vup[2]);
639     printf("-vh %f\t\t\t# view horizontal size\n", ourview.horiz);
640     printf("-vv %f\t\t\t# view vertical size\n", ourview.vert);
641 greg 1.22 printf("-vs %f\t\t\t# view shift\n", ourview.hoff);
642     printf("-vl %f\t\t\t# view lift\n", ourview.voff);
643 greg 1.1 #endif
644 greg 1.22 #if RPICT|RTRACE
645 greg 1.1 printf("-x %-9d\t\t\t# x resolution\n", hresolu);
646     printf("-y %-9d\t\t\t# y resolution\n", vresolu);
647 greg 1.22 #endif
648     #if RPICT
649 greg 2.4 printf("-pa %f\t\t\t# pixel aspect ratio\n", pixaspect);
650     printf("-pj %f\t\t\t# pixel jitter\n", dstrpix);
651 greg 1.22 #endif
652 greg 1.1 #if RPICT|RVIEW
653 greg 2.4 printf("-ps %-9d\t\t\t# pixel sample\n", psample);
654     printf("-pt %f\t\t\t# pixel threshold\n", maxdiff);
655 greg 1.22 #endif
656 greg 1.29 printf("-dt %f\t\t\t# direct threshold\n", shadthresh);
657     printf("-dc %f\t\t\t# direct certainty\n", shadcert);
658     printf("-dj %f\t\t\t# direct jitter\n", dstrsrc);
659 greg 1.47 printf("-ds %f\t\t\t# direct sampling\n", srcsizerat);
660 greg 1.39 printf("-dr %-9d\t\t\t# direct relays\n", directrelay);
661 greg 1.40 printf("-dp %-9d\t\t\t# direct pretest density\n", vspretest);
662 greg 1.43 printf(directinvis ? "-di+\t\t\t\t# direct invisibility on\n" :
663     "-di-\t\t\t\t# direct invisibility off\n");
664 greg 2.4 printf("-sj %f\t\t\t# specular jitter\n", specjitter);
665     printf("-st %f\t\t\t# specular threshold\n", specthresh);
666 greg 1.1 printf("-av %f %f %f\t# ambient value\n", colval(ambval,RED),
667     colval(ambval,GRN), colval(ambval, BLU));
668     printf("-ab %-9d\t\t\t# ambient bounces\n", ambounce);
669     printf("-aa %f\t\t\t# ambient accuracy\n", ambacc);
670     printf("-ar %-9d\t\t\t# ambient resolution\n", ambres);
671     printf("-ad %-9d\t\t\t# ambient divisions\n", ambdiv);
672     printf("-as %-9d\t\t\t# ambient super-samples\n", ambssamp);
673     printf("-lr %-9d\t\t\t# limit reflection\n", maxdepth);
674     printf("-lw %f\t\t\t# limit weight\n", minweight);
675     #if RPICT
676     printf("-t %-9d\t\t\t# time between reports\n", ralrm);
677     #endif
678     #if RVIEW
679     printf("-o %s\t\t\t\t# output device\n", devname);
680     #endif
681     #if RTRACE
682     printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n",
683 greg 2.7 inform, outform, formstr(inform), formstr(outform));
684 greg 1.1 printf("-o%s\t\t\t\t# output", outvals);
685     for (cp = outvals; *cp; cp++)
686     switch (*cp) {
687     case 't': printf(" trace"); break;
688     case 'o': printf(" origin"); break;
689     case 'd': printf(" direction"); break;
690     case 'v': printf(" value"); break;
691     case 'l': printf(" length"); break;
692     case 'p': printf(" point"); break;
693     case 'n': printf(" normal"); break;
694     case 's': printf(" surface"); break;
695     case 'w': printf(" weight"); break;
696     case 'm': printf(" modifier"); break;
697     }
698 greg 2.7 putchar('\n');
699 greg 1.1 #endif
700 greg 1.43 printf(wrnvec != NULL ? "-w+\t\t\t\t# warning messages on\n" :
701     "-w-\t\t\t\t# warning messages off\n");
702 greg 1.1 }