--- ray/src/rt/rpmain.c 2023/11/15 18:02:53 2.28 +++ ray/src/rt/rpmain.c 2024/10/30 16:47:03 2.35 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rpmain.c,v 2.28 2023/11/15 18:02:53 greg Exp $"; +static const char RCSid[] = "$Id: rpmain.c,v 2.35 2024/10/30 16:47:03 greg Exp $"; #endif /* * rpmain.c - main for rpict batch rendering program @@ -30,7 +30,6 @@ static const char RCSid[] = "$Id: rpmain.c,v 2.28 2023 char *progname; /* argv[0] */ char *octname; /* octree name */ char *sigerr[NSIG]; /* signal error messages */ -char *shm_boundary = NULL; /* boundary of shared memory */ char *errfile = NULL; /* error output file */ extern time_t time(); @@ -61,19 +60,21 @@ static void printdefaults(void); /* rpict additional features */ #ifdef PERSIST #define RPICT_FEATURES "Persist\nParallelPersist\n" \ - "Hyperspectral\nParticipatingMedia=Mist\n" \ + "ParticipatingMedia=Mist\n" \ "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ "PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ "SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ - "AdaptiveShadowTesting\nOutputs=v,l\n" + "AdaptiveShadowTesting\nOutputs=v,l\n" \ + "OutputCS=RGB,XYZ,prims\n" #else #define RPICT_FEATURES "Recovery\nIrradianceCalc\nViewTypes=v,l,a,h,s,c\n" \ - "Hyperspectral\nParticipatingMedia=Mist\n" \ + "ParticipatingMedia=Mist\n" \ "HessianAmbientCache\nAmbientAveraging\nAmbientValueSharing\n" \ "PixelJitter\nPixelSampling\nPixelMotion\nPixelDepthOfField\n" \ "SmallSourceDrawing\nViewSequence\nProgressReporting\n" \ - "AdaptiveShadowTesting\nOutputs=v,l\n" + "AdaptiveShadowTesting\nOutputs=v,l\n" \ + "OutputCS=RGB,XYZ,prims\n" #endif @@ -244,31 +245,6 @@ main(int argc, char *argv[]) check(2,"i"); ralrm = atoi(argv[++i]); break; -#if MAXCSAMP>3 - case 'c': /* spectral sampling */ - switch (argv[i][2]) { - case 's': /* spectral bin count */ - check(3,"i"); - NCSAMP = atoi(argv[++i]); - break; - case 'w': /* wavelength extrema */ - check(3,"ff"); - WLPART[0] = atof(argv[++i]); - WLPART[3] = atof(argv[++i]); - break; -#if 0 - case 'o': /* output spectral results */ - rval = (out_prims == NULL); - check_bool(3,rval); - if (rval) out_prims = NULL; - else if (out_prims == NULL) out_prims = stdprims; - break; -#endif - default: - goto badopt; - } - break; -#endif #ifdef PERSIST case 'P': /* persist file */ if (argv[i][2] == 'P') { @@ -295,6 +271,10 @@ main(int argc, char *argv[]) goto badopt; } } + /* set/check spectral sampling */ + if (setspectrsamp(CNDX, WLPART) <= 0) + error(USER, "unsupported spectral sampling"); + err = setview(&ourview); /* set viewing parameters */ if (err != NULL) error(USER, err); @@ -386,9 +366,7 @@ main(int argc, char *argv[]) close(duped1); } if (persist == PARALLEL) { /* multiprocessing */ - preload_objs(); /* preload scene */ - shm_boundary = (char *)malloc(16); - strcpy(shm_boundary, "SHM_BOUNDARY"); + cow_memshare(); /* preloads scene */ while ((rval=fork()) == 0) { /* keep on forkin' */ pflock(1); pfhold(); @@ -454,6 +432,8 @@ wputs( /* warning output function */ ) { int lasterrno = errno; + if (erract[WARNING].pf == NULL) + return; /* called by calcomp or someone */ eputs(s); errno = lasterrno; } @@ -538,13 +518,6 @@ printdefaults(void) /* print default values to stdou printf("-vl %f\t\t\t# view lift\n", ourview.voff); printf("-x %-9d\t\t\t# x resolution\n", hresolu); printf("-y %-9d\t\t\t# y resolution\n", vresolu); - if (NCSAMP > 3) { - printf("-cs %-2d\t\t\t\t# number of spectral bins\n", NCSAMP); - printf("-cw %3.0f %3.0f\t\t\t# wavelength limits (nm)\n", - WLPART[3], WLPART[0]); -/* printf(out_prims != NULL ? "-co-\t\t\t\t# output tristimulus colors\n" : - "-co+\t\t\t\t# output spectral values\n"); -*/ } if (out_prims == stdprims) printf("-pRGB\t\t\t\t# standard RGB color output\n"); else if (out_prims == xyzprims)