ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ambient.c
(Generate patch)

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.81 by greg, Fri Apr 25 23:04:16 2014 UTC vs.
Revision 2.82 by greg, Sat Apr 26 02:59:16 2014 UTC

# Line 129 | Line 129 | setambacc(                             /* set ambient accuracy */
129          double  newa
130   )
131   {
132 <        double  ambdiff;
133 <
134 <        if (newa < 0.0)
135 <                newa = 0.0;
136 <        ambdiff = fabs(newa - ambacc);
137 <        if (ambdiff >= .01 && (ambacc = newa) > FTINY) {
138 <                qambacc = sqrt(sqrt(ambacc));
132 >        double  olda = qambacc*qambacc*qambacc*qambacc;
133 >        
134 >        newa *= (newa > 0);
135 >        if (fabs(newa - olda) >= .05*(newa + olda)) {
136 >                qambacc = sqrt(sqrt(ambacc = newa));
137                  if (nambvals > 0)
138                          sortambvals(1);         /* rebuild tree */
139          }
# Line 152 | Line 150 | setambient(void)                               /* initialize calculation */
150          ambdone();
151                                                  /* init ambient limits */
152          setambres(ambres);
153 <        qambacc = sqrt(sqrt(ambacc *= (ambacc > FTINY)));
153 >        setambacc(ambacc);
154          if (ambfile == NULL || !ambfile[0])
155                  return;
156          if (ambacc <= FTINY) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines