8 |
|
#include <signal.h> |
9 |
|
#include <ctype.h> |
10 |
|
|
11 |
< |
#include "platform.h" |
11 |
> |
#include "paths.h" /* win_popen() */ |
12 |
|
#include "mkillum.h" |
13 |
– |
#include "random.h" |
13 |
|
|
14 |
|
/* default parameters */ |
15 |
|
#define SAMPDENS 48 /* points per projected steradian */ |
66 |
|
gargv = argv; |
67 |
|
progname = gargv[0]; |
68 |
|
/* set up rendering defaults */ |
69 |
< |
dstrsrc = 0.25; |
69 |
> |
dstrsrc = 0.5; |
70 |
|
directrelay = 3; |
72 |
– |
directvis = 0; |
71 |
|
ambounce = 2; |
72 |
|
/* get options from command line */ |
73 |
|
for (i = 1; i < argc; i++) { |
110 |
|
init(argv[gargc-1], nprocs); |
111 |
|
if (gargc < argc) { |
112 |
|
if (gargc == argc-1 || argv[gargc][0] != '<' || argv[gargc][1]) |
113 |
< |
error(USER, "Use '< file1 file2 ..' for multiple inputs"); |
113 |
> |
error(USER, "use '< file1 file2 ..' for multiple inputs"); |
114 |
|
for (i = gargc+1; i < argc; i++) { |
115 |
|
if ((fp = fopen(argv[i], "r")) == NULL) { |
116 |
|
sprintf(errmsg, |
173 |
|
|
174 |
|
|
175 |
|
void |
176 |
+ |
quit(ec) /* make sure exit is called */ |
177 |
+ |
int ec; |
178 |
+ |
{ |
179 |
+ |
if (ray_pnprocs > 0) /* close children if any */ |
180 |
+ |
ray_pclose(0); |
181 |
+ |
exit(ec); |
182 |
+ |
} |
183 |
+ |
|
184 |
+ |
|
185 |
+ |
void |
186 |
|
filter( /* process stream */ |
187 |
|
register FILE *infp, |
188 |
|
char *name |
224 |
|
{ |
225 |
|
extern FILE *freopen(); |
226 |
|
char buf[64]; |
227 |
+ |
int negax; |
228 |
|
int nerrs = 0; |
229 |
|
register char *cp; |
230 |
|
|
304 |
|
} |
305 |
|
cp = sskip(cp); |
306 |
|
continue; |
307 |
< |
case 'd': /* point sample density */ |
307 |
> |
case 'd': /* sample density */ |
308 |
|
if (*++cp != '=') |
309 |
|
break; |
310 |
< |
if (!isintd(++cp, " \t\n\r")) |
311 |
< |
break; |
312 |
< |
thisillum.sampdens = atoi(cp); |
310 |
> |
if (!*++cp || isspace(*cp)) |
311 |
> |
continue; |
312 |
> |
if (isintd(cp, " \t\n\r")) { |
313 |
> |
thisillum.sampdens = atoi(cp); |
314 |
> |
} else { |
315 |
> |
error(WARNING, "direct BSDF input unsupported"); |
316 |
> |
goto opterr; |
317 |
> |
} |
318 |
|
cp = sskip(cp); |
319 |
|
continue; |
320 |
< |
case 's': /* point super-samples */ |
320 |
> |
case 's': /* surface super-samples */ |
321 |
|
if (*++cp != '=') |
322 |
|
break; |
323 |
|
if (!isintd(++cp, " \t\n\r")) |
401 |
|
printf("l+\t\t\t\t# light type on\n"); |
402 |
|
else |
403 |
|
printf("l-\t\t\t\t# light type off\n"); |
404 |
< |
printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); |
405 |
< |
printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); |
404 |
> |
printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens); |
405 |
> |
printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps); |
406 |
|
printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); |
407 |
|
} |
408 |
|
|