ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove1.c
(Generate patch)

Comparing ray/src/util/ranimove1.c (file contents):
Revision 3.15 by greg, Mon Nov 10 19:08:20 2008 UTC vs.
Revision 3.16 by greg, Fri Nov 5 04:36:24 2010 UTC

# Line 107 | Line 107 | next_frame(void)                       /* prepare next frame buffer */
107                  error(USER, errmsg);
108          }
109          if (cbuffer == NULL) {
110 +                int     n;
111                                          /* compute resolution and allocate */
112                  switch (sscanf(vval(RESOLUTION), "%d %d %lf",
113                                  &hres, &vres, &pixaspect)) {
# Line 142 | Line 143 | next_frame(void)                       /* prepare next frame buffer */
143                                  (cprev==NULL) | (zprev == NULL) |
144                                  (oprev==NULL) | (aprev==NULL))
145                          error(SYSTEM, "out of memory in init_frame");
146 +                for (n = hres*vres; n--; ) {
147 +                        zprev[n] = -1.f;
148 +                        oprev[n] = OVOID;
149 +                }
150                  frm_stop = getTime() + rtperfrm;
151          } else {
152                  COLOR   *cp;            /* else just swap buffers */
# Line 371 | Line 376 | init_frame_sample(void)                /* sample our initial frame *
376                  if (!sample_here(x, y)) {       /* just cast */
377                          rayorigin(&ir, PRIMARY, NULL, NULL);
378                          if (!localhit(&ir, &thescene)) {
379 <                                if (ir.ro != &Aftplane)
380 <                                        sourcehit(&ir);
379 >                                if (ir.ro != &Aftplane && sourcehit(&ir)) {
380 >                                        rayshade(&ir, ir.ro->omod);
381 >                                        rayparticipate(&ir);
382 >                                }
383                                  copycolor(cbuffer[n], ir.rcol);
384                                  zbuffer[n] = ir.rot;
385                                  obuffer[n] = ir.robj;
# Line 401 | Line 408 | init_frame_sample(void)                /* sample our initial frame *
408                  zbuffer[n] = ir.rot;
409                  obuffer[n] = ir.robj;
410                  sbuffer[n] = 1;
411 <                if (ir.rot >= FHUGE)
411 >                if (ir.rot >= 0.99*FHUGE)
412                          abuffer[n] = ADISTANT;
413                  else {
414                          abuffer[n] = ALOWQ;
# Line 454 | Line 461 | getambcolor(           /* get ambient color for object if we ca
461  
462          if (obj == OVOID)
463                  return(0);
464 <        op = objptr(obj);
465 <        if ((op->otype == OBJ_INSTANCE) & (op->omod == OVOID))
464 >        op = objptr(obj);               /* search for material */
465 >        if (op->omod == OVOID)
466                  return(0);
467 <                                        /* search for material */
468 <        do {
469 <                if (op->omod == OVOID || ofun[op->otype].flags & T_X)
463 <                        return(0);
464 <                op = objptr(op->omod);
465 <        } while (!ismaterial(op->otype));
467 >        op = findmaterial(objptr(op->omod));
468 >        if (op == NULL)
469 >                return(0);
470          /*
471           * Since this routine is called to compute the difference
472           * from rendering with and without interreflections,
# Line 476 | Line 480 | getambcolor(           /* get ambient color for object if we ca
480                          if (lv[0] == op->oname[0] &&
481                                          !strcmp(lv+1, op->oname+1))
482                                  break;
483 <                if ((lv != NULL) != hirendparams.ambincl)
483 >                if ((lv != NULL) ^ hirendparams.ambincl)
484                          return(0);
485          }
486          switch (op->otype) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines