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 */ |
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); |
289 |
|
do { |
290 |
|
if (seq && nextview(stdin) == EOF) |
291 |
|
break; |
292 |
+ |
lastview.type *= seq > 1; |
293 |
|
pctdone = 0.0; |
294 |
|
if (pout != NULL) { |
295 |
|
int myfd; |
345 |
|
if ((pa < .99) | (pa > 1.01)) |
346 |
|
fputaspect(pa, stdout); |
347 |
|
fputnow(stdout); |
348 |
< |
fputprims(stdprims, stdout); |
349 |
< |
fputformat(COLRFMT, stdout); |
350 |
< |
putchar('\n'); |
348 |
> |
if (out_prims == xyzprims) { |
349 |
> |
fputformat(CIEFMT, stdout); |
350 |
> |
} else { |
351 |
> |
fputprims(out_prims, stdout); |
352 |
> |
fputformat(COLRFMT, stdout); |
353 |
> |
} |
354 |
> |
putchar('\n'); /* close header */ |
355 |
|
if (zout != NULL) |
356 |
|
sprintf(cp=fbuf, zout, seq); |
357 |
|
else |
387 |
|
char *oldfile |
388 |
|
) |
389 |
|
{ |
390 |
+ |
const int srcdrawing = /* manually draw tiny light sources? */ |
391 |
+ |
(directvis && dblur <= FTINY && (mblur <= FTINY) | !lastview.type); |
392 |
|
COLOR *scanbar[MAXDIV+1]; /* scanline arrays of pixel values */ |
393 |
|
float *zbar[MAXDIV+1]; /* z values */ |
394 |
|
char *sampdens; /* previous sample density */ |
455 |
|
signal(SIGCONT, report); |
456 |
|
#endif |
457 |
|
ypos = vres-1 - i; /* initialize sampling */ |
458 |
< |
if (directvis) |
458 |
> |
if (srcdrawing) |
459 |
|
init_drawsources(psample); |
460 |
|
fillscanline(scanbar[0], zbar[0], sampdens, hres, ypos, hstep); |
461 |
|
/* compute scanlines */ |
476 |
|
hres, ypos, hstep); |
477 |
|
/* fill bar */ |
478 |
|
fillscanbar(scanbar, zbar, hres, ypos, ystep); |
479 |
< |
if (directvis) /* add bitty sources */ |
480 |
< |
drawsources(scanbar, zbar, 0, hres, ypos, ystep); |
479 |
> |
if (srcdrawing) /* add bitty sources */ |
480 |
> |
drawsources((COLORV **)scanbar, out_prims, zbar, 0, hres, ypos, ystep); |
481 |
|
/* write it out */ |
482 |
|
#ifdef SIGCONT |
483 |
|
signal(SIGCONT, SIG_IGN); /* don't interrupt writes */ |
704 |
|
rayorigin(&thisray, PRIMARY, NULL, NULL); |
705 |
|
|
706 |
|
rayvalue(&thisray); /* trace ray */ |
707 |
< |
|
708 |
< |
copycolor(col, thisray.rcol); /* return color */ |
707 |
> |
/* -> color */ |
708 |
> |
scolor_out(col, out_prims, thisray.rcol); |
709 |
|
|
710 |
|
return(raydistance(&thisray)); /* return distance */ |
711 |
|
} |