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.2 by greg, Wed Feb 19 12:00:04 1992 UTC vs.
Revision 2.4 by greg, Fri Oct 2 16:14:38 1992 UTC

# Line 27 | Line 27 | typedef struct {
27          short  nt, np;          /* number of theta and phi directions */
28   }  AMBHEMI;             /* ambient sample hemisphere */
29  
30 extern double  sin(), cos(), sqrt();
30  
32
31   static int
32   ambcmp(d1, d2)                          /* decreasing order */
33   AMBSAMP  *d1, *d2;
# Line 207 | Line 205 | FVECT  pg, dg;
205          scalecolor(acol, b);
206          if (arad <= FTINY)
207                  arad = maxarad;
208 <        else {
208 >        else
209                  arad = (ndivs+ns)/arad;
212                if (arad > maxarad)
213                        arad = maxarad;
214        }
210          if (pg != NULL) {               /* reduce radius if gradient large */
211                  d = DOT(pg,pg);
212                  if (d*arad*arad > 1.0)
# Line 225 | Line 220 | FVECT  pg, dg;
220                                  pg[i] *= d;
221                  }
222          }
223 <        return(arad/sqrt(wt));
223 >        if ((arad /= sqrt(wt)) > maxarad)
224 >                arad = maxarad;
225 >        return(arad);
226   oopsy:
227          if (div != NULL)
228                  free((char *)div);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines