--- ray/src/util/rad.c 2003/07/27 22:12:03 2.71 +++ ray/src/util/rad.c 2004/01/01 19:31:46 2.75 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rad.c,v 2.71 2003/07/27 22:12:03 schorsch Exp $"; +static const char RCSid[] = "$Id: rad.c,v 2.75 2004/01/01 19:31:46 greg Exp $"; #endif /* * Executive program for oconv, rpict and pfilt @@ -11,6 +11,7 @@ static const char RCSid[] = "$Id: rad.c,v 2.71 2003/07 #include #include "platform.h" +#include "rtprocess.h" #include "view.h" #include "paths.h" #include "vars.h" @@ -106,7 +107,7 @@ int silent = 0; /* do work silently */ int touchonly = 0; /* touch files only */ int nprocs = 1; /* maximum executing processes */ int sayview = 0; /* print view out */ -char *rvdevice = NULL; /* rview output device */ +char *rvdevice = NULL; /* rvu output device */ char *viewselect = NULL; /* specific view only */ int overture = 0; /* overture calculation needed */ @@ -199,7 +200,7 @@ char *argv[]; renderopts(ropts, popts); xferopts(ropts); if (rvdevice != NULL) - rview(ropts, popts); + rvu(ropts, popts); else rpict(ropts, popts); quit(0); @@ -311,7 +312,6 @@ checkfiles() /* check for existence and modified tim getoctcube(org, sizp) /* get octree bounding cube */ double org[3], *sizp; { - extern FILE *popen(); static double oorg[3], osiz = 0.; double min[3], max[3]; char buf[1024]; @@ -621,19 +621,19 @@ char *po; case LOW: po = addarg(po, "-ps 16"); op = addarg(op, "-dp 64"); - sprintf(op, " -ar %d", (int)(4*d)); + sprintf(op, " -ar %d", (int)(8*d)); op += strlen(op); break; case MEDIUM: po = addarg(po, "-ps 8"); op = addarg(op, "-dp 128"); - sprintf(op, " -ar %d", (int)(8*d)); + sprintf(op, " -ar %d", (int)(16*d)); op += strlen(op); break; case HIGH: po = addarg(po, "-ps 4"); op = addarg(op, "-dp 256"); - sprintf(op, " -ar %d", (int)(16*d)); + sprintf(op, " -ar %d", (int)(32*d)); op += strlen(op); break; } @@ -650,20 +650,20 @@ char *po; overture = 0; switch (vscale(VARIABILITY)) { case LOW: - op = addarg(op, "-aa .4 -ad 64"); + op = addarg(op, "-aa .3 -ad 256"); break; case MEDIUM: - op = addarg(op, "-aa .3 -ad 128"); + op = addarg(op, "-aa .25 -ad 512"); break; case HIGH: - op = addarg(op, "-aa .25 -ad 256"); + op = addarg(op, "-aa .2 -ad 1024"); break; } op = addarg(op, "-as 0"); d = ambval(); sprintf(op, " -av %.2g %.2g %.2g", d, d, d); op += strlen(op); - op = addarg(op, "-lr 3 -lw .02"); + op = addarg(op, "-lr 6 -lw .01"); if (vdef(RENDER)) op = addarg(op, vval(RENDER)); } @@ -690,7 +690,7 @@ char *po; case LOW: po = addarg(po, vbool(PENUMBRAS) ? "-ps 4" : "-ps 8"); op = addarg(op, "-dp 256"); - sprintf(op, " -ar %d", (int)(8*d)); + sprintf(op, " -ar %d", (int)(16*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/20.); op += strlen(op); @@ -698,7 +698,7 @@ char *po; case MEDIUM: po = addarg(po, vbool(PENUMBRAS) ? "-ps 3" : "-ps 6"); op = addarg(op, "-dp 512"); - sprintf(op, " -ar %d", (int)(16*d)); + sprintf(op, " -ar %d", (int)(32*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/40.); op += strlen(op); @@ -706,7 +706,7 @@ char *po; case HIGH: po = addarg(po, vbool(PENUMBRAS) ? "-ps 2" : "-ps 4"); op = addarg(op, "-dp 1024"); - sprintf(op, " -ar %d", (int)(32*d)); + sprintf(op, " -ar %d", (int)(64*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/80.); op += strlen(op); @@ -729,19 +729,19 @@ char *po; overture = 0; switch (vscale(VARIABILITY)) { case LOW: - op = addarg(op, "-aa .25 -ad 196 -as 0"); + op = addarg(op, "-aa .2 -ad 329 -as 42"); break; case MEDIUM: - op = addarg(op, "-aa .2 -ad 400 -as 64"); + op = addarg(op, "-aa .15 -ad 800 -as 128"); break; case HIGH: - op = addarg(op, "-aa .15 -ad 768 -as 196"); + op = addarg(op, "-aa .1 -ad 1536 -as 392"); break; } d = ambval(); sprintf(op, " -av %.2g %.2g %.2g", d, d, d); op += strlen(op); - op = addarg(op, "-lr 6 -lw .002"); + op = addarg(op, "-lr 8 -lw .002"); if (vdef(RENDER)) op = addarg(op, vval(RENDER)); } @@ -768,7 +768,7 @@ char *po; case LOW: po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 8"); op = addarg(op, "-dp 1024"); - sprintf(op, " -ar %d", (int)(16*d)); + sprintf(op, " -ar %d", (int)(32*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/40.); op += strlen(op); @@ -776,7 +776,7 @@ char *po; case MEDIUM: po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 5"); op = addarg(op, "-dp 2048"); - sprintf(op, " -ar %d", (int)(32*d)); + sprintf(op, " -ar %d", (int)(64*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/80.); op += strlen(op); @@ -784,7 +784,7 @@ char *po; case HIGH: po = addarg(po, vbool(PENUMBRAS) ? "-ps 1" : "-ps 3"); op = addarg(op, "-dp 4096"); - sprintf(op, " -ar %d", (int)(64*d)); + sprintf(op, " -ar %d", (int)(128*d)); op += strlen(op); sprintf(op, " -ms %.2g", asz/160.); op += strlen(op); @@ -805,13 +805,13 @@ char *po; overture = 0; switch (vscale(VARIABILITY)) { case LOW: - op = addarg(op, "-aa .15 -ad 256 -as 0"); + op = addarg(op, "-aa .125 -ad 512 -as 64"); break; case MEDIUM: - op = addarg(op, "-aa .125 -ad 512 -as 256"); + op = addarg(op, "-aa .1 -ad 1536 -as 768"); break; case HIGH: - op = addarg(op, "-aa .08 -ad 1024 -as 512"); + op = addarg(op, "-aa .075 -ad 4096 -as 2048"); break; } d = ambval(); @@ -1083,7 +1083,7 @@ again: } -rview(opts, po) /* run rview with first view */ +rvu(opts, po) /* run rvu with first view */ char *opts, *po; { char *vw; @@ -1093,14 +1093,14 @@ char *opts, *po; return; if (sayview) myprintview(vw, stdout); - sprintf(combuf, "rview %s%s%s -R %s ", vw, po, opts, rifname); + sprintf(combuf, "rvu %s%s%s -R %s ", vw, po, opts, rifname); if (rvdevice != NULL) sprintf(combuf+strlen(combuf), "-o %s ", rvdevice); if (vdef(EXPOSURE)) sprintf(combuf+strlen(combuf), "-pe %s ", vval(EXPOSURE)); strcat(combuf, oct1name); if (runcom(combuf)) { /* run it */ - fprintf(stderr, "%s: error running rview\n", progname); + fprintf(stderr, "%s: error running rvu\n", progname); quit(1); } } @@ -1264,7 +1264,7 @@ char *opts, *po; mvfile(rawfile, combuf); } else rmfile(rawfile); - finish_process(); /* leave if child */ + finish_process(); /* exit if child */ } wait_process(1); /* wait for children to finish */ if (pfile != NULL) { /* clean up rpict persistent mode */ @@ -1272,7 +1272,7 @@ char *opts, *po; fp = fopen(pfile, "r"); if (fp != NULL) { if (fscanf(fp, "%*s %d", &pid) != 1 || - kill(pid, 1) == -1) + kill(pid, 1) < 0) unlink(pfile); fclose(fp); } @@ -1343,7 +1343,7 @@ next_process() /* fork the next process (max. nprocs if (nprocs <= 1) return(0); /* it's us or no one */ if (inchild()) { - fprintf(stderr, "%s: internal error 1 in spawn_process()\n", + fprintf(stderr, "%s: internal error 1 in next_process()\n", progname); quit(1); }