4 |
|
/* |
5 |
|
* ranimove1.c |
6 |
|
* |
7 |
< |
* Basic frame rendering routines for ranimate(1). |
7 |
> |
* Basic frame rendering routines for ranimove(1). |
8 |
|
* |
9 |
|
* Created by Gregory Ward on Wed Jan 08 2003. |
10 |
|
*/ |
367 |
|
continue; |
368 |
|
} |
369 |
|
if (!sample_here(x, y)) { /* just cast */ |
370 |
< |
rayorigin(&ir, NULL, PRIMARY, 1.0); |
370 |
> |
rayorigin(&ir, PRIMARY, NULL, NULL); |
371 |
|
if (!localhit(&ir, &thescene)) { |
372 |
|
if (ir.ro != &Aftplane) |
373 |
|
sourcehit(&ir); |
385 |
|
} |
386 |
|
if (nprocs > 1) { /* get sample */ |
387 |
|
int rval; |
388 |
< |
rayorigin(&ir, NULL, PRIMARY, 1.0); |
388 |
> |
rayorigin(&ir, PRIMARY, NULL, NULL); |
389 |
|
ir.rno = n; |
390 |
|
rval = ray_pqueue(&ir); |
391 |
|
if (!rval) |
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) { |