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.81 by greg, Thu Apr 12 18:02:45 2018 UTC vs.
Revision 2.82 by greg, Thu Apr 12 20:07:09 2018 UTC

# Line 156 | Line 156 | resample:
156   }
157  
158  
159 < /* Estimate variance based on relative ambient division differences */
159 > /* Estimate variance based on ambient division differences */
160   static float *
161   getambdiffs(AMBHEMI *hp)
162   {
# Line 175 | Line 175 | getambdiffs(AMBHEMI *hp)
175                  b = bright(ap[0].v);
176                  if (i) {                /* from above */
177                          b1 = bright(ap[-hp->ns].v);
178 <                        d2 = (b - b1)/(b + b1);
179 <                        d2 *= d2*normf;
178 >                        d2 = b - b1;
179 >                        d2 *= d2*normf/(b + b1);
180                          ep[0] += d2;
181                          ep[-hp->ns] += d2;
182                  }
183                  if (!j) continue;
184                                          /* from behind */
185                  b1 = bright(ap[-1].v);
186 <                d2 = (b - b1)/(b + b1);
187 <                d2 *= d2*normf;
186 >                d2 = b - b1;
187 >                d2 *= d2*normf/(b + b1);
188                  ep[0] += d2;
189                  ep[-1] += d2;
190                  if (!i) continue;
191                                          /* diagonal */
192                  b1 = bright(ap[-hp->ns-1].v);
193 <                d2 = (b - b1)/(b + b1);
194 <                d2 *= d2*normf;
193 >                d2 = b - b1;
194 >                d2 *= d2*normf/(b + b1);
195                  ep[0] += d2;
196                  ep[-hp->ns-1] += d2;
197              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines