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.31 by greg, Sun Apr 5 15:47:02 2020 UTC vs.
Revision 2.37 by greg, Tue Oct 18 18:07:50 2022 UTC

# Line 37 | Line 37 | int  nproc = 1;                                /* number of processes */
37  
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 */
# Line 44 | Line 45 | 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  
# Line 248 | Line 251 | main(int  argc, char  *argv[])
251                          goto badopt;
252                  }
253          }
254 <        if (nproc > 1) {
255 <                if (persist)
253 <                        error(USER, "multiprocessing incompatible with persist file");
254 <                if (!vresolu && hresolu > 0 && hresolu < nproc)
255 <                        error(WARNING, "number of cores should not exceed horizontal resolution");
256 <                if (trace != NULL)
257 <                        error(WARNING, "multiprocessing does not work properly with trace mode");
258 <        }
254 >        if (nproc > 1 && persist)
255 >                error(USER, "multiprocessing incompatible with persist file");
256                                          /* initialize object types */
257          initotypes();
258                                          /* initialize urand */
# Line 328 | Line 325 | main(int  argc, char  *argv[])
325                  fputformat(formstr(outform), stdout);
326                  putchar('\n');
327          }
331        
332        ray_init_pmap();     /* PMAP: set up & load photon maps */
333        
334        marksources();                  /* find and mark sources */
328  
329 <        setambient();                   /* initialize ambient calculation */
330 <        
329 >        if (!castonly) {        /* any actual ray traversal to do? */
330 >
331 >                ray_init_pmap();        /* PMAP: set up & load photon maps */
332 >                
333 >                marksources();          /* find and mark sources */
334 >
335 >                setambient();           /* initialize ambient calculation */
336 >        } else
337 >                distantsources();       /* else mark only distant sources */
338 >
339 >        fflush(stdout);                 /* in case we're duplicating header */
340 >
341   #ifdef  PERSIST
342          if (persist) {
340                fflush(stdout);
343                                                  /* reconnect stdout */
344                  dup2(duped1, fileno(stdout));
345                  close(duped1);
# Line 499 | Line 501 | printdefaults(void)                    /* print default values to stdou
501                  case 'W': printf(" coefficient"); break;
502                  case 'm': printf(" modifier"); break;
503                  case 'M': printf(" material"); break;
504 <                case '-': printf(" stroke"); break;
504 >                case '~': printf(" tilde"); break;
505                  }
506          putchar('\n');
507          printf(erract[WARNING].pf != NULL ?

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines