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.71 by schorsch, Sun Jul 27 22:12:03 2003 UTC vs.
Revision 2.75 by greg, Thu Jan 1 19:31:46 2004 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   #include <time.h>
12  
13   #include "platform.h"
14 + #include "rtprocess.h"
15   #include "view.h"
16   #include "paths.h"
17   #include "vars.h"
# Line 106 | Line 107 | int    silent = 0;             /* do work silently */
107   int     touchonly = 0;          /* touch files only */
108   int     nprocs = 1;             /* maximum executing processes */
109   int     sayview = 0;            /* print view out */
110 < char    *rvdevice = NULL;       /* rview output device */
110 > char    *rvdevice = NULL;       /* rvu output device */
111   char    *viewselect = NULL;     /* specific view only */
112  
113   int     overture = 0;           /* overture calculation needed */
# Line 199 | Line 200 | char   *argv[];
200          renderopts(ropts, popts);
201          xferopts(ropts);
202          if (rvdevice != NULL)
203 <                rview(ropts, popts);
203 >                rvu(ropts, popts);
204          else
205                  rpict(ropts, popts);
206          quit(0);
# Line 311 | Line 312 | checkfiles()                   /* check for existence and modified tim
312   getoctcube(org, sizp)           /* get octree bounding cube */
313   double  org[3], *sizp;
314   {
314        extern FILE     *popen();
315          static double   oorg[3], osiz = 0.;
316          double  min[3], max[3];
317          char    buf[1024];
# Line 621 | Line 621 | char   *po;
621          case LOW:
622                  po = addarg(po, "-ps 16");
623                  op = addarg(op, "-dp 64");
624 <                sprintf(op, " -ar %d", (int)(4*d));
624 >                sprintf(op, " -ar %d", (int)(8*d));
625                  op += strlen(op);
626                  break;
627          case MEDIUM:
628                  po = addarg(po, "-ps 8");
629                  op = addarg(op, "-dp 128");
630 <                sprintf(op, " -ar %d", (int)(8*d));
630 >                sprintf(op, " -ar %d", (int)(16*d));
631                  op += strlen(op);
632                  break;
633          case HIGH:
634                  po = addarg(po, "-ps 4");
635                  op = addarg(op, "-dp 256");
636 <                sprintf(op, " -ar %d", (int)(16*d));
636 >                sprintf(op, " -ar %d", (int)(32*d));
637                  op += strlen(op);
638                  break;
639          }
# Line 650 | Line 650 | char   *po;
650                  overture = 0;
651          switch (vscale(VARIABILITY)) {
652          case LOW:
653 <                op = addarg(op, "-aa .4 -ad 64");
653 >                op = addarg(op, "-aa .3 -ad 256");
654                  break;
655          case MEDIUM:
656 <                op = addarg(op, "-aa .3 -ad 128");
656 >                op = addarg(op, "-aa .25 -ad 512");
657                  break;
658          case HIGH:
659 <                op = addarg(op, "-aa .25 -ad 256");
659 >                op = addarg(op, "-aa .2 -ad 1024");
660                  break;
661          }
662          op = addarg(op, "-as 0");
663          d = ambval();
664          sprintf(op, " -av %.2g %.2g %.2g", d, d, d);
665          op += strlen(op);
666 <        op = addarg(op, "-lr 3 -lw .02");
666 >        op = addarg(op, "-lr 6 -lw .01");
667          if (vdef(RENDER))
668                  op = addarg(op, vval(RENDER));
669   }
# Line 690 | Line 690 | char   *po;
690          case LOW:
691                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 4" : "-ps 8");
692                  op = addarg(op, "-dp 256");
693 <                sprintf(op, " -ar %d", (int)(8*d));
693 >                sprintf(op, " -ar %d", (int)(16*d));
694                  op += strlen(op);
695                  sprintf(op, " -ms %.2g", asz/20.);
696                  op += strlen(op);
# Line 698 | Line 698 | char   *po;
698          case MEDIUM:
699                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 3" : "-ps 6");
700                  op = addarg(op, "-dp 512");
701 <                sprintf(op, " -ar %d", (int)(16*d));
701 >                sprintf(op, " -ar %d", (int)(32*d));
702                  op += strlen(op);
703                  sprintf(op, " -ms %.2g", asz/40.);
704                  op += strlen(op);
# Line 706 | Line 706 | char   *po;
706          case HIGH:
707                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 2" : "-ps 4");
708                  op = addarg(op, "-dp 1024");
709 <                sprintf(op, " -ar %d", (int)(32*d));
709 >                sprintf(op, " -ar %d", (int)(64*d));
710                  op += strlen(op);
711                  sprintf(op, " -ms %.2g", asz/80.);
712                  op += strlen(op);
# Line 729 | Line 729 | char   *po;
729                  overture = 0;
730          switch (vscale(VARIABILITY)) {
731          case LOW:
732 <                op = addarg(op, "-aa .25 -ad 196 -as 0");
732 >                op = addarg(op, "-aa .2 -ad 329 -as 42");
733                  break;
734          case MEDIUM:
735 <                op = addarg(op, "-aa .2 -ad 400 -as 64");
735 >                op = addarg(op, "-aa .15 -ad 800 -as 128");
736                  break;
737          case HIGH:
738 <                op = addarg(op, "-aa .15 -ad 768 -as 196");
738 >                op = addarg(op, "-aa .1 -ad 1536 -as 392");
739                  break;
740          }
741          d = ambval();
742          sprintf(op, " -av %.2g %.2g %.2g", d, d, d);
743          op += strlen(op);
744 <        op = addarg(op, "-lr 6 -lw .002");
744 >        op = addarg(op, "-lr 8 -lw .002");
745          if (vdef(RENDER))
746                  op = addarg(op, vval(RENDER));
747   }
# Line 768 | Line 768 | char   *po;
768          case LOW:
769                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 8");
770                  op = addarg(op, "-dp 1024");
771 <                sprintf(op, " -ar %d", (int)(16*d));
771 >                sprintf(op, " -ar %d", (int)(32*d));
772                  op += strlen(op);
773                  sprintf(op, " -ms %.2g", asz/40.);
774                  op += strlen(op);
# Line 776 | Line 776 | char   *po;
776          case MEDIUM:
777                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 5");
778                  op = addarg(op, "-dp 2048");
779 <                sprintf(op, " -ar %d", (int)(32*d));
779 >                sprintf(op, " -ar %d", (int)(64*d));
780                  op += strlen(op);
781                  sprintf(op, " -ms %.2g", asz/80.);
782                  op += strlen(op);
# Line 784 | Line 784 | char   *po;
784          case HIGH:
785                  po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 3");
786                  op = addarg(op, "-dp 4096");
787 <                sprintf(op, " -ar %d", (int)(64*d));
787 >                sprintf(op, " -ar %d", (int)(128*d));
788                  op += strlen(op);
789                  sprintf(op, " -ms %.2g", asz/160.);
790                  op += strlen(op);
# Line 805 | Line 805 | char   *po;
805                  overture = 0;
806          switch (vscale(VARIABILITY)) {
807          case LOW:
808 <                op = addarg(op, "-aa .15 -ad 256 -as 0");
808 >                op = addarg(op, "-aa .125 -ad 512 -as 64");
809                  break;
810          case MEDIUM:
811 <                op = addarg(op, "-aa .125 -ad 512 -as 256");
811 >                op = addarg(op, "-aa .1 -ad 1536 -as 768");
812                  break;
813          case HIGH:
814 <                op = addarg(op, "-aa .08 -ad 1024 -as 512");
814 >                op = addarg(op, "-aa .075 -ad 4096 -as 2048");
815                  break;
816          }
817          d = ambval();
# Line 1083 | Line 1083 | again:
1083   }
1084  
1085  
1086 < rview(opts, po)                         /* run rview with first view */
1086 > rvu(opts, po)                           /* run rvu with first view */
1087   char    *opts, *po;
1088   {
1089          char    *vw;
# Line 1093 | Line 1093 | char   *opts, *po;
1093                  return;
1094          if (sayview)
1095                  myprintview(vw, stdout);
1096 <        sprintf(combuf, "rview %s%s%s -R %s ", vw, po, opts, rifname);
1096 >        sprintf(combuf, "rvu %s%s%s -R %s ", vw, po, opts, rifname);
1097          if (rvdevice != NULL)
1098                  sprintf(combuf+strlen(combuf), "-o %s ", rvdevice);
1099          if (vdef(EXPOSURE))
1100                  sprintf(combuf+strlen(combuf), "-pe %s ", vval(EXPOSURE));
1101          strcat(combuf, oct1name);
1102          if (runcom(combuf)) {           /* run it */
1103 <                fprintf(stderr, "%s: error running rview\n", progname);
1103 >                fprintf(stderr, "%s: error running rvu\n", progname);
1104                  quit(1);
1105          }
1106   }
# Line 1264 | Line 1264 | char   *opts, *po;
1264                          mvfile(rawfile, combuf);
1265                  } else
1266                          rmfile(rawfile);
1267 <                finish_process();               /* leave if child */
1267 >                finish_process();               /* exit if child */
1268          }
1269          wait_process(1);                /* wait for children to finish */
1270          if (pfile != NULL) {            /* clean up rpict persistent mode */
# Line 1272 | Line 1272 | char   *opts, *po;
1272                  fp = fopen(pfile, "r");
1273                  if (fp != NULL) {
1274                          if (fscanf(fp, "%*s %d", &pid) != 1 ||
1275 <                                        kill(pid, 1) == -1)
1275 >                                        kill(pid, 1) < 0)
1276                                  unlink(pfile);
1277                          fclose(fp);
1278                  }
# Line 1343 | Line 1343 | next_process()                 /* fork the next process (max. nprocs
1343          if (nprocs <= 1)
1344                  return(0);              /* it's us or no one */
1345          if (inchild()) {
1346 <                fprintf(stderr, "%s: internal error 1 in spawn_process()\n",
1346 >                fprintf(stderr, "%s: internal error 1 in next_process()\n",
1347                                  progname);
1348                  quit(1);
1349          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines