34 |
|
double shadthresh = .1; /* shadow threshold */ |
35 |
|
double shadcert = .25; /* shadow certainty */ |
36 |
|
int directrelay = 0; /* number of source relays */ |
37 |
< |
int vspretest = 32; /* virtual source pretest density */ |
37 |
> |
int vspretest = 128; /* virtual source pretest density */ |
38 |
> |
int directinvis = 0; /* sources invisible? */ |
39 |
> |
double srcsizerat = 0.; /* maximum ratio source size/dist. */ |
40 |
|
|
41 |
+ |
double specthresh = .5; /* specular sampling threshold */ |
42 |
+ |
double specjitter = 1.; /* specular sampling jitter */ |
43 |
+ |
|
44 |
|
int maxdepth = 4; /* maximum recursion depth */ |
45 |
|
double minweight = 1e-2; /* minimum ray weight */ |
46 |
|
|
66 |
|
|
67 |
|
static char *reserve_mem = NULL; /* pre-allocated reserve memory */ |
68 |
|
|
69 |
< |
#define RESERVE_AMT 8192 /* amount of memory to reserve */ |
69 |
> |
#define RESERVE_AMT 32768 /* amount of memory to reserve */ |
70 |
|
|
71 |
< |
#define CTRL(c) ('c'-'@') |
71 |
> |
#define CTRL(c) ((c)-'@') |
72 |
|
|
73 |
|
|
74 |
|
quit(code) /* quit program */ |
173 |
|
char *prompt; |
174 |
|
{ |
175 |
|
#define badcom(s) strncmp(s, inpbuf, args-inpbuf-1) |
171 |
– |
double atof(); |
176 |
|
char inpbuf[256]; |
177 |
|
char *args; |
178 |
|
again: |
225 |
|
break; |
226 |
|
case 'm': /* move camera */ |
227 |
|
if (badcom("move")) |
228 |
+ |
#ifdef MSTATS |
229 |
+ |
{ |
230 |
+ |
if (badcom("memory")) |
231 |
+ |
goto commerr; |
232 |
+ |
printmemstats(stderr); |
233 |
+ |
break; |
234 |
+ |
} |
235 |
+ |
#else |
236 |
|
goto commerr; |
237 |
+ |
#endif |
238 |
|
getmove(args); |
239 |
|
break; |
240 |
|
case 'r': /* rotate/repaint */ |
251 |
|
goto commerr; |
252 |
|
getpivot(args); |
253 |
|
break; |
254 |
< |
case CTRL(R): /* redraw */ |
254 |
> |
case CTRL('R'): /* redraw */ |
255 |
|
redraw(); |
256 |
|
break; |
257 |
|
case 'w': /* write */ |
263 |
|
if (badcom("quit")) |
264 |
|
goto commerr; |
265 |
|
quit(0); |
266 |
< |
case CTRL(C): /* interrupt */ |
266 |
> |
case CTRL('C'): /* interrupt */ |
267 |
|
goto again; |
268 |
|
#ifdef SIGTSTP |
269 |
< |
case CTRL(Z): /* stop */ |
269 |
> |
case CTRL('Z'): /* stop */ |
270 |
|
devclose(); |
271 |
|
kill(0, SIGTSTP); |
272 |
|
/* pc stops here */ |
328 |
|
/* sample the image */ |
329 |
|
for (y = 0; /* y < ysiz */ ; y++) { |
330 |
|
for (x = 0; x < xsiz-1; x++) { |
331 |
< |
if (dev->inpready) |
331 |
> |
if (dev->inpready || errno == ENOMEM) |
332 |
|
goto escape; |
333 |
|
/* |
334 |
|
* Test super-pixel to the right. |
344 |
|
if (y >= ysiz-1) |
345 |
|
break; |
346 |
|
for (x = 0; x < xsiz; x++) { |
347 |
< |
if (dev->inpready) |
347 |
> |
if (dev->inpready || errno == ENOMEM) |
348 |
|
goto escape; |
349 |
|
/* |
350 |
|
* Find super-pixel at this position in next row. |
399 |
|
if (p->kid == NULL) { /* subdivide */ |
400 |
|
|
401 |
|
if ((p->kid = newptree()) == NULL) |
402 |
< |
return(growth); |
402 |
> |
return(0); |
403 |
|
/* |
404 |
|
* The following paint order can leave a black pixel |
405 |
|
* when redraw() is called in (*dev->paintr)(). |