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

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.58 by greg, Sun May 11 19:03:37 2014 UTC vs.
Revision 2.59 by greg, Fri May 16 23:39:24 2014 UTC

# Line 689 | Line 689 | doambient(                             /* compute ambient component */
689                                  addcolor(acol, ap->v);
690                                  ++cnt;
691                          }
692 <        if (!cnt) {
693 <                setcolor(rcol, 0.0, 0.0, 0.0);
694 <                free(hp);
695 <                return(0);              /* no valid samples */
696 <        }
697 <        if (cnt < hp->ns*hp->ns) {      /* incomplete sampling? */
692 >        if ((hp->ns < 4) | (cnt < hp->ns*hp->ns)) {
693 >                free(hp);               /* inadequate sampling */
694                  copycolor(rcol, acol);
695 <                free(hp);
700 <                return(-1);             /* return value w/o Hessian */
695 >                return(-cnt);           /* value-only result */
696          }
697          cnt = ambssamp*wt + 0.5;        /* perform super-sampling? */
698          if (cnt > 8)
# Line 705 | Line 700 | doambient(                             /* compute ambient component */
700          copycolor(rcol, acol);          /* final indirect irradiance/PI */
701          if ((ra == NULL) & (pg == NULL) & (dg == NULL)) {
702                  free(hp);
703 <                return(-1);             /* no radius or gradient calc. */
703 >                return(-1);             /* no Hessian or gradients requested */
704          }
705          if ((d = bright(acol)) > FTINY) {       /* normalize Y values */
706                  d = 0.99*(hp->ns*hp->ns)/d;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines