--- ray/src/rt/rcmain.c 2023/08/15 00:46:56 2.31 +++ ray/src/rt/rcmain.c 2024/10/30 17:26:13 2.39 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcmain.c,v 2.31 2023/08/15 00:46:56 greg Exp $"; +static const char RCSid[] = "$Id: rcmain.c,v 2.39 2024/10/30 17:26:13 greg Exp $"; #endif /* * rcmain.c - main for rtcontrib ray contribution tracer @@ -58,14 +58,16 @@ char RCCONTEXT[] = "RC."; /* our special evaluation c "ImmediateIrradiance\n" \ "ProgressReporting\nDistanceLimiting\n" \ "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ - "Outputs=V,W\n" + "Outputs=V,W\n" \ + "OutputCS=RGB,spec\n" #else #define RCONTRIB_FEATURES "Multiprocessing\n" \ "Accumulation\nSummation\nRecovery\n" \ "ImmediateIrradiance\n" \ "ProgressReporting\nDistanceLimiting\n" \ "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \ - "Outputs=V,W\n" + "Outputs=V,W\n" \ + "OutputCS=RGB,spec\n" #endif static void @@ -82,10 +84,12 @@ printdefaults(void) /* print default values to stdou printf("-y %-9d\t\t\t# y resolution\n", yres); printf(lim_dist ? "-ld+\t\t\t\t# limit distance on\n" : "-ld-\t\t\t\t# limit distance off\n"); - printf("-h%c\t\t\t\t# %s header\n", header ? '+' : '-', - header ? "output" : "no"); + printf(header ? "-h+\t\t\t\t# output header\n" : + "-h-\t\t\t\t# no header\n"); printf("-f%c%c\t\t\t\t# format input/output = %s/%s\n", inpfmt, outfmt, formstr(inpfmt), formstr(outfmt)); + if (report_intvl > 0) + printf("-t %-9d\t\t\t# time between reports\n", report_intvl); printf(erract[WARNING].pf != NULL ? "-w+\t\t\t\t# warning messages on\n" : "-w-\t\t\t\t# warning messages off\n"); @@ -287,10 +291,6 @@ main(int argc, char *argv[]) check(2,"s"); curout = argv[++i]; break; - case 'c': /* input rays per output */ - check(2,"i"); - accumulate = atoi(argv[++i]); - break; case 'r': /* recover output */ check_bool(2,recover); break; @@ -301,6 +301,10 @@ main(int argc, char *argv[]) check(2,"s"); set_eparams(prms = argv[++i]); break; + case 'c': /* sample count */ + check(2,"i"); + accumulate = atoi(argv[++i]); + break; case 'b': /* bin expression/count */ if (argv[i][2] == 'n') { check(3,"s"); @@ -330,6 +334,9 @@ main(int argc, char *argv[]) error(USER, "missing required modifier argument"); /* override some option settings */ override_options(); + /* set/check spectral sampling */ + if (setspectrsamp(CNDX, WLPART) < 0) + error(USER, "unsupported spectral sampling"); /* initialize object types */ initotypes(); /* initialize urand */ @@ -384,8 +391,6 @@ main(int argc, char *argv[]) rcontrib(); /* trace ray contributions (loop) */ - ambsync(); /* flush ambient file */ - /* PMAP: free photon maps */ ray_done_pmap(); @@ -410,6 +415,8 @@ wputs( /* warning output function */ ) { int lasterrno = errno; + if (erract[WARNING].pf == NULL) + return; /* called by calcomp or someone */ eputs(s); errno = lasterrno; }