ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rmain.c
Revision: 2.17
Committed: Thu Nov 19 20:26:02 1992 UTC (32 years, 6 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.16: +5 -5 lines
Log Message:
changed -di to ! -dv

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