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