8 |
|
#include <signal.h> |
9 |
|
#include <ctype.h> |
10 |
|
|
11 |
– |
#include "platform.h" |
11 |
|
#include "mkillum.h" |
13 |
– |
#include "random.h" |
12 |
|
|
13 |
|
/* default parameters */ |
14 |
|
#define SAMPDENS 48 /* points per projected steradian */ |
68 |
|
gargv = argv; |
69 |
|
progname = gargv[0]; |
70 |
|
/* set up rendering defaults */ |
71 |
< |
dstrsrc = 0.25; |
71 |
> |
dstrsrc = 0.5; |
72 |
|
directrelay = 3; |
75 |
– |
directvis = 0; |
73 |
|
ambounce = 2; |
74 |
|
/* get options from command line */ |
75 |
|
for (i = 1; i < argc; i++) { |
175 |
|
|
176 |
|
|
177 |
|
void |
178 |
+ |
quit(ec) /* make sure exit is called */ |
179 |
+ |
int ec; |
180 |
+ |
{ |
181 |
+ |
if (ray_pnprocs > 0) /* close children if any */ |
182 |
+ |
ray_pclose(0); |
183 |
+ |
exit(ec); |
184 |
+ |
} |
185 |
+ |
|
186 |
+ |
|
187 |
+ |
void |
188 |
|
filter( /* process stream */ |
189 |
|
register FILE *infp, |
190 |
|
char *name |
315 |
|
} |
316 |
|
if (!*++cp || isspace(*cp)) |
317 |
|
continue; |
318 |
< |
if (isintd(++cp, " \t\n\r")) { |
318 |
> |
if (isintd(cp, " \t\n\r")) { |
319 |
|
thisillum.sampdens = atoi(cp); |
320 |
|
} else { |
321 |
|
atos(buf, sizeof(buf), cp); |
392 |
|
break; |
393 |
|
case 'z': |
394 |
|
case 'Z': |
395 |
< |
thisillum.udir = negax ? UDxneg : UDxpos; |
395 |
> |
thisillum.udir = negax ? UDzneg : UDzpos; |
396 |
|
break; |
397 |
|
default: |
398 |
|
thisillum.udir = UDunknown; |
453 |
|
printf("l+\t\t\t\t# light type on\n"); |
454 |
|
else |
455 |
|
printf("l-\t\t\t\t# light type off\n"); |
456 |
< |
printf("d=%d\t\t\t\t# density of points\n", thisillum.sampdens); |
457 |
< |
printf("s=%d\t\t\t\t# samples per point\n", thisillum.nsamps); |
456 |
> |
printf("d=%d\t\t\t\t# density of directions\n", thisillum.sampdens); |
457 |
> |
printf("s=%d\t\t\t\t# samples per direction\n", thisillum.nsamps); |
458 |
|
printf("b=%f\t\t\t# minimum average brightness\n", thisillum.minbrt); |
459 |
|
switch (thisillum.udir) { |
460 |
|
case UDzneg: |