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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.75 by greg, Sat Apr 19 19:20:47 2014 UTC vs.
Revision 2.78 by greg, Thu Apr 24 19:16:52 2014 UTC

# Line 152 | Line 152 | setambient(void)                               /* initialize calculation */
152          ambdone();
153                                                  /* init ambient limits */
154          setambres(ambres);
155 <        setambacc(ambacc);
155 >        qambacc = sqrt(sqrt(ambacc *= (ambacc > FTINY)));
156          if (ambfile == NULL || !ambfile[0])
157                  return;
158          if (ambacc <= FTINY) {
# Line 406 | Line 406 | sumambient(            /* get interpolated ambient value */
406                  d = 0.0;
407                  for (j = 0; j < 3; j++)
408                          d += (r->rop[j] - av->pos[j])*(uvw[2][j] + r->ron[j]);
409 <                if (d*0.5 < -minarad*ambacc-.001)
409 >                if (d*0.5 < -minarad*qambacc-.001)
410                          continue;
411                  /*
412                   *  Extrapolate value and compute final weight (hat function)
# Line 461 | Line 461 | makeambient(           /* make a new ambient value for storage
461                                                  /* compute ambient */
462          i = doambient(acol, r, amb.weight, uvw, amb.rad, amb.gpos, amb.gdir);
463          scalecolor(acol, 1./AVGREFL);           /* undo assumed reflectance */
464 <        if (i <= 0)                             /* no Hessian => no storage */
464 >        if (i <= 0 || amb.rad[0] <= FTINY)      /* no Hessian or zero radius */
465                  return(i);
466                                                  /* store value */
467          VCOPY(amb.pos, r->rop);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines