48 |
|
CUBE thescene; /* our scene */ |
49 |
|
OBJECT nsceneobjs; /* number of objects in our scene */ |
50 |
|
|
51 |
+ |
extern RGBPRIMP out_prims; /* output color primitives (NULL if spectral) */ |
52 |
+ |
|
53 |
|
int dimlist[MAXDIM]; /* sampling dimensions */ |
54 |
|
int ndims = 0; /* number of sampling dimensions */ |
55 |
|
int samplendx; /* sample index number */ |
94 |
|
int backvis = 1; /* back face visibility */ |
95 |
|
|
96 |
|
int maxdepth = 7; /* maximum recursion depth */ |
97 |
< |
double minweight = 1e-3; /* minimum ray weight */ |
97 |
> |
double minweight = 1e-4; /* minimum ray weight */ |
98 |
|
|
99 |
|
char *ambfile = NULL; /* ambient file name */ |
100 |
|
COLOR ambval = BLKCOLOR; /* ambient value */ |
119 |
|
|
120 |
|
int hres, vres; /* resolution for this frame */ |
121 |
|
|
122 |
+ |
extern void sskip_ray(RAY *r, double h, double v); |
123 |
+ |
|
124 |
|
static VIEW lastview; /* the previous view input */ |
125 |
|
|
126 |
|
static void report(int); |
344 |
|
if ((pa < .99) | (pa > 1.01)) |
345 |
|
fputaspect(pa, stdout); |
346 |
|
fputnow(stdout); |
347 |
< |
fputprims(stdprims, stdout); |
348 |
< |
fputformat(COLRFMT, stdout); |
349 |
< |
putchar('\n'); |
347 |
> |
if (out_prims == xyzprims) { |
348 |
> |
fputformat(CIEFMT, stdout); |
349 |
> |
} else { |
350 |
> |
fputprims(out_prims, stdout); |
351 |
> |
fputformat(COLRFMT, stdout); |
352 |
> |
} |
353 |
> |
putchar('\n'); /* close header */ |
354 |
|
if (zout != NULL) |
355 |
|
sprintf(cp=fbuf, zout, seq); |
356 |
|
else |
386 |
|
char *oldfile |
387 |
|
) |
388 |
|
{ |
389 |
+ |
const int srcdrawing = /* manually draw tiny light sources? */ |
390 |
+ |
(directvis && dblur <= FTINY && (mblur <= FTINY) | !lastview.type); |
391 |
|
COLOR *scanbar[MAXDIV+1]; /* scanline arrays of pixel values */ |
392 |
|
float *zbar[MAXDIV+1]; /* z values */ |
393 |
|
char *sampdens; /* previous sample density */ |
454 |
|
signal(SIGCONT, report); |
455 |
|
#endif |
456 |
|
ypos = vres-1 - i; /* initialize sampling */ |
457 |
< |
if (directvis) |
457 |
> |
if (srcdrawing) |
458 |
|
init_drawsources(psample); |
459 |
|
fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep); |
460 |
|
/* compute scanlines */ |
475 |
|
hres, ypos, hstep); |
476 |
|
/* fill bar */ |
477 |
|
fillscanbar(scanbar, zbar, hres, ypos, ystep); |
478 |
< |
if (directvis) /* add bitty sources */ |
479 |
< |
drawsources(scanbar, zbar, 0, hres, ypos, ystep); |
478 |
> |
if (srcdrawing) /* add bitty sources */ |
479 |
> |
drawsources((COLORV **)scanbar, out_prims, zbar, 0, hres, ypos, ystep); |
480 |
|
/* write it out */ |
481 |
|
#ifdef SIGCONT |
482 |
|
signal(SIGCONT, SIG_IGN); /* don't interrupt writes */ |
701 |
|
return(0.0); |
702 |
|
|
703 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
704 |
< |
|
704 |
> |
#ifdef SSKIPOPT |
705 |
> |
sskip_ray(&thisray, hpos, vpos); /* source skip hack */ |
706 |
> |
#endif |
707 |
|
rayvalue(&thisray); /* trace ray */ |
708 |
< |
|
709 |
< |
copycolor(col, thisray.rcol); /* return color */ |
708 |
> |
/* -> color */ |
709 |
> |
scolor_out(col, out_prims, thisray.rcol); |
710 |
|
|
711 |
|
return(raydistance(&thisray)); /* return distance */ |
712 |
|
} |