--- ray/src/util/ranimove1.c 2004/05/13 15:45:43 3.9 +++ ray/src/util/ranimove1.c 2008/04/17 14:44:25 3.13 @@ -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.13 2008/04/17 14:44:25 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) @@ -658,7 +658,6 @@ extern void init_frame(void) /* render base (low quality) frame */ { int restart; - /* allocate/swap buffers */ next_frame(); /* check rendering status */ @@ -667,9 +666,9 @@ init_frame(void) /* render base (low quality) frame restart = -1; if (restart > 0) { if (nprocs > 1) - ray_pdone(1); + ray_pdone(0); else - ray_done(1); + ray_done(0); } /* post low quality parameters */ if (curparams != &lorendparams) @@ -762,6 +761,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 +780,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) {