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.62 by greg, Mon May 19 20:23:48 2014 UTC vs.
Revision 2.65 by greg, Thu Aug 21 10:33:49 2014 UTC

# Line 21 | Line 21 | static const char      RCSid[] = "$Id$";
21   #include  "ambient.h"
22   #include  "random.h"
23  
24 < #ifdef NEWAMB
24 > #ifndef OLDAMB
25  
26   extern void             SDsquare2disk(double ds[2], double seedx, double seedy);
27  
# Line 78 | Line 78 | ambsample(                             /* initial ambient division sample */
78          hlist[1] = j;
79          hlist[2] = i;
80          multisamp(spt, 2, urand(ilhash(hlist,3)+n));
81 <        if (!n) {                       /* avoid border samples for n==0 */
81 >                                        /* avoid coincident samples */
82 >        if (!n && (0 < i) & (i < hp->ns-1) &&
83 >                        (0 < j) & (j < hp->ns-1)) {
84                  if ((spt[0] < 0.1) | (spt[0] >= 0.9))
85                          spt[0] = 0.1 + 0.8*frandom();
86                  if ((spt[1] < 0.1) | (spt[1] >= 0.9))
# Line 217 | Line 219 | samp_hemi(                             /* sample indirect hemisphere */
219                          wt > (d = 0.8*intens(rcol)*r->rweight/(ambdiv*minweight)))
220                  wt = d;                 /* avoid ray termination */
221          n = sqrt(ambdiv * wt) + 0.5;
222 <        i = 1 + 5*(ambacc > FTINY);     /* minimum number of samples */
222 >        i = 1 + 8*(ambacc > FTINY);     /* minimum number of samples */
223          if (n < i)
224                  n = i;
225                                          /* allocate sampling array */
# Line 693 | Line 695 | doambient(                             /* compute ambient component */
695                  return(0);
696  
697          if ((ra == NULL) & (pg == NULL) & (dg == NULL) ||
698 <                        (hp->sampOK < 0) | (hp->ns < 4)) {
698 >                        (hp->sampOK < 0) | (hp->ns < 9)) {
699                  free(hp);               /* Hessian not requested/possible */
700                  return(-1);             /* value-only return value */
701          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines