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.66 by greg, Thu Sep 4 09:09:08 2014 UTC vs.
Revision 2.71 by greg, Tue Mar 15 20:35:41 2016 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 236 | Line 235 | samp_hemi(                             /* sample indirect hemisphere */
235          d = 1.0/(n*n);
236          scalecolor(hp->acoef, d);
237                                          /* make tangent plane axes */
238 <        hp->uy[0] = 0.5 - frandom();
240 <        hp->uy[1] = 0.5 - frandom();
241 <        hp->uy[2] = 0.5 - frandom();
242 <        for (i = 3; i--; )
243 <                if ((-0.6 < r->ron[i]) & (r->ron[i] < 0.6))
244 <                        break;
245 <        if (i < 0)
238 >        if (!getperpendicular(hp->ux, r->ron, 1))
239                  error(CONSISTENCY, "bad ray direction in samp_hemi");
247        hp->uy[i] = 1.0;
248        VCROSS(hp->ux, hp->uy, r->ron);
249        normalize(hp->ux);
240          VCROSS(hp->uy, r->ron, hp->ux);
241                                          /* sample divisions */
242          for (i = hp->ns; i--; )
# Line 695 | Line 685 | doambient(                             /* compute ambient component */
685                  return(0);
686  
687          if ((ra == NULL) & (pg == NULL) & (dg == NULL) ||
688 <                        (hp->sampOK < 0) | (hp->ns < 9)) {
688 >                        (hp->sampOK < 0) | (hp->ns < 6)) {
689                  free(hp);               /* Hessian not requested/possible */
690                  return(-1);             /* value-only return value */
691          }
# Line 743 | Line 733 | doambient(                             /* compute ambient component */
733                                  ra[0] = maxarad;
734                  }
735                                          /* flag encroached directions */
736 <                if ((wt >= 0.89*AVGREFL) & (crlp != NULL))
736 >                if (crlp != NULL)
737                          *crlp = ambcorral(hp, uv, ra[0]*ambacc, ra[1]*ambacc);
738                  if (pg != NULL) {       /* cap gradient if necessary */
739                          d = pg[0]*pg[0]*ra[0]*ra[0] + pg[1]*pg[1]*ra[1]*ra[1];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines