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

Comparing ray/src/util/rad.c (file contents):
Revision 2.128 by greg, Thu Jan 21 21:36:28 2021 UTC vs.
Revision 2.135 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 14 | Line 14 | static const char      RCSid[] = "$Id$";
14   #include "platform.h"
15   #include "rtprocess.h"
16   #include "view.h"
17 #include "paths.h"
17   #include "vars.h"
18  
19   #if defined(_WIN32) || defined(_WIN64)
# Line 64 | Line 63 | static const char      RCSid[] = "$Id$";
63   int NVARS = 31;
64  
65   VARIABLE        vv[] = {                /* variable-value pairs */
66 <        {"AMBFILE",     3,      0,      NULL,   onevalue},
66 >        {"AMBFILE",     3,      0,      NULL,   strvalue},
67          {"DETAIL",      3,      0,      NULL,   qualvalue},
68          {"EXPOSURE",    3,      0,      NULL,   fltvalue},
69          {"EYESEP",      3,      0,      NULL,   fltvalue},
# Line 75 | Line 74 | VARIABLE       vv[] = {                /* variable-value pairs */
74          {"mkpmap",      3,      0,      NULL,   catvalues},
75          {"objects",     3,      0,      NULL,   catvalues},
76          {"oconv",       3,      0,      NULL,   catvalues},
77 <        {"OCTREE",      3,      0,      NULL,   onevalue},
78 <        {"OPTFILE",     3,      0,      NULL,   onevalue},
79 <        {"PCMAP",       2,      0,      NULL,   onevalue},
77 >        {"OCTREE",      3,      0,      NULL,   strvalue},
78 >        {"OPTFILE",     3,      0,      NULL,   strvalue},
79 >        {"PCMAP",       2,      0,      NULL,   strvalue},
80          {"PENUMBRAS",   3,      0,      NULL,   boolvalue},
81          {"pfilt",       2,      0,      NULL,   catvalues},
82 <        {"PGMAP",       2,      0,      NULL,   onevalue},
83 <        {"PICTURE",     3,      0,      NULL,   onevalue},
82 >        {"PGMAP",       2,      0,      NULL,   strvalue},
83 >        {"PICTURE",     3,      0,      NULL,   strvalue},
84          {"QUALITY",     3,      0,      NULL,   qualvalue},
85 <        {"RAWFILE",     3,      0,      NULL,   onevalue},
85 >        {"RAWFILE",     3,      0,      NULL,   strvalue},
86          {"render",      3,      0,      NULL,   catvalues},
87          {"REPORT",      3,      0,      NULL,   onevalue},
88          {"RESOLUTION",  3,      0,      NULL,   onevalue},
# Line 93 | Line 92 | VARIABLE       vv[] = {                /* variable-value pairs */
92          {"UP",          2,      0,      NULL,   onevalue},
93          {"VARIABILITY", 3,      0,      NULL,   qualvalue},
94          {"view",        2,      0,      NULL,   NULL},
95 <        {"ZFILE",       2,      0,      NULL,   onevalue},
95 >        {"ZFILE",       2,      0,      NULL,   strvalue},
96          {"ZONE",        2,      0,      NULL,   onevalue},
97   };
98  
# Line 131 | Line 130 | char   *viewselect = NULL;     /* specific view only */
130  
131   #define DEF_RPICT_PATH  "rpict"         /* default rpict path */
132  
133 + #define R_CMDMAX        (5*PATH_MAX+512)
134                                  /* command paths */
135   char    c_oconv[256] = "oconv";
136   char    c_mkillum[256] = "mkillum";
# Line 144 | Line 144 | int    overture = 0;           /* overture calculation needed */
144  
145   int     children_running = 0;   /* set negative in children */
146  
147 char    *progname;              /* global argv[0] */
147   char    *rifname;               /* global rad input file name */
148  
149   char    radname[PATH_MAX];      /* root Radiance file name */
# Line 197 | Line 196 | main(
196          char    ropts[512];
197          char    popts[64];
198          int     i;
199 <
200 <        progname = argv[0];
199 >                                /* set global progname */
200 >        fixargv0(argv[0]);
201                                  /* get options */
202          for (i = 1; i < argc && argv[i][0] == '-'; i++)
203                  switch (argv[i][1]) {
# Line 242 | Line 241 | main(
241                                  /* load variable values */
242          loadvars(rifname);
243                                  /* get any additional assignments */
244 <        for (i++; i < argc; i++)
245 <                if (setvariable(argv[i], matchvar) < 0) {
246 <                        fprintf(stderr, "%s: unknown variable: %s\n",
244 >        for (i++; i < argc; i++) {
245 >                int     rv = setvariable(argv[i], matchvar);
246 >                if (rv < 0) {
247 >                        fprintf(stderr, "%s: unknown setting: %s\n",
248                                          progname, argv[i]);
249                          quit(1);
250                  }
251 +                if (!rv)
252 +                        fprintf(stderr,
253 +                        "%s: bad variable assignment: %s (ignored)\n",
254 +                                        progname, argv[i]);
255 +        }
256                                  /* check assignments */
257          checkvalues();
258                                  /* check files and dates */
# Line 522 | Line 527 | static void
527   oconv(void)                             /* run oconv and mkillum if necessary */
528   {
529          static char     illumtmp[] = "ilXXXXXX";
530 <        char    combuf[PATH_MAX], ocopts[64], mkopts[1024];
530 >        char    combuf[R_CMDMAX], ocopts[64], mkopts[1024];
531  
532          oconvopts(ocopts);              /* get options */
533          if (octreedate < scenedate) {   /* check date on original octree */
# Line 924 | Line 929 | lowqopts(                      /* low quality rendering options */
929          d = ambval();
930          sprintf(op, " -av %.2g %.2g %.2g", d, d, d);
931          op += strlen(op);
932 <        op = addarg(op, "-lr 6 -lw .003");
932 >        op = addarg(op, "-lr 6 -lw .001");
933   }
934  
935  
# Line 1078 | Line 1083 | hiqopts(                               /* high quality rendering options */
1083          d = ambval();
1084          sprintf(op, " -av %.2g %.2g %.2g", d, d, d);
1085          op += strlen(op);
1086 <        op = addarg(op, "-lr 12 -lw 1e-5");
1086 >        op = addarg(op, "-lr 12 -lw 5e-6");
1087   }
1088  
1089  
# Line 1409 | Line 1414 | rvu(                           /* run rvu with first view */
1414   )
1415   {
1416          char    *vw;
1417 <        char    combuf[PATH_MAX];
1417 >        char    combuf[R_CMDMAX];
1418                                          /* build command */
1419          if (touchonly || (vw = getview(0, NULL)) == NULL)
1420                  return;
# Line 1607 | Line 1612 | rpict(                         /* run rpict and pfilt for each view */
1612                  } else {
1613                          if (overture) {         /* run overture calculation */
1614                                  sprintf(combuf,
1615 <                                        "%s%s %s%s -x 64 -y 64 -ps 1 %s > %s",
1616 <                                                c_rpict, rep, vw, opts,
1615 >                                        "%s%s %s%s%s -x 64 -y 64 -ps 1 %s > %s",
1616 >                                                c_rpict, rep, vw, opts, po,
1617                                                  oct1name, overfile);
1618                                  if (!do_rpiece || !next_process(0)) {
1619                                          if (runcom(combuf)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines