ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rtmain.c
(Generate patch)

Comparing ray/src/rt/rtmain.c (file contents):
Revision 2.50 by greg, Mon Dec 11 18:33:53 2023 UTC vs.
Revision 2.61 by greg, Fri Jun 20 16:34:23 2025 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13   #include  "rtprocess.h" /* getpid() */
14   #include  "resolu.h"
15   #include  "ray.h"
16 + #include  "func.h"
17   #include  "source.h"
18   #include  "ambient.h"
19   #include  "random.h"
19 #include  "paths.h"
20   #include  "pmapray.h"
21
22 extern char     *progname;              /* global argv[0] */
23
24 extern char     *shm_boundary;          /* boundary of shared memory */
25
21                                          /* persistent processes define */
22   #ifdef  F_SETLKW
23   #define  PERSIST        1               /* normal persist */
# Line 59 | Line 54 | extern void  tranotify(OBJECT obj);
54   char  *tralist[MAXMODLIST];             /* list of modifers to trace (or no) */
55   int  traincl = -1;                      /* include == 1, exclude == 0 */
56  
57 < double  (*sens_curve)(SCOLOR scol) = NULL;      /* spectral conversion for 1-channel */
57 > double  (*sens_curve)(const SCOLOR scol) = NULL;        /* spectral conversion for 1-channel */
58   double  out_scalefactor = 1;            /* output calibration scale factor */
59   RGBPRIMP  out_prims = stdprims;         /* output color primitives (NULL if spectral) */
60   static RGBPRIMS  our_prims;             /* private output color primitives */
# Line 77 | Line 72 | static void printdefaults(void);
72                          "HessianAmbientCache\nAmbientAveraging\n" \
73                          "AmbientValueSharing\nAdaptiveShadowTesting\n" \
74                          "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
75 <                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n"
75 >                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \
76 >                        "OutputCS=RGB,XYZ,Y,S,M,prims,spec\n"
77   #else
78   #define RTRACE_FEATURES "IrradianceCalc\nIrradianceCalc\nDistanceLimiting\n" \
79                          "ParticipatingMedia=Mist\n" \
80                          "HessianAmbientCache\nAmbientAveraging\n" \
81                          "AmbientValueSharing\nAdaptiveShadowTesting\n" \
82                          "InputFormats=a,f,d\nOutputFormats=a,f,d,c\n" \
83 <                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n"
83 >                        "Outputs=o,d,v,V,w,W,l,L,c,p,n,N,s,m,M,r,x,R,X,~\n" \
84 >                        "OutputCS=RGB,XYZ,Y,S,M,prims,spec\n"
85   #endif
86  
87  
# Line 114 | Line 111 | main(int  argc, char  *argv[])
111          strcat(RFeatureList, RTRACE_FEATURES);
112          if (argc > 1 && !strcmp(argv[1], "-features"))
113                  return feature_status(argc-2, argv+2);
114 +                                        /* initialize calcomp routines */
115 +        initfunc();
116                                          /* add trace notify function */
117          for (i = 0; addobjnotify[i] != NULL; i++)
118                  ;
# Line 348 | Line 347 | main(int  argc, char  *argv[])
347          rval = setspectrsamp(CNDX, WLPART);
348          if (rval < 0)
349                  error(USER, "unsupported spectral sampling");
350 <        if (out_prims != NULL) {
350 >        if (sens_curve != NULL)
351 >                out_prims = NULL;
352 >        else if (out_prims != NULL) {
353                  if (!rval)
354                          error(WARNING, "spectral range incompatible with color output");
355          } else if (NCSAMP == 3)
# Line 358 | Line 359 | main(int  argc, char  *argv[])
359                                          /* initialize object types */
360          initotypes();
361                                          /* initialize urand */
362 <        if (rand_samp) {
362 <                srandom((long)time(0));
363 <                initurand(0);
364 <        } else {
365 <                srandom(0L);
366 <                initurand(2048);
367 <        }
362 >        reset_random();
363                                          /* set up signal handling */
364          sigdie(SIGINT, "Interrupt");
365   #ifdef SIGHUP
# Line 451 | Line 446 | main(int  argc, char  *argv[])
446                  dup2(duped1, fileno(stdout));
447                  close(duped1);
448                  if (persist == PARALLEL) {      /* multiprocessing */
449 <                        preload_objs();         /* preload scene */
455 <                        shm_boundary = (char *)malloc(16);
456 <                        strcpy(shm_boundary, "SHM_BOUNDARY");
449 >                        cow_memshare();         /* preloads scene */
450                          while ((rval=fork()) == 0) {    /* keep on forkin' */
451                                  pflock(1);
452                                  pfhold();
# Line 510 | Line 503 | wputs(                         /* warning output function */
503   )
504   {
505          int  lasterrno = errno;
506 +        if (erract[WARNING].pf == NULL)
507 +                return;         /* called by calcomp or someone */
508          eputs(s);
509          errno = lasterrno;
510   }
# Line 630 | Line 625 | printdefaults(void)                    /* print default values to stdou
625                                  out_prims[GRN][0], out_prims[GRN][1],
626                                  out_prims[BLU][0], out_prims[BLU][1],
627                                  out_prims[WHT][0], out_prims[WHT][1]);
628 <        if (NCSAMP > 3)
628 >        if ((sens_curve == NULL) & (NCSAMP > 3))
629                  printf(out_prims != NULL ? "-co-\t\t\t\t# output tristimulus colors\n" :
630                                  "-co+\t\t\t\t# output spectral values\n");
631          print_rdefaults();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines