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.19 by greg, Mon Aug 22 16:07:26 2005 UTC vs.
Revision 2.21 by greg, Mon Dec 31 18:19:42 2007 UTC

# Line 28 | Line 28 | inithemi(                      /* initialize sampling hemisphere */
28          register int  i;
29                                          /* set number of divisions */
30          if (ambacc <= FTINY &&
31 <                        wt > (d = 0.8*bright(ac)*r->rweight/(ambdiv*minweight)))
31 >                        wt > (d = 0.8*intens(ac)*r->rweight/(ambdiv*minweight)))
32                  wt = d;                 /* avoid ray termination */
33          hp->nt = sqrt(ambdiv * wt / PI) + 0.5;
34          i = ambacc > FTINY ? 3 : 1;     /* minimum number of samples */
# Line 204 | Line 204 | doambient(                             /* compute ambient component */
204                          else
205                                  addcolor(acol, dp->v);
206                  }
207 <        if (!divcnt)
207 >        if (!divcnt) {
208 >                if (div != NULL)
209 >                        free((void *)div);
210                  return(0.0);            /* no samples taken */
211 +        }
212          if (divcnt < hemi.nt*hemi.np) {
213                  pg = dg = NULL;         /* incomplete sampling */
214                  hemi.ns = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines