--- ray/src/gen/mkillum.c 2007/09/18 19:51:07 2.30 +++ ray/src/gen/mkillum.c 2009/12/12 19:00:59 2.36 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: mkillum.c,v 2.30 2007/09/18 19:51:07 greg Exp $"; +static const char RCSid[] = "$Id: mkillum.c,v 2.36 2009/12/12 19:00:59 greg Exp $"; #endif /* * Make illum sources for optimizing rendering process @@ -8,9 +8,7 @@ static const char RCSid[] = "$Id: mkillum.c,v 2.30 200 #include #include -#include "platform.h" #include "mkillum.h" -#include "random.h" /* default parameters */ #define SAMPDENS 48 /* points per projected steradian */ @@ -26,6 +24,7 @@ static const char RCSid[] = "$Id: mkillum.c,v 2.30 200 struct illum_args thisillum = { /* our illum and default values */ 0, UDzpos, + 0., DFLMAT, DFLDAT, 0, @@ -69,7 +68,7 @@ main( /* compute illum distributions using rtrace */ gargv = argv; progname = gargv[0]; /* set up rendering defaults */ - dstrsrc = 0.25; + dstrsrc = 0.5; directrelay = 3; directvis = 0; ambounce = 2; @@ -177,6 +176,16 @@ char *s; void +quit(ec) /* make sure exit is called */ +int ec; +{ + if (ray_pnprocs > 0) /* close children if any */ + ray_pclose(0); + exit(ec); +} + + +void filter( /* process stream */ register FILE *infp, char *name @@ -307,7 +316,7 @@ xoptions( /* process options in string s */ } if (!*++cp || isspace(*cp)) continue; - if (isintd(++cp, " \t\n\r")) { + if (isintd(cp, " \t\n\r")) { thisillum.sampdens = atoi(cp); } else { atos(buf, sizeof(buf), cp); @@ -384,7 +393,7 @@ xoptions( /* process options in string s */ break; case 'z': case 'Z': - thisillum.udir = negax ? UDxneg : UDxpos; + thisillum.udir = negax ? UDzneg : UDzpos; break; default: thisillum.udir = UDunknown; @@ -393,6 +402,16 @@ xoptions( /* process options in string s */ if (thisillum.udir == UDunknown || !isspace(*cp)) break; continue; + case 't': /* object thickness */ + if (*++cp != '=') + break; + if (!isfltd(++cp, " \t\n\r")) + break; + thisillum.thick = atof(cp); + if (thisillum.thick < .0) + thisillum.thick = .0; + cp = sskip(cp); + continue; case '!': /* processed file! */ sprintf(errmsg, "(%s): already processed!", nm); error(WARNING, errmsg); @@ -435,8 +454,8 @@ printopts(void) /* print out option default values * printf("l+\t\t\t\t# light type on\n"); else printf("l-\t\t\t\t# light type off\n"); - printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); - printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); + printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens); + printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps); printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); switch (thisillum.udir) { case UDzneg: @@ -460,6 +479,7 @@ printopts(void) /* print out option default values * case UDunknown: break; } + printf("t=%f\t\t\t# object thickness\n", thisillum.thick); }