| 30 |
|
char *progname; /* argv[0] */ |
| 31 |
|
char *octname; /* octree name */ |
| 32 |
|
char *sigerr[NSIG]; /* signal error messages */ |
| 33 |
– |
char *shm_boundary = NULL; /* boundary of shared memory */ |
| 33 |
|
char *errfile = NULL; /* error output file */ |
| 34 |
|
|
| 35 |
|
extern time_t time(); |
| 60 |
|
/* rpict additional features */ |
| 61 |
|
#ifdef PERSIST |
| 62 |
|
#define RPICT_FEATURES "Persist\nParallelPersist\n" \ |
| 63 |
< |
"Hyperspectral\nParticipatingMedia=Mist\n" \ |
| 63 |
> |
"ParticipatingMedia=Mist\n" \ |
| 64 |
|
"Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
| 65 |
|
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
| 66 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
| 67 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
| 68 |
< |
"AdaptiveShadowTesting\nOutputs=v,l\n" |
| 68 |
> |
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
| 69 |
> |
"OutputCS=RGB,XYZ,prims\n" |
| 70 |
|
#else |
| 71 |
|
#define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ |
| 72 |
< |
"Hyperspectral\nParticipatingMedia=Mist\n" \ |
| 72 |
> |
"ParticipatingMedia=Mist\n" \ |
| 73 |
|
"HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ |
| 74 |
|
"PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ |
| 75 |
|
"SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ |
| 76 |
< |
"AdaptiveShadowTesting\nOutputs=v,l\n" |
| 76 |
> |
"AdaptiveShadowTesting\nOutputs=v,l\n" \ |
| 77 |
> |
"OutputCS=RGB,XYZ,prims\n" |
| 78 |
|
#endif |
| 79 |
|
|
| 80 |
|
|
| 241 |
|
check(2,"s"); |
| 242 |
|
recover = argv[++i]; |
| 243 |
|
break; |
| 243 |
– |
case 't': /* timer */ |
| 244 |
– |
check(2,"i"); |
| 245 |
– |
ralrm = atoi(argv[++i]); |
| 246 |
– |
break; |
| 247 |
– |
#if MAXCSAMP>3 |
| 248 |
– |
case 'c': /* spectral sampling */ |
| 249 |
– |
switch (argv[i][2]) { |
| 250 |
– |
case 's': /* spectral bin count */ |
| 251 |
– |
check(3,"i"); |
| 252 |
– |
NCSAMP = atoi(argv[++i]); |
| 253 |
– |
break; |
| 254 |
– |
case 'w': /* wavelength extrema */ |
| 255 |
– |
check(3,"ff"); |
| 256 |
– |
WLPART[0] = atof(argv[++i]); |
| 257 |
– |
WLPART[3] = atof(argv[++i]); |
| 258 |
– |
break; |
| 259 |
– |
#if 0 |
| 260 |
– |
case 'o': /* output spectral results */ |
| 261 |
– |
rval = (out_prims == NULL); |
| 262 |
– |
check_bool(3,rval); |
| 263 |
– |
if (rval) out_prims = NULL; |
| 264 |
– |
else if (out_prims == NULL) out_prims = stdprims; |
| 265 |
– |
break; |
| 266 |
– |
#endif |
| 267 |
– |
default: |
| 268 |
– |
goto badopt; |
| 269 |
– |
} |
| 270 |
– |
break; |
| 271 |
– |
#endif |
| 244 |
|
#ifdef PERSIST |
| 245 |
|
case 'P': /* persist file */ |
| 246 |
|
if (argv[i][2] == 'P') { |
| 253 |
|
persistfile(argv[++i]); |
| 254 |
|
break; |
| 255 |
|
#endif |
| 256 |
+ |
case 't': /* timer */ |
| 257 |
+ |
check(2,"i"); |
| 258 |
+ |
ralrm = atoi(argv[++i]); |
| 259 |
+ |
break; |
| 260 |
|
case 'w': /* warnings */ |
| 261 |
|
rval = erract[WARNING].pf != NULL; |
| 262 |
|
check_bool(2,rval); |
| 271 |
|
goto badopt; |
| 272 |
|
} |
| 273 |
|
} |
| 274 |
+ |
/* set/check spectral sampling */ |
| 275 |
+ |
if (setspectrsamp(CNDX, WLPART) <= 0) |
| 276 |
+ |
error(USER, "unsupported spectral sampling"); |
| 277 |
+ |
|
| 278 |
|
err = setview(&ourview); /* set viewing parameters */ |
| 279 |
|
if (err != NULL) |
| 280 |
|
error(USER, err); |
| 354 |
|
ray_init_pmap(); /* PMAP: set up & load photon maps */ |
| 355 |
|
|
| 356 |
|
marksources(); /* find and mark sources */ |
| 377 |
– |
|
| 357 |
|
setambient(); /* initialize ambient calculation */ |
| 358 |
|
|
| 359 |
|
fflush(stdout); /* in case we're duplicating header */ |
| 365 |
|
close(duped1); |
| 366 |
|
} |
| 367 |
|
if (persist == PARALLEL) { /* multiprocessing */ |
| 368 |
< |
preload_objs(); /* preload scene */ |
| 390 |
< |
shm_boundary = (char *)malloc(16); |
| 391 |
< |
strcpy(shm_boundary, "SHM_BOUNDARY"); |
| 368 |
> |
cow_memshare(); /* preloads scene */ |
| 369 |
|
while ((rval=fork()) == 0) { /* keep on forkin' */ |
| 370 |
|
pflock(1); |
| 371 |
|
pfhold(); |
| 431 |
|
) |
| 432 |
|
{ |
| 433 |
|
int lasterrno = errno; |
| 434 |
+ |
if (erract[WARNING].pf == NULL) |
| 435 |
+ |
return; /* called by calcomp or someone */ |
| 436 |
|
eputs(s); |
| 437 |
|
errno = lasterrno; |
| 438 |
|
} |
| 517 |
|
printf("-vl %f\t\t\t# view lift\n", ourview.voff); |
| 518 |
|
printf("-x %-9d\t\t\t# x resolution\n", hresolu); |
| 519 |
|
printf("-y %-9d\t\t\t# y resolution\n", vresolu); |
| 541 |
– |
if (NCSAMP > 3) { |
| 542 |
– |
printf("-cs %-2d\t\t\t\t# number of spectral bins\n", NCSAMP); |
| 543 |
– |
printf("-cw %3.0f %3.0f\t\t\t# wavelength limits (nm)\n", |
| 544 |
– |
WLPART[3], WLPART[0]); |
| 545 |
– |
/* printf(out_prims != NULL ? "-co-\t\t\t\t# output tristimulus colors\n" : |
| 546 |
– |
"-co+\t\t\t\t# output spectral values\n"); |
| 547 |
– |
*/ } |
| 520 |
|
if (out_prims == stdprims) |
| 521 |
|
printf("-pRGB\t\t\t\t# standard RGB color output\n"); |
| 522 |
|
else if (out_prims == xyzprims) |