--- ray/src/gen/mkillum.c 1991/07/25 15:31:30 1.9 +++ ray/src/gen/mkillum.c 1992/03/11 11:09:57 2.2 @@ -18,6 +18,7 @@ static char SCCSid[] = "$SunId$ LBL"; #define SAMPDENS 48 /* points per projected steradian */ #define NSAMPS 32 /* samples per point */ #define DFLMAT "illum_mat" /* material name */ +#define DFLDAT "illum" /* data file name */ /* selection options */ #define S_NONE 0 /* select none */ #define S_ELEM 1 /* select specified element */ @@ -36,11 +37,12 @@ struct rtproc rt; /* our rtrace process */ struct illum_args thisillum = { /* our illum and default values */ 0, DFLMAT, - DFLMAT, + DFLDAT, 0, VOIDID, SAMPDENS, NSAMPS, + 0., }; char matcheck[MAXSTR]; /* current material to include or exclude */ @@ -145,6 +147,7 @@ init() /* start rtrace and set up buffers */ /* set up signal handling */ signal(SIGPIPE, quit); /* start rtrace process */ + errno = 0; maxbytes = open_process(rt.pd, rtargv); if (maxbytes == 0) { eputs(rtargv[0]); @@ -257,6 +260,7 @@ char *nm; break; if (!*++cp) { strcpy(thisillum.datafile,thisillum.matname); + thisillum.dfnum = 0; thisillum.flags &= ~IL_DATCLB; continue; } @@ -327,6 +331,16 @@ char *nm; break; cp++; continue; + case 'b': /* brightness */ + if (*++cp != '=') + break; + if (!isfltd(++cp, " \t\n")) + break; + thisillum.minbrt = atof(cp); + if (thisillum.minbrt < 0.) + thisillum.minbrt = 0.; + cp = sskip(cp); + continue; case 'o': /* output file */ if (*++cp != '=') break; @@ -369,11 +383,22 @@ char *nm; printopts() /* print out option default values */ { - printf("m=%s\t\t\t# material name\n", thisillum.matname); - printf("f=%s\t\t\t# data file name\n", thisillum.datafile); - printf("c=n\t\t\t\t# color none\n"); + printf("m=%-15s\t\t# material name\n", thisillum.matname); + printf("f=%-15s\t\t# data file name\n", thisillum.datafile); + if (thisillum.flags & IL_COLAVG) + if (thisillum.flags & IL_COLDST) + printf("c=d\t\t\t\t# color distribution\n"); + else + printf("c=a\t\t\t\t# color average\n"); + else + printf("c=n\t\t\t\t# color none\n"); + if (thisillum.flags & IL_LIGHT) + 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("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); }