--- ray/src/util/ranimove1.c 2004/05/13 15:45:43 3.9 +++ ray/src/util/ranimove1.c 2005/12/20 03:49:51 3.12 @@ -1,10 +1,10 @@ #ifndef lint -static const char RCSid[] = "$Id: ranimove1.c,v 3.9 2004/05/13 15:45:43 greg Exp $"; +static const char RCSid[] = "$Id: ranimove1.c,v 3.12 2005/12/20 03:49:51 greg Exp $"; #endif /* * ranimove1.c * - * Basic frame rendering routines for ranimate(1). + * Basic frame rendering routines for ranimove(1). * * Created by Gregory Ward on Wed Jan 08 2003. */ @@ -367,7 +367,7 @@ init_frame_sample(void) /* sample our initial frame * continue; } if (!sample_here(x, y)) { /* just cast */ - rayorigin(&ir, NULL, PRIMARY, 1.0); + rayorigin(&ir, PRIMARY, NULL, NULL); if (!localhit(&ir, &thescene)) { if (ir.ro != &Aftplane) sourcehit(&ir); @@ -385,7 +385,7 @@ init_frame_sample(void) /* sample our initial frame * } if (nprocs > 1) { /* get sample */ int rval; - rayorigin(&ir, NULL, PRIMARY, 1.0); + rayorigin(&ir, PRIMARY, NULL, NULL); ir.rno = n; rval = ray_pqueue(&ir); if (!rval) @@ -762,6 +762,16 @@ filter_frame(void) /* interpolation, motion-blur, an continue; nc = getclosest(neigh, NPINTERP, x, y); setcolor(cbuffer[n], 0., 0., 0.); + if (nc <= 0) { /* no acceptable neighbors */ + if (y < vres-1) + nc = fndx(x, y+1); + else if (x < hres-1) + nc = fndx(x+1, y); + else + continue; + copycolor(cbuffer[n], cbuffer[nc]); + continue; + } wsum = 0.; while (nc-- > 0) { copycolor(cval, cbuffer[neigh[nc]]); @@ -771,10 +781,8 @@ filter_frame(void) /* interpolation, motion-blur, an addcolor(cbuffer[n], cval); wsum += w; } - if (wsum > FTINY) { - w = 1.0/wsum; - scalecolor(cbuffer[n], w); - } + w = 1.0/wsum; + scalecolor(cbuffer[n], w); } /* motion blur if requested */ if (mblur > .02) {