35 |
|
|
36 |
|
int nproc = 1; /* number of processes */ |
37 |
|
|
38 |
< |
extern char *formstr(); /* string from format */ |
38 |
> |
extern char *formstr(int f); /* string from format */ |
39 |
> |
extern int setrtoutput(void); /* set output values */ |
40 |
> |
|
41 |
|
int inform = 'a'; /* input format */ |
42 |
|
int outform = 'a'; /* output format */ |
43 |
|
char *outvals = "v"; /* output specification */ |
45 |
|
int hresolu = 0; /* horizontal (scan) size */ |
46 |
|
int vresolu = 0; /* vertical resolution */ |
47 |
|
|
48 |
+ |
extern int castonly; /* only doing ray-casting? */ |
49 |
+ |
|
50 |
|
int imm_irrad = 0; /* compute immediate irradiance? */ |
51 |
|
int lim_dist = 0; /* limit distance? */ |
52 |
|
|
93 |
|
for (i = 0; addobjnotify[i] != NULL; i++) |
94 |
|
; |
95 |
|
addobjnotify[i] = tranotify; |
92 |
– |
/* set our defaults */ |
93 |
– |
rand_samp = 1; |
94 |
– |
maxdepth = -10; |
95 |
– |
minweight = 2e-3; |
96 |
|
/* option city */ |
97 |
|
for (i = 1; i < argc; i++) { |
98 |
|
/* expand arguments */ |
316 |
|
#endif |
317 |
|
if (outform != 'a') |
318 |
|
SET_FILE_BINARY(stdout); |
319 |
+ |
rval = setrtoutput(); |
320 |
|
readoct(octname = octnm, loadflags, &thescene, NULL); |
321 |
|
nsceneobjs = nobjects; |
322 |
|
|
324 |
|
printargs(i, argv, stdout); |
325 |
|
printf("SOFTWARE= %s\n", VersionID); |
326 |
|
fputnow(stdout); |
327 |
+ |
if (rval > 0) /* saved from setrtoutput() call */ |
328 |
+ |
printf("NCOMP=%d\n", rval); |
329 |
+ |
if ((outform == 'f') | (outform == 'd')) |
330 |
+ |
fputendian(stdout); |
331 |
|
fputformat(formstr(outform), stdout); |
332 |
|
putchar('\n'); |
333 |
|
} |
329 |
– |
|
330 |
– |
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
331 |
– |
|
332 |
– |
marksources(); /* find and mark sources */ |
334 |
|
|
335 |
< |
setambient(); /* initialize ambient calculation */ |
336 |
< |
|
335 |
> |
if (!castonly) { /* any actual ray traversal to do? */ |
336 |
> |
|
337 |
> |
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
338 |
> |
|
339 |
> |
marksources(); /* find and mark sources */ |
340 |
> |
|
341 |
> |
setambient(); /* initialize ambient calculation */ |
342 |
> |
} else |
343 |
> |
distantsources(); /* else mark only distant sources */ |
344 |
|
#ifdef PERSIST |
345 |
|
if (persist) { |
346 |
|
fflush(stdout); |
489 |
|
case 't': case 'T': printf(" trace"); break; |
490 |
|
case 'o': printf(" origin"); break; |
491 |
|
case 'd': printf(" direction"); break; |
492 |
+ |
case 'r': printf(" reflect_contrib"); break; |
493 |
+ |
case 'R': printf(" reflect_length"); break; |
494 |
+ |
case 'x': printf(" unreflect_contrib"); break; |
495 |
+ |
case 'X': printf(" unreflect_length"); break; |
496 |
|
case 'v': printf(" value"); break; |
497 |
|
case 'V': printf(" contribution"); break; |
498 |
|
case 'l': printf(" length"); break; |