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.65 by greg, Thu Aug 21 10:33:49 2014 UTC vs.
Revision 2.68 by greg, Thu Oct 23 18:19:14 2014 UTC

# Line 180 | Line 180 | ambsupersamp(AMBHEMI *hp, int cnt)
180          float   *earr = getambdiffs(hp);
181          double  e2rem = 0;
182          AMBSAMP *ap;
183        RAY     ar;
183          float   *ep;
184          int     i, j, n, nss;
185  
# Line 219 | Line 218 | samp_hemi(                             /* sample indirect hemisphere */
218                          wt > (d = 0.8*intens(rcol)*r->rweight/(ambdiv*minweight)))
219                  wt = d;                 /* avoid ray termination */
220          n = sqrt(ambdiv * wt) + 0.5;
221 <        i = 1 + 8*(ambacc > FTINY);     /* minimum number of samples */
221 >        i = 1 + 5*(ambacc > FTINY);     /* minimum number of samples */
222          if (n < i)
223                  n = i;
224                                          /* allocate sampling array */
# Line 610 | Line 609 | static uint32
609   ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, const double r1)
610   {
611          const double    max_d = 1.0/(minarad*ambacc + 0.001);
612 <        const double    ang_res = 0.5*PI/(hp->ns-1);
613 <        const double    ang_step = ang_res/((int)(16/PI*ang_res) + (1+FTINY));
612 >        const double    ang_res = 0.5*PI/hp->ns;
613 >        const double    ang_step = ang_res/((int)(16/PI*ang_res) + 1.01);
614          double          avg_d = 0;
615          uint32          flgs = 0;
616          FVECT           vec;
# Line 642 | Line 641 | ambcorral(AMBHEMI *hp, FVECT uv[2], const double r0, c
641                  if ((r0*r0*u*u + r1*r1*v*v) * ap->d*ap->d <= u*u + v*v)
642                          continue;       /* occluder outside ellipse */
643                  ang = atan2a(v, u);     /* else set direction flags */
644 <                for (a1 = ang-.5*ang_res; a1 <= ang+.5*ang_res; a1 += ang_step)
644 >                for (a1 = ang-ang_res; a1 <= ang+ang_res; a1 += ang_step)
645                          flgs |= 1L<<(int)(16/PI*(a1 + 2.*PI*(a1 < 0)));
646              }
647                                          /* add low-angle incident (< 20deg) */
# Line 695 | Line 694 | doambient(                             /* compute ambient component */
694                  return(0);
695  
696          if ((ra == NULL) & (pg == NULL) & (dg == NULL) ||
697 <                        (hp->sampOK < 0) | (hp->ns < 9)) {
697 >                        (hp->sampOK < 0) | (hp->ns < 6)) {
698                  free(hp);               /* Hessian not requested/possible */
699                  return(-1);             /* value-only return value */
700          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines