658 |
|
init_frame(void) /* render base (low quality) frame */ |
659 |
|
{ |
660 |
|
int restart; |
661 |
– |
|
661 |
|
/* allocate/swap buffers */ |
662 |
|
next_frame(); |
663 |
|
/* check rendering status */ |
666 |
|
restart = -1; |
667 |
|
if (restart > 0) { |
668 |
|
if (nprocs > 1) |
669 |
< |
ray_pdone(1); |
669 |
> |
ray_pdone(0); |
670 |
|
else |
671 |
< |
ray_done(1); |
671 |
> |
ray_done(0); |
672 |
|
} |
673 |
|
/* post low quality parameters */ |
674 |
|
if (curparams != &lorendparams) |
761 |
|
continue; |
762 |
|
nc = getclosest(neigh, NPINTERP, x, y); |
763 |
|
setcolor(cbuffer[n], 0., 0., 0.); |
764 |
+ |
if (nc <= 0) { /* no acceptable neighbors */ |
765 |
+ |
if (y < vres-1) |
766 |
+ |
nc = fndx(x, y+1); |
767 |
+ |
else if (x < hres-1) |
768 |
+ |
nc = fndx(x+1, y); |
769 |
+ |
else |
770 |
+ |
continue; |
771 |
+ |
copycolor(cbuffer[n], cbuffer[nc]); |
772 |
+ |
continue; |
773 |
+ |
} |
774 |
|
wsum = 0.; |
775 |
|
while (nc-- > 0) { |
776 |
|
copycolor(cval, cbuffer[neigh[nc]]); |
780 |
|
addcolor(cbuffer[n], cval); |
781 |
|
wsum += w; |
782 |
|
} |
783 |
< |
if (wsum > FTINY) { |
784 |
< |
w = 1.0/wsum; |
776 |
< |
scalecolor(cbuffer[n], w); |
777 |
< |
} |
783 |
> |
w = 1.0/wsum; |
784 |
> |
scalecolor(cbuffer[n], w); |
785 |
|
} |
786 |
|
/* motion blur if requested */ |
787 |
|
if (mblur > .02) { |