38 |
|
#define ZONE 9 /* simulation zone */ |
39 |
|
#define QUALITY 10 /* desired rendering quality */ |
40 |
|
#define OCTREE 11 /* octree file name */ |
41 |
< |
#define PICTURE 12 /* picture file name */ |
41 |
> |
#define PICTURE 12 /* picture file root name */ |
42 |
|
#define AMBFILE 13 /* ambient file name */ |
43 |
|
#define OPTFILE 14 /* rendering options file */ |
44 |
|
#define EXPOSURE 15 /* picture exposure setting */ |
49 |
|
#define PENUMBRAS 20 /* shadow penumbras are desired */ |
50 |
|
#define VARIABILITY 21 /* level of light variability */ |
51 |
|
#define REPORT 22 /* report frequency and errfile */ |
52 |
< |
#define RAWSAVE 23 /* save raw picture file */ |
52 |
> |
#define RAWFILE 23 /* raw picture file root name */ |
53 |
> |
#define ZFILE 24 /* distance file root name */ |
54 |
|
/* total number of variables */ |
55 |
< |
#define NVARS 24 |
55 |
> |
#define NVARS 25 |
56 |
|
|
57 |
|
VARIABLE vv[NVARS] = { /* variable-value pairs */ |
58 |
|
{"objects", 3, 0, NULL, catvalues}, |
78 |
|
{"PENUMBRAS", 3, 0, NULL, boolvalue}, |
79 |
|
{"VARIABILITY", 3, 0, NULL, qualvalue}, |
80 |
|
{"REPORT", 3, 0, NULL, onevalue}, |
81 |
< |
{"RAWSAVE", 3, 0, NULL, boolvalue}, |
81 |
> |
{"RAWFILE", 3, 0, NULL, onevalue}, |
82 |
> |
{"ZFILE", 2, 0, NULL, onevalue}, |
83 |
|
}; |
84 |
|
|
85 |
|
VARIABLE *matchvar(); |
101 |
|
|
102 |
|
/* overture calculation file */ |
103 |
|
#ifdef NIX |
104 |
< |
char overfile[] = "overture.raw"; |
104 |
> |
char overfile[] = "overture.unf"; |
105 |
|
#else |
106 |
|
char overfile[] = "/dev/null"; |
107 |
|
#endif |
651 |
|
vval(VARIABILITY) = "L"; |
652 |
|
vdef(VARIABILITY)++; |
653 |
|
} |
652 |
– |
if (!vdef(RAWSAVE)) { |
653 |
– |
vval(RAWSAVE) = "F"; |
654 |
– |
vdef(RAWSAVE)++; |
655 |
– |
} |
654 |
|
} |
655 |
|
|
656 |
|
|
1389 |
|
char *opts, *po; |
1390 |
|
{ |
1391 |
|
char combuf[1024]; |
1392 |
< |
char rawfile[MAXPATH], picfile[MAXPATH], rep[MAXPATH+16], res[32]; |
1392 |
> |
char rawfile[MAXPATH], picfile[MAXPATH]; |
1393 |
> |
char zopt[MAXPATH+4], rep[MAXPATH+16], res[32]; |
1394 |
|
char pfopts[128]; |
1395 |
|
char vs[32], *vw; |
1396 |
|
int vn, mult; |
1443 |
|
if (!vs[0]) |
1444 |
|
sprintf(vs, "%d", vn); |
1445 |
|
sprintf(picfile, "%s_%s.pic", vval(PICTURE), vs); |
1446 |
+ |
if (vdef(ZFILE)) |
1447 |
+ |
sprintf(zopt, " -z %s_%s.zbf", vval(ZFILE), vs); |
1448 |
+ |
else |
1449 |
+ |
zopt[0] = '\0'; |
1450 |
|
/* check date on picture */ |
1451 |
|
pfdt = fdate(picfile); |
1452 |
|
if (pfdt >= oct1date) |
1453 |
|
continue; |
1454 |
|
/* get raw file name */ |
1455 |
< |
sprintf(rawfile, "%s_%s.raw", vval(PICTURE), vs); |
1455 |
> |
sprintf(rawfile, "%s_%s.unf", |
1456 |
> |
vdef(RAWFILE) ? vval(RAWFILE) : vval(PICTURE), vs); |
1457 |
|
rfdt = fdate(rawfile); |
1458 |
|
if (touchonly) { /* update times only */ |
1459 |
|
if (rfdt) { |
1465 |
|
} |
1466 |
|
/* build rpict command */ |
1467 |
|
if (rfdt >= oct1date) /* recover */ |
1468 |
< |
sprintf(combuf, "rpict%s%s%s -ro %s %s", |
1469 |
< |
rep, po, opts, rawfile, oct1name); |
1468 |
> |
sprintf(combuf, "rpict%s%s%s%s -ro %s %s", |
1469 |
> |
rep, po, opts, zopt, rawfile, oct1name); |
1470 |
|
else { |
1471 |
|
if (overture) { /* run overture calculation */ |
1472 |
|
sprintf(combuf, |
1483 |
|
rmfile(overfile); |
1484 |
|
#endif |
1485 |
|
} |
1486 |
< |
sprintf(combuf, "rpict%s %s %s%s%s %s > %s", |
1487 |
< |
rep, vw, res, po, opts, |
1488 |
< |
oct1name, rawfile); |
1486 |
> |
sprintf(combuf, "rpict%s %s %s%s%s%s %s > %s", |
1487 |
> |
rep, vw, res, po, opts, zopt, |
1488 |
> |
oct1name, rawfile); |
1489 |
|
} |
1490 |
|
if (runcom(combuf)) { /* run rpict */ |
1491 |
|
fprintf(stderr, "%s: error rendering view %s\n", |
1492 |
|
progname, vs); |
1493 |
|
exit(1); |
1494 |
|
} |
1495 |
+ |
if (!vdef(RAWFILE) || strcmp(vval(RAWFILE),vval(PICTURE))) { |
1496 |
|
/* build pfilt command */ |
1497 |
< |
if (mult > 1) |
1498 |
< |
sprintf(combuf, "pfilt%s -x /%d -y /%d %s > %s", |
1497 |
> |
if (mult > 1) |
1498 |
> |
sprintf(combuf, "pfilt%s -x /%d -y /%d %s > %s", |
1499 |
|
pfopts, mult, mult, rawfile, picfile); |
1500 |
< |
else |
1501 |
< |
sprintf(combuf, "pfilt%s %s > %s", pfopts, |
1502 |
< |
rawfile, picfile); |
1503 |
< |
if (runcom(combuf)) { /* run pfilt */ |
1504 |
< |
fprintf(stderr, |
1505 |
< |
"%s: error filtering view %s\n\t%s removed\n", |
1506 |
< |
progname, vs, picfile); |
1507 |
< |
unlink(picfile); |
1508 |
< |
exit(1); |
1500 |
> |
else |
1501 |
> |
sprintf(combuf, "pfilt%s %s > %s", pfopts, |
1502 |
> |
rawfile, picfile); |
1503 |
> |
if (runcom(combuf)) { /* run pfilt */ |
1504 |
> |
fprintf(stderr, |
1505 |
> |
"%s: error filtering view %s\n\t%s removed\n", |
1506 |
> |
progname, vs, picfile); |
1507 |
> |
unlink(picfile); |
1508 |
> |
exit(1); |
1509 |
> |
} |
1510 |
|
} |
1511 |
|
/* remove/rename raw file */ |
1512 |
< |
if (vbool(RAWSAVE)) { |
1513 |
< |
sprintf(combuf, "%s_%s.rwp", vval(PICTURE), vs); |
1512 |
> |
if (vdef(RAWFILE)) { |
1513 |
> |
sprintf(combuf, "%s_%s.pic", vval(RAWFILE), vs); |
1514 |
|
mvfile(rawfile, combuf); |
1515 |
|
} else |
1516 |
|
rmfile(rawfile); |